From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:00:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7D14851; Sun, 2 Nov 2014 00:00:42 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC21E949; Sun, 2 Nov 2014 00:00:41 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id bs8so3867154wib.11 for ; Sat, 01 Nov 2014 17:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=n9mia2D4FsCst9JjaYfQjPGzYba3y4s5O4gmh8Wh0Sw=; b=HP7tIp31zLK1YrDNjJK+cOQB6ubpy7zQnhru8CwXMiHATtzen6X0655fhvFjA87yjh yCbqULdSlMLgtB/g+W/W3CFpn9MRTVkj6ie7jCYHhrWmD7Pv/RhgV/JBOir0WFtKqpL2 3CkcAsrjdBlViRFdINWIwhqzP4yUJAWPRxWbFlPA79MuS7Cj/6WQ8VAwg0/+2atMmZc/ wDZsecf4dp9OzO8uQ/qDDU/Fypoi3WrhavkQKJlDkh2N01YL1seIVQ4D6p1hf5e/o6Qg VKqsMSK3x9CjYYp3f8cT6Xryje4SfLEEi+em4ejDeAlDb5gKllHXqVCtdq+TDG0VP07D oetg== MIME-Version: 1.0 X-Received: by 10.180.188.41 with SMTP id fx9mr6315057wic.59.1414886440142; Sat, 01 Nov 2014 17:00:40 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 17:00:40 -0700 (PDT) In-Reply-To: <1414886231.17308.238.camel@revolution.hippie.lan> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> Date: Sat, 1 Nov 2014 17:00:40 -0700 X-Google-Sender-Auth: DZgrE81Em8f_oKxmnWDJY3zgeMA Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:00:43 -0000 Hi, Right - but I'm not even getting to anywhere near this point. It's hanging in hostapd when hostapd tries reading random data. again, if i try ctrl-C'ing whilst the random device is inside random_adaptor_read(), it's just .. broken. The read doesn't finish, the process doesn't accept any new input, signals or anything - it just doesn't work. So, is there some way to go back to whatever the previous revision before this did? It at least comes up and doesn't hang things. Thanks, -adrian On 1 November 2014 16:57, Ian Lepore wrote: > On Sun, 2014-11-02 at 00:33 +0100, Dag-Erling Sm=C3=B8rgrav wrote: >> Dag-Erling Sm=C3=B8rgrav writes: >> > From the code. This is a portion of the rc script that only runs at >> > shutdown. If random_stop() runs during boot, something is seriously >> > wrong *somewhere else* and you are welcome to help find out what. >> >> I found it - postrandom triggers it. For now, just remove >> /etc/rc.d/postrandom (I'm not sure it's really needed, there are better >> ways to do this). >> >> DES > > It appears another quick easy workaround is to set entropy_file=3DNO in > rc.conf, which may be the right thing to do for people using a varmfs > that isn't going to survive a reboot anyway, even after this glitch is > fixed. > > -- Ian > > From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:09:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F81DB00; Sun, 2 Nov 2014 00:09:34 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id BD4E9986; Sun, 2 Nov 2014 00:09:33 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 5BFD4A606; Sun, 2 Nov 2014 00:09:32 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id CE07710AC9; Sun, 2 Nov 2014 01:09:34 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414885448.17308.236.camel@revolution.hippie.lan> Date: Sun, 02 Nov 2014 01:09:34 +0100 In-Reply-To: <1414885448.17308.236.camel@revolution.hippie.lan> (Ian Lepore's message of "Sat, 01 Nov 2014 17:44:08 -0600") Message-ID: <86egtm5upt.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:09:34 -0000 Ian Lepore writes: > Yeah. I vaguely remember discussion about this something like 12-18 > months ago. As I remember it, there was a desire to avoid using the > same startup saved entropy on a rapid series of reboots and the thinking > was to combat that by generating some fresh saved entropy on each boot. Sure, but this can be done from cron instead of an rc script (see below). > It seems like that should work if the old saved entropy were stirred > in with the modicum of boot-time entropy before generating a new save > file. That's what happens in random_start(). > I was thinking maybe postrandom should only try to save a new file if > there are some existing files to avoid the possibility of hanging. But > when I look at postrandom more closely, it seems to be generating a save > file, then deleting it along with all the other save files. Umm, yes, I hadn't noticed that (I only reviewed the kernel code). I think we should just remove the fastsaveseed line. Instead, make a @reboot entry for save-entropy in /etc/crontab. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:11:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16F8EC52; Sun, 2 Nov 2014 00:11:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 026F399A; Sun, 2 Nov 2014 00:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA20BQR6038831; Sun, 2 Nov 2014 00:11:26 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA20BQsh038825; Sun, 2 Nov 2014 00:11:26 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411020011.sA20BQsh038825@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sun, 2 Nov 2014 00:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273955 - in head: etc/rc.d share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:11:27 -0000 Author: jmg Date: Sun Nov 2 00:11:25 2014 New Revision: 273955 URL: https://svnweb.freebsd.org/changeset/base/273955 Log: add an rc.d script to automatically grow the specified FS... It has been tested on both MBR and GPT... It won't be enabled until you add growfs_enable="YES" and will only run on first boot.. Added: head/etc/rc.d/growfs (contents, props changed) head/share/man/man7/growfs.7 (contents, props changed) Modified: head/etc/rc.d/Makefile head/share/man/man7/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Nov 2 00:05:52 2014 (r273954) +++ head/etc/rc.d/Makefile Sun Nov 2 00:11:25 2014 (r273955) @@ -49,6 +49,7 @@ FILES= DAEMON \ geli \ geli2 \ gptboot \ + growfs \ gssd \ hastd \ ${_hcsecd} \ Added: head/etc/rc.d/growfs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/growfs Sun Nov 2 00:11:25 2014 (r273955) @@ -0,0 +1,98 @@ +#!/bin/sh +# +# Copyright 2014 John-Mark Gurney +# 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$ +# + +# PROVIDE: growfs +# BEFORE: sysctl +# KEYWORD: firstboot + +# This allows us to distribute a image +# and have it work on essentially any size drive. +# +# TODO: Figure out where this should really be ordered. +# I suspect it should go just after fsck but before mountcritlocal +# but it's hard to tell for sure because of the bug described +# below. +# + +. /etc/rc.subr + +name="growfs" +start_cmd="growfs_start" +stop_cmd=":" +rcvar="growfs_enable" + +growfs_start () +{ + echo "Growing root partition to fill device" + rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }') + if [ x"$rootdev" = x"${rootdev%/*}" ]; then + # raw device + rawdev="$rootdev" + else + rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }') + if [ x"$rawdev" = x"" ]; then + echo "Can't figure out device for: $rootdev" + return + fi + fi + + sysctl -b kern.geom.conftxt | awk ' +{ + lvl=$1 + device[lvl] = $3 + type[lvl] = $2 + idx[lvl] = $7 + parttype[lvl] = $13 + if (dev == $3) { + for (i = 1; i <= lvl; i++) { + # resize + if (type[i] == "PART") { + pdev = device[i - 1] + cmd[i] = "gpart resize -i " idx[i] " " pdev + if (parttype[i] == "GPT") + cmd[i] = "gpart recover " pdev " ; " cmd[i] + } else if (type[i] == "LABEL") { + continue + } else { + print "unhandled type: " type[i] + exit 1 + } + } + for (i = 1; i <= lvl; i++) { + if (cmd[i]) + system(cmd[i]) + } + exit 0 + } +}' dev="$rawdev" + growfs -y /dev/"$rootdev" +} + +load_rc_config $name +run_rc_command "$1" Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Sun Nov 2 00:05:52 2014 (r273954) +++ head/share/man/man7/Makefile Sun Nov 2 00:11:25 2014 (r273955) @@ -14,6 +14,7 @@ MAN= adding_user.7 \ environ.7 \ ffs.7 \ firewall.7 \ + growfs.7 \ hier.7 \ hostname.7 \ intro.7 \ Added: head/share/man/man7/growfs.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/growfs.7 Sun Nov 2 00:11:25 2014 (r273955) @@ -0,0 +1,64 @@ +.\" Copyright 2014 John-Mark Gurney +.\" 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 November 1, 2014 +.Dt GROWFS 7 +.Os +.Sh NAME +.Nm growfs +.Nd start up script to grow the root file-system. +.Sh DESCRIPTION +The following options in +.Pa /etc/rc.conf +control the behavior of +.Nm : +.Bl -tag -width ".Va growfs_enable" -offset indent +.It Va growfs_enable +.Pq Dq Li NO +If set to +.Dq Li YES , +the first time the machine boots, the root file-system will be automatically +expanded, if possible, to fill up all available space after it. +.El +.Pp +To expand the root file-system with-out rebooting, run the following command: +.Dl % /etc/rc.d/growfs onestart +.Sh IMPLEMENTATION NOTES +The script requires that +.Pa awk +be present and on the path. +This usually means that +.Pa /usr +should be mounted prior to running the script. +.Sh FILES +.Pa /etc/rc.conf +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr rc.conf 5 +.Sh AUTHORS +The man page and script were written by +.An John-Mark Gurney Aq Mt jmg@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:12:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1389BD94; Sun, 2 Nov 2014 00:12:53 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id BEBC7A2A; Sun, 2 Nov 2014 00:12:52 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CE4CAA612; Sun, 2 Nov 2014 00:12:51 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 52ACC10ACC; Sun, 2 Nov 2014 01:12:54 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> Date: Sun, 02 Nov 2014 01:12:54 +0100 In-Reply-To: (Adrian Chadd's message of "Sat, 1 Nov 2014 17:00:40 -0700") Message-ID: <86a94a5uk9.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:12:53 -0000 Adrian Chadd writes: > So, is there some way to go back to whatever the previous revision > before this did? It at least comes up and doesn't hang things. svn up -r273871 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:13:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F78ED3; Sun, 2 Nov 2014 00:13:00 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46189A2E; Sun, 2 Nov 2014 00:12:59 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id m15so3398679wgh.7 for ; Sat, 01 Nov 2014 17:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=E8Y4DgtbxqNWIXwKvSeAYaBhwGNWI3PdKXAYk/ay6Zo=; b=GuJCfkIGMX9PeEhZh2dtljdMJVbKP3XWC7Z9Aosa1qk608NXUdCpTSIw4NUryyLwOE BC04DbAAUuPWyZ8zxT0CNGXk6u7qX6amnJqaWI8RenSHLv+7XkI++g7TFdzqAerOEOD9 xhgaZs8TSvLZ2T4PbnOtJz7caU9OSJ6aRpg9I59Z2kOtZXzDPqoer5PCbewdTkd4nvh2 NfbbLhsLOaYNZeQX43hGLYD3epzwRU+f6HeQX9P1yCxy5tc+eS8cbhnR3tz9KYJdKFrc B/CfFdaxueELVfRkcwCUP7K/U4cltWj/9/CwDX2oX45olxrg/lnHOmRE76HeG6VUyQtN ERQg== MIME-Version: 1.0 X-Received: by 10.194.219.230 with SMTP id pr6mr36749752wjc.40.1414887177624; Sat, 01 Nov 2014 17:12:57 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 17:12:57 -0700 (PDT) In-Reply-To: References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> Date: Sat, 1 Nov 2014 17:12:57 -0700 X-Google-Sender-Auth: Bq936K6pwYPBZpVsp6EVn6IR6rw Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:13:00 -0000 Ok, so i figured maybe it hadn't been seeded just yet: # cat /boot/kernel/* | dd of=/dev/random bs=8k random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: random_adaptor_write 8192 random: reseed - fast - thresh 96,1 - 130 28 0 0 0 0 0 0 14977 0 0 0 0 0 0 0 0 0 0 0 random: reseed - slow - thresh 128,2 - 130 28 0 0 0 0 0 0 14976 0 0 0 0 0 0 0 0 0 0 0 random: unblocking device. .. at that point things worked fine. So, hm. How do us embedded people just unblock it for now at boot, so we can actually _get_ enough entropy? Thanks, -adrian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:26:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5232151; Sun, 2 Nov 2014 00:26:41 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 6DCA7AF5; Sun, 2 Nov 2014 00:26:40 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 8E3EAA633; Sun, 2 Nov 2014 00:26:39 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 056BD10ACF; Sun, 2 Nov 2014 01:26:41 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> Date: Sun, 02 Nov 2014 01:26:40 +0100 In-Reply-To: (Adrian Chadd's message of "Sat, 1 Nov 2014 17:12:57 -0700") Message-ID: <8661ey5txb.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:26:41 -0000 Adrian Chadd writes: > Ok, so i figured maybe it hadn't been seeded just yet: which is what I've been saying all along. And the reason it hasn't been reseeded is that Mark disabled the automatic reseeding that used to happen late in the boot :( I'm working on a patch. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 00:29:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF5302A2; Sun, 2 Nov 2014 00:29:52 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE510B02; Sun, 2 Nov 2014 00:29:51 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id d1so3909065wiv.1 for ; Sat, 01 Nov 2014 17:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=XbQlHHfvtqHxEdr/clQE1Wg2k0Q1hgCNW+zgL/nqbdw=; b=MrSsDz+G4i0IYEWAcooIlU2nZyeaJf2I0CyPFbSMZdoE0TZNZKmqvUXbl+XrbQrGcd TigqIl2J6FlTYB9UqJiKlt4lCnCbhuEUy9CTc7UGDrVEn1M3EFsBi40/9GKrkoOxYpLF raTFsjdzGqEWV6qMvWLGaPFfgIRaWWSK5gJ8O8Twov79Mgyqy5YyeEuAXARUWdeeipu7 UpMy9hp1MfNFruKSjCBMS9Rz+xFbwwfnrqCf0lE0kx02L8LQX2hseDhXN2fceoXlsNaq X6zI0VaAu7hku355Gtf/HbicHWQY/i6ZoJGt9+Py6hk/SBTBXw8jpmYx7W9QTfm0WsBN 8A6A== MIME-Version: 1.0 X-Received: by 10.180.106.162 with SMTP id gv2mr6599551wib.26.1414888190208; Sat, 01 Nov 2014 17:29:50 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 17:29:50 -0700 (PDT) In-Reply-To: <8661ey5txb.fsf@nine.des.no> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> <8661ey5txb.fsf@nine.des.no> Date: Sat, 1 Nov 2014 17:29:50 -0700 X-Google-Sender-Auth: 0vqejDwcFPu2CJIOELHgeeUPMqY Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 00:29:53 -0000 On 1 November 2014 17:26, Dag-Erling Sm=C3=B8rgrav wrote: > Adrian Chadd writes: >> Ok, so i figured maybe it hadn't been seeded just yet: > > which is what I've been saying all along. > > And the reason it hasn't been reseeded is that Mark disabled the > automatic reseeding that used to happen late in the boot :( > > I'm working on a patch. Ok, thanks. I'm happy to test it out on this MIPS AP I have on my bench right now. -adrian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 01:13:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C5D7921; Sun, 2 Nov 2014 01:13:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CB2EC1; Sun, 2 Nov 2014 01:13:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA21DC2K067714; Sun, 2 Nov 2014 01:13:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA21DCt9067713; Sun, 2 Nov 2014 01:13:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411020113.sA21DCt9067713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Nov 2014 01:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273956 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 01:13:12 -0000 Author: mjg Date: Sun Nov 2 01:13:11 2014 New Revision: 273956 URL: https://svnweb.freebsd.org/changeset/base/273956 Log: filedesc: lock filedesc lock in fdcloseexec only when needed Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 2 00:11:25 2014 (r273955) +++ head/sys/kern/kern_descrip.c Sun Nov 2 01:13:11 2014 (r273956) @@ -2160,19 +2160,17 @@ fdcloseexec(struct thread *td) fdp = td->td_proc->p_fd; KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); - FILEDESC_XLOCK(fdp); for (i = 0; i <= fdp->fd_lastfile; i++) { fde = &fdp->fd_ofiles[i]; fp = fde->fde_file; if (fp != NULL && (fp->f_type == DTYPE_MQUEUE || (fde->fde_flags & UF_EXCLOSE))) { + FILEDESC_XLOCK(fdp); fdfree(fdp, i); (void) closefp(fdp, i, fp, td, 0); /* closefp() drops the FILEDESC lock. */ - FILEDESC_XLOCK(fdp); } } - FILEDESC_XUNLOCK(fdp); } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 01:47:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA567417; Sun, 2 Nov 2014 01:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E6C211; Sun, 2 Nov 2014 01:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA21lSw2082700; Sun, 2 Nov 2014 01:47:28 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA21lRW0082695; Sun, 2 Nov 2014 01:47:27 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411020147.sA21lRW0082695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Sun, 2 Nov 2014 01:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273957 - in head: . etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 01:47:29 -0000 Author: des Date: Sun Nov 2 01:47:27 2014 New Revision: 273957 URL: https://svnweb.freebsd.org/changeset/base/273957 Log: Get rid of the postrandom script. It was born in a time when the random script ran before filesystems were mounted, which is no longer the case. In random_start(), immediately delete each file that is fed into /dev/random, and recreate the default entropy file immediately after reading and deleting it. The logic used in random_stop() to determine which file to write to should probably be factored out and used here as well. Deleted: head/etc/rc.d/postrandom Modified: head/ObsoleteFiles.inc head/etc/rc.d/Makefile head/etc/rc.d/adjkerntz head/etc/rc.d/random Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 2 01:13:11 2014 (r273956) +++ head/ObsoleteFiles.inc Sun Nov 2 01:47:27 2014 (r273957) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20141102: postrandom obsoleted by new /dev/random code +OLD_FILES+=etc/rc.d/postrandom # 20141031: initrandom obsoleted by new /dev/random code OLD_FILES+=etc/rc.d/initrandom # 20141028: debug files accidentally installed as directory name Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Nov 2 01:13:11 2014 (r273956) +++ head/etc/rc.d/Makefile Sun Nov 2 01:47:27 2014 (r273957) @@ -112,7 +112,6 @@ FILES= DAEMON \ pf \ pflog \ pfsync \ - postrandom \ powerd \ power_profile \ ppp \ Modified: head/etc/rc.d/adjkerntz ============================================================================== --- head/etc/rc.d/adjkerntz Sun Nov 2 01:13:11 2014 (r273956) +++ head/etc/rc.d/adjkerntz Sun Nov 2 01:47:27 2014 (r273957) @@ -4,7 +4,7 @@ # # PROVIDE: adjkerntz -# REQUIRE: FILESYSTEMS postrandom +# REQUIRE: FILESYSTEMS # BEFORE: netif # KEYWORD: nojail Modified: head/etc/rc.d/random ============================================================================== --- head/etc/rc.d/random Sun Nov 2 01:13:11 2014 (r273956) +++ head/etc/rc.d/random Sun Nov 2 01:47:27 2014 (r273957) @@ -17,41 +17,58 @@ stop_cmd="random_stop" extra_commands="saveseed" saveseed_cmd="${name}_stop" +save_dev_random() +{ + for f ; do + if :>>"$f" ; then + debug "saving entropy to $f" + dd if=/dev/random of="$f" bs=4096 count=1 2>/dev/null + fi + done +} + feed_dev_random() { - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then - cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null - fi + for f ; do + if [ -f "$f" -a -r "$f" -a -s "$f" ] ; then + if dd if="$f" of=/dev/random bs=4096 2>/dev/null ; then + debug "entropy read from $f" + rm -f "$f" + fi + fi + done } random_start() { + echo -n 'Feeding entropy:' + + if [ ! -w /dev/random ] ; then + warn "/dev/random is not writeable" + return 1 + fi + # Reseed /dev/random with previously stored entropy. - case ${entropy_dir} in + case ${entropy_dir:=/var/db/entropy} in [Nn][Oo]) ;; *) - entropy_dir=${entropy_dir:-/var/db/entropy} - if [ -d "${entropy_dir}" ]; then - if [ -w /dev/random ]; then - for seedfile in ${entropy_dir}/*; do - feed_dev_random "${seedfile}" - done - fi + if [ -d "${entropy_dir}" ] ; then + feed_dev_random "${entropy_dir}"/* fi ;; esac - case ${entropy_file} in + case ${entropy_file:=/entropy} in [Nn][Oo] | '') ;; *) - if [ -w /dev/random ]; then - feed_dev_random "${entropy_file}" - feed_dev_random /var/db/entropy-file - fi + feed_dev_random "${entropy_file}" /var/db/entropy-file + save_dev_random "${entropy_file}" ;; esac + + echo '.' } random_stop() @@ -59,7 +76,7 @@ random_stop() # Write some entropy so when the machine reboots /dev/random # can be reseeded # - case ${entropy_file} in + case ${entropy_file:=/entropy} in [Nn][Oo] | '') ;; *) From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 02:01:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00FCE5D0; Sun, 2 Nov 2014 02:01:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C80563A1; Sun, 2 Nov 2014 02:01:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA221ue5091495; Sun, 2 Nov 2014 02:01:56 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA221unt091493; Sun, 2 Nov 2014 02:01:56 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411020201.sA221unt091493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Sun, 2 Nov 2014 02:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273958 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 02:01:57 -0000 Author: des Date: Sun Nov 2 02:01:55 2014 New Revision: 273958 URL: https://svnweb.freebsd.org/changeset/base/273958 Log: Restore the auto-reseed logic, but move it to a much later point, immediately before kick_init. Approved by: so (self) Modified: head/sys/dev/random/random_adaptors.c head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Sun Nov 2 01:47:27 2014 (r273957) +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 02:01:55 2014 (r273958) @@ -447,30 +447,8 @@ random_adaptors_deinit(void) } /* - * First seed. - * - * NB! NB! NB! - * NB! NB! NB! - * - * It turns out this is bloody dangerous. I was fiddling with code elsewhere - * and managed to get conditions where a safe (i.e. seeded) entropy device should - * not have been possible. This managed to hide that by unblocking the device anyway. - * As crap randomness is not directly distinguishable from good randomness, this - * could have gone unnoticed for quite a while. - * - * NB! NB! NB! - * NB! NB! NB! - * - * Very luckily, the probe-time entropy is very nearly good enough to cause a - * first seed all of the time, and the default settings for other entropy - * harvesting causes a proper, safe, first seed (unblock) in short order after that. - * - * That said, the below would be useful where folks are more concerned with - * a quick start than with extra paranoia in a low-entropy environment. - * - * markm - October 2013. + * Reseed the active adaptor shortly before starting init(8). */ -#ifdef RANDOM_AUTOSEED /* ARGSUSED */ static void random_adaptors_seed(void *unused __unused) @@ -484,6 +462,5 @@ random_adaptors_seed(void *unused __unus arc4rand(NULL, 0, 1); } -SYSINIT(random_seed, SI_SUB_INTRINSIC_POST, SI_ORDER_LAST, - random_adaptors_reseed, NULL); -#endif /* RANDOM_AUTOSEED */ +SYSINIT(random_seed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, + random_adaptors_seed, NULL); Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Sun Nov 2 01:47:27 2014 (r273957) +++ head/sys/dev/random/yarrow.c Sun Nov 2 02:01:55 2014 (r273958) @@ -508,7 +508,9 @@ void random_yarrow_reseed(void) { + mtx_lock(&random_reseed_mtx); reseed(SLOW); + mtx_unlock(&random_reseed_mtx); } int From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 02:05:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51D5EA54; Sun, 2 Nov 2014 02:05:51 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 06C083E1; Sun, 2 Nov 2014 02:05:50 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id C0B53A760; Sun, 2 Nov 2014 02:05:49 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 2DD7810AE3; Sun, 2 Nov 2014 03:05:52 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Adrian Chadd Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> <8661ey5txb.fsf@nine.des.no> Date: Sun, 02 Nov 2014 03:05:52 +0100 In-Reply-To: (Adrian Chadd's message of "Sat, 1 Nov 2014 17:29:50 -0700") Message-ID: <86vbmy4arj.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 02:05:51 -0000 Adrian Chadd writes: > Dag-Erling Sm=C3=B8rgrav writes: > > I'm working on a patch. > Ok, thanks. I'm happy to test it out on this MIPS AP I have on my > bench right now. r273957 cleans up the rc scripts, r273958 re-enables auto-reseed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 02:32:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA622DC5; Sun, 2 Nov 2014 02:32:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 975A885D; Sun, 2 Nov 2014 02:32:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA22WY69005950; Sun, 2 Nov 2014 02:32:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA22WYV6005949; Sun, 2 Nov 2014 02:32:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411020232.sA22WYV6005949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Nov 2014 02:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273959 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 02:32:34 -0000 Author: mjg Date: Sun Nov 2 02:32:33 2014 New Revision: 273959 URL: https://svnweb.freebsd.org/changeset/base/273959 Log: filedesc: tidy up fdcheckstd No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 2 02:01:55 2014 (r273958) +++ head/sys/kern/kern_descrip.c Sun Nov 2 02:32:33 2014 (r273959) @@ -2189,29 +2189,28 @@ fdcheckstd(struct thread *td) fdp = td->td_proc->p_fd; KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); + MPASS(fdp->fd_nfiles >= 3); devnull = -1; - error = 0; - for (i = 0; i < 3; i++) { + for (i = 0; i <= 2; i++) { if (fdp->fd_ofiles[i].fde_file != NULL) continue; - if (devnull < 0) { - save = td->td_retval[0]; + + save = td->td_retval[0]; + if (devnull != -1) { + error = do_dup(td, DUP_FIXED, devnull, i); + } else { error = kern_open(td, "/dev/null", UIO_SYSSPACE, O_RDWR, 0); - devnull = td->td_retval[0]; - td->td_retval[0] = save; - if (error) - break; - KASSERT(devnull == i, ("oof, we didn't get our fd")); - } else { - save = td->td_retval[0]; - error = do_dup(td, DUP_FIXED, devnull, i); - td->td_retval[0] = save; - if (error != 0) - break; + if (error == 0) { + devnull = td->td_retval[0]; + KASSERT(devnull == i, ("we didn't get our fd")); + } } + td->td_retval[0] = save; + if (error != 0) + return (error); } - return (error); + return (0); } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 03:10:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD9C735E; Sun, 2 Nov 2014 03:10:16 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D30BA6; Sun, 2 Nov 2014 03:10:16 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XklYV-0007sP-Az; Sun, 02 Nov 2014 03:10:15 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA23ADDR088521; Sat, 1 Nov 2014 21:10:14 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+KHEVk4e7vJrv9iLyPK5w8 X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <86vbmy4arj.fsf@nine.des.no> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> <8661ey5txb.fsf@nine.des.no> <86vbmy4arj.fsf@nine.des.no> Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 01 Nov 2014 21:10:13 -0600 Message-ID: <1414897813.17308.240.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA23ADDR088521 Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 03:10:16 -0000 On Sun, 2014-11-02 at 03:05 +0100, Dag-Erling Sm=F8rgrav wrote: > Adrian Chadd writes: > > Dag-Erling Sm=F8rgrav writes: > > > I'm working on a patch. > > Ok, thanks. I'm happy to test it out on this MIPS AP I have on my > > bench right now. >=20 > r273957 cleans up the rc scripts, r273958 re-enables auto-reseed. >=20 > DES That fixes it on my RPi board, thanks. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 03:37:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEDE686B for ; Sun, 2 Nov 2014 03:37:36 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66AE8E0C for ; Sun, 2 Nov 2014 03:37:36 +0000 (UTC) Received: (qmail 75584 invoked by uid 89); 2 Nov 2014 03:37:32 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 2 Nov 2014 03:37:32 -0000 Received: (qmail 73715 invoked by uid 89); 2 Nov 2014 03:26:32 -0000 Received: by simscan 1.3.1 ppid: 73705, pid: 73711, t: 0.1416s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 2 Nov 2014 03:26:32 -0000 Received: (qmail 19655 invoked by uid 89); 2 Nov 2014 03:26:31 -0000 Received: by simscan 1.4.0 ppid: 19606, pid: 19644, t: 1.0265s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 2 Nov 2014 03:26:30 -0000 From: Jan Beich To: Mark Murray Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> Date: Sun, 02 Nov 2014 04:26:21 +0100 In-Reply-To: <201410302121.s9ULLsEw055630@svn.freebsd.org> (Mark Murray's message of "Thu, 30 Oct 2014 21:21:54 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 03:37:36 -0000 Mark Murray writes: > Log: > This is the much-discussed major upgrade to the random(4) device, > known to you all as /dev/random. [...] > Modified: head/sys/dev/random/randomdev_soft.c > =================================================================== > --- head/sys/dev/random/randomdev_soft.c (revision 273871) > +++ head/sys/dev/random/randomdev_soft.c (revision 273872) [...] > +MID_DEV_MODULE(yarrow, randomdev_soft_modevent, NULL); > +MODULE_VERSION(yarrow, 1); > +MODULE_DEPEND(yarrow, random_adaptors, 1, 1, 1); I have a minimalistic kernel where everything is pushed to a module for easier/faster debugging before kload. As its config has no |device random| loading random.ko fails because nothing provides random_adaptors e.g., try $ grep -r MODULE_VERSION.\*random_adaptors sys/dev/random ------------------------------------------------- VFEmail.net - http://www.vfemail.net ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options! From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 05:34:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76E17AA; Sun, 2 Nov 2014 05:34:52 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93742995; Sun, 2 Nov 2014 05:34:51 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so3849707wiv.4 for ; Sat, 01 Nov 2014 22:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=LrvZWgR0eCfW1UplE10rUCa/ZmRqQPPA/Vmw0t60cXE=; b=EWRoHsrRs8Ivv56OwcMJvrOkut9khsEEQCPDhejSUQ1GaGYpG+wBSwzQ/+VlMnjfjZ zgIVkymtpnGXZDH/6Ty3qvVPl07cNg7DNN/lyMSvf4cug9jMqaApQ9NO+xZY55WzQFkA TvtWnresYQIaiVqit1t/hTiU2usbzVdBBmKCBLGBZx0sLUdmDCjvQS3c6hrbB0Q7Rcf7 atxFcPxWbmoYxVbEjNFfxTKuMVtC4n10zpeV/s19EECld9s+EcuoYDkY6B5dd1RSyGsx T6zjPgCZzvidt0EFukn2ggH+QAffz2iGgbia4zuHLJwyX8RNGMmsPf3H4eH0spH6HXT9 CmvQ== MIME-Version: 1.0 X-Received: by 10.194.192.161 with SMTP id hh1mr40135840wjc.72.1414906489510; Sat, 01 Nov 2014 22:34:49 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 22:34:49 -0700 (PDT) In-Reply-To: <201411020201.sA221unt091493@svn.freebsd.org> References: <201411020201.sA221unt091493@svn.freebsd.org> Date: Sat, 1 Nov 2014 22:34:49 -0700 X-Google-Sender-Auth: w2RfS-7fW4POC9c3g1HERkD4lUE Message-ID: Subject: Re: svn commit: r273958 - head/sys/dev/random From: Adrian Chadd To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 05:34:52 -0000 Woo, this fixed the embedded boot! Thanks! -adrian On 1 November 2014 19:01, Dag-Erling Sm=C3=B8rgrav wrote: > Author: des > Date: Sun Nov 2 02:01:55 2014 > New Revision: 273958 > URL: https://svnweb.freebsd.org/changeset/base/273958 > > Log: > Restore the auto-reseed logic, but move it to a much later point, > immediately before kick_init. > > Approved by: so (self) > > Modified: > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/yarrow.c > > Modified: head/sys/dev/random/random_adaptors.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/random_adaptors.c Sun Nov 2 01:47:27 2014 = (r273957) > +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 02:01:55 2014 = (r273958) > @@ -447,30 +447,8 @@ random_adaptors_deinit(void) > } > > /* > - * First seed. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * It turns out this is bloody dangerous. I was fiddling with code elsew= here > - * and managed to get conditions where a safe (i.e. seeded) entropy devi= ce should > - * not have been possible. This managed to hide that by unblocking the d= evice anyway. > - * As crap randomness is not directly distinguishable from good randomne= ss, this > - * could have gone unnoticed for quite a while. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * Very luckily, the probe-time entropy is very nearly good enough to ca= use a > - * first seed all of the time, and the default settings for other entrop= y > - * harvesting causes a proper, safe, first seed (unblock) in short order= after that. > - * > - * That said, the below would be useful where folks are more concerned w= ith > - * a quick start than with extra paranoia in a low-entropy environment. > - * > - * markm - October 2013. > + * Reseed the active adaptor shortly before starting init(8). > */ > -#ifdef RANDOM_AUTOSEED > /* ARGSUSED */ > static void > random_adaptors_seed(void *unused __unused) > @@ -484,6 +462,5 @@ random_adaptors_seed(void *unused __unus > > arc4rand(NULL, 0, 1); > } > -SYSINIT(random_seed, SI_SUB_INTRINSIC_POST, SI_ORDER_LAST, > - random_adaptors_reseed, NULL); > -#endif /* RANDOM_AUTOSEED */ > +SYSINIT(random_seed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, > + random_adaptors_seed, NULL); > > Modified: head/sys/dev/random/yarrow.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/yarrow.c Sun Nov 2 01:47:27 2014 (= r273957) > +++ head/sys/dev/random/yarrow.c Sun Nov 2 02:01:55 2014 (= r273958) > @@ -508,7 +508,9 @@ void > random_yarrow_reseed(void) > { > > + mtx_lock(&random_reseed_mtx); > reseed(SLOW); > + mtx_unlock(&random_reseed_mtx); > } > > int > From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 05:51:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F99233C; Sun, 2 Nov 2014 05:51:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C305B0D; Sun, 2 Nov 2014 05:51:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA25pWZd098615; Sun, 2 Nov 2014 05:51:32 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA25pW6Z098614; Sun, 2 Nov 2014 05:51:32 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411020551.sA25pW6Z098614@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 2 Nov 2014 05:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273960 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 05:51:32 -0000 Author: glebius Date: Sun Nov 2 05:51:31 2014 New Revision: 273960 URL: https://svnweb.freebsd.org/changeset/base/273960 Log: NG_NODE_NAME(node) is always not NULL. Use correct macro. Submitted by: Dmitry Luhtionov Modified: head/sys/netgraph/ng_bridge.c Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Sun Nov 2 02:32:33 2014 (r273959) +++ head/sys/netgraph/ng_bridge.c Sun Nov 2 05:51:31 2014 (r273960) @@ -1046,7 +1046,7 @@ ng_bridge_nodename(node_p node) { static char name[NG_NODESIZ]; - if (NG_NODE_NAME(node) != NULL) + if (NG_NODE_HAS_NAME(node)) snprintf(name, sizeof(name), "%s", NG_NODE_NAME(node)); else snprintf(name, sizeof(name), "[%x]", ng_node2ID(node)); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:19:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC04E752; Sun, 2 Nov 2014 09:19:51 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A163D58; Sun, 2 Nov 2014 09:19:51 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkrK8-000GIe-Ob; Sun, 02 Nov 2014 09:19:48 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Sun, 2 Nov 2014 09:19:47 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <123D20FE-E552-4A95-889E-1919E99257D8@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <20141101181536.2b6a5911@kan> <627C5F71-939A-4579-8A1B-45933662DAED@FreeBSD.org> <1414882185.17308.221.camel@revolution.hippie.lan> <86r3xm5wt6.fsf@nine.des.no> <86mw8a5we0.fsf@nine.des.no> <1414886231.17308.238.camel@revolution.hippie.lan> To: Adrian Chadd X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , Alexander Kabaev X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:19:51 -0000 Hi all Apologies for my relative silence; I have been looking at this - = promise! > On 2 Nov 2014, at 00:12, Adrian Chadd wrote: >=20 > So, hm. How do us embedded people just unblock it for now at boot, so > we can actually _get_ enough entropy? Depending on your requirements, if switching to Fortuna[*] doesn=E2=80=99t= solve your problem (Fortuna will be the default some time in the future = anyway), then try this hack: In yarrow.c, line 156, change yarrow_state.seeded =3D 0; to yarrow_state.seeded =3D 1; M [*] In your kernel: options RANDOM_DEBUG # Expose the reseed progress options RANDOM_FORTUNA # Use the Fortuna CSPRNG --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:24:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12B128B9; Sun, 2 Nov 2014 09:24:37 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF7ABDF8; Sun, 2 Nov 2014 09:24:36 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkrOk-000GJ9-Qs; Sun, 02 Nov 2014 09:24:35 +0000 Subject: Re: svn commit: r273957 - in head: . etc/rc.d Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <201411020147.sA21lRW0082695@svn.freebsd.org> Date: Sun, 2 Nov 2014 09:24:33 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411020147.sA21lRW0082695@svn.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:24:37 -0000 Nice move, thanks! :-) M > On 2 Nov 2014, at 01:47, Dag-Erling Sm=C3=B8rgrav = wrote: >=20 > Author: des > Date: Sun Nov 2 01:47:27 2014 > New Revision: 273957 > URL: https://svnweb.freebsd.org/changeset/base/273957 >=20 > Log: > Get rid of the postrandom script. It was born in a time when the > random script ran before filesystems were mounted, which is no > longer the case. >=20 > In random_start(), immediately delete each file that is fed into > /dev/random, and recreate the default entropy file immediately > after reading and deleting it. The logic used in random_stop() > to determine which file to write to should probably be factored > out and used here as well. >=20 > Deleted: > head/etc/rc.d/postrandom > Modified: > head/ObsoleteFiles.inc > head/etc/rc.d/Makefile > head/etc/rc.d/adjkerntz > head/etc/rc.d/random >=20 > Modified: head/ObsoleteFiles.inc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/ObsoleteFiles.inc Sun Nov 2 01:13:11 2014 = (r273956) > +++ head/ObsoleteFiles.inc Sun Nov 2 01:47:27 2014 = (r273957) > @@ -38,6 +38,8 @@ > # xargs -n1 | sort | uniq -d; > # done >=20 > +# 20141102: postrandom obsoleted by new /dev/random code > +OLD_FILES+=3Detc/rc.d/postrandom > # 20141031: initrandom obsoleted by new /dev/random code > OLD_FILES+=3Detc/rc.d/initrandom > # 20141028: debug files accidentally installed as directory name >=20 > Modified: head/etc/rc.d/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/etc/rc.d/Makefile Sun Nov 2 01:13:11 2014 = (r273956) > +++ head/etc/rc.d/Makefile Sun Nov 2 01:47:27 2014 = (r273957) > @@ -112,7 +112,6 @@ FILES=3D DAEMON \ > pf \ > pflog \ > pfsync \ > - postrandom \ > powerd \ > power_profile \ > ppp \ >=20 > Modified: head/etc/rc.d/adjkerntz > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/rc.d/adjkerntz Sun Nov 2 01:13:11 2014 = (r273956) > +++ head/etc/rc.d/adjkerntz Sun Nov 2 01:47:27 2014 = (r273957) > @@ -4,7 +4,7 @@ > # >=20 > # PROVIDE: adjkerntz > -# REQUIRE: FILESYSTEMS postrandom > +# REQUIRE: FILESYSTEMS > # BEFORE: netif > # KEYWORD: nojail >=20 >=20 > Modified: head/etc/rc.d/random > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/etc/rc.d/random Sun Nov 2 01:13:11 2014 = (r273956) > +++ head/etc/rc.d/random Sun Nov 2 01:47:27 2014 = (r273957) > @@ -17,41 +17,58 @@ stop_cmd=3D"random_stop" > extra_commands=3D"saveseed" > saveseed_cmd=3D"${name}_stop" >=20 > +save_dev_random() > +{ > + for f ; do > + if :>>"$f" ; then > + debug "saving entropy to $f" > + dd if=3D/dev/random of=3D"$f" bs=3D4096 count=3D1 = 2>/dev/null > + fi > + done > +} > + > feed_dev_random() > { > - if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then > - cat "${1}" | dd of=3D/dev/random bs=3D8k 2>/dev/null > - fi > + for f ; do > + if [ -f "$f" -a -r "$f" -a -s "$f" ] ; then > + if dd if=3D"$f" of=3D/dev/random bs=3D4096 = 2>/dev/null ; then > + debug "entropy read from $f" > + rm -f "$f" > + fi > + fi > + done > } >=20 > random_start() > { > + echo -n 'Feeding entropy:' > + > + if [ ! -w /dev/random ] ; then > + warn "/dev/random is not writeable" > + return 1 > + fi > + > # Reseed /dev/random with previously stored entropy. > - case ${entropy_dir} in > + case ${entropy_dir:=3D/var/db/entropy} in > [Nn][Oo]) > ;; > *) > - entropy_dir=3D${entropy_dir:-/var/db/entropy} > - if [ -d "${entropy_dir}" ]; then > - if [ -w /dev/random ]; then > - for seedfile in ${entropy_dir}/*; do > - feed_dev_random "${seedfile}" > - done > - fi > + if [ -d "${entropy_dir}" ] ; then > + feed_dev_random "${entropy_dir}"/* > fi > ;; > esac >=20 > - case ${entropy_file} in > + case ${entropy_file:=3D/entropy} in > [Nn][Oo] | '') > ;; > *) > - if [ -w /dev/random ]; then > - feed_dev_random "${entropy_file}" > - feed_dev_random /var/db/entropy-file > - fi > + feed_dev_random "${entropy_file}" /var/db/entropy-file > + save_dev_random "${entropy_file}" > ;; > esac > + > + echo '.' > } >=20 > random_stop() > @@ -59,7 +76,7 @@ random_stop() > # Write some entropy so when the machine reboots /dev/random > # can be reseeded > # > - case ${entropy_file} in > + case ${entropy_file:=3D/entropy} in > [Nn][Oo] | '') > ;; > *) >=20 --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:34:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70A2CE17; Sun, 2 Nov 2014 09:34:37 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39E2AED0; Sun, 2 Nov 2014 09:34:37 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkrYR-000GK0-Lj; Sun, 02 Nov 2014 09:34:35 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <201411020201.sA221unt091493@svn.freebsd.org> Date: Sun, 2 Nov 2014 09:34:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411020201.sA221unt091493@svn.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:34:37 -0000 > On 2 Nov 2014, at 02:01, Dag-Erling Sm=C3=B8rgrav = wrote: >=20 > Author: des > Date: Sun Nov 2 02:01:55 2014 > New Revision: 273958 > URL: https://svnweb.freebsd.org/changeset/base/273958 >=20 > Log: > Restore the auto-reseed logic, but move it to a much later point, > immediately before kick_init. >=20 > Approved by: so (self) Not discussed with: markm(author) M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:37:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7CA0D0; Sun, 2 Nov 2014 09:37:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93FEFEE5; Sun, 2 Nov 2014 09:37:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA29bkfd001445; Sun, 2 Nov 2014 09:37:46 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA29bkKF001441; Sun, 2 Nov 2014 09:37:46 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201411020937.sA29bkKF001441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 2 Nov 2014 09:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273961 - head/lib/libarchive 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:37:46 -0000 Author: mm Date: Sun Nov 2 09:37:45 2014 New Revision: 273961 URL: https://svnweb.freebsd.org/changeset/base/273961 Log: Add pkg-config file for libarchive Requested by: bapt MFC after: 1 week Added: head/lib/libarchive/libarchive.pc (contents, props changed) Modified: head/lib/libarchive/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sun Nov 2 05:51:31 2014 (r273960) +++ head/lib/libarchive/Makefile Sun Nov 2 09:37:45 2014 (r273961) @@ -49,6 +49,12 @@ CFLAGS+= -DPPMD_32BIT .endif NO_WCAST_ALIGN.clang= +.ifndef COMPAT_32BIT +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/libarchive.pc ${DESTDIR}${LIBDATADIR}/pkgconfig +.endif + .PATH: ${LIBARCHIVEDIR}/libarchive # Headers to be installed in /usr/include Added: head/lib/libarchive/libarchive.pc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/libarchive.pc Sun Nov 2 09:37:45 2014 (r273961) @@ -0,0 +1,12 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: libarchive +Description: library that can create and read several streaming archive formats +Version: 3.1.2 +Cflags: -I${includedir} +Libs: -L${libdir} -larchive +Libs.private: -lz -lbz2 -llzma -lbsdxml -lcrypto From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:45:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B33D9327; Sun, 2 Nov 2014 09:45:18 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3BEF9E; Sun, 2 Nov 2014 09:45:18 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xkrim-000GKd-JV; Sun, 02 Nov 2014 09:45:17 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <201411020201.sA221unt091493@svn.freebsd.org> Date: Sun, 2 Nov 2014 09:45:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:45:18 -0000 Hi DES, I=E2=80=99m scared witless of this being on-by-default, for the reason = given in the removed comment. I=E2=80=99d much prefer to see it only = turned on if a kernel option is set, and the embedded folks /et al/ can = use that. Please reinstate the #ifdef RANDOM_AUTOSEED, and set a kernel option to = turn it on. Please also leave the comment; summarily turning on an = unprepared generator is not going to be obvious to anyone but an = attacker. Moving the point of the auto-firstseed to where is good, thanks. M > On 2 Nov 2014, at 02:01, Dag-Erling Sm=C3=B8rgrav = wrote: >=20 > Author: des > Date: Sun Nov 2 02:01:55 2014 > New Revision: 273958 > URL: https://svnweb.freebsd.org/changeset/base/273958 >=20 > Log: > Restore the auto-reseed logic, but move it to a much later point, > immediately before kick_init. >=20 > Approved by: so (self) >=20 > Modified: > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/yarrow.c >=20 > Modified: head/sys/dev/random/random_adaptors.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/random/random_adaptors.c Sun Nov 2 01:47:27 2014 = (r273957) > +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 02:01:55 2014 = (r273958) > @@ -447,30 +447,8 @@ random_adaptors_deinit(void) > } >=20 > /* > - * First seed. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * It turns out this is bloody dangerous. I was fiddling with code = elsewhere > - * and managed to get conditions where a safe (i.e. seeded) entropy = device should > - * not have been possible. This managed to hide that by unblocking = the device anyway. > - * As crap randomness is not directly distinguishable from good = randomness, this > - * could have gone unnoticed for quite a while. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * Very luckily, the probe-time entropy is very nearly good enough to = cause a > - * first seed all of the time, and the default settings for other = entropy > - * harvesting causes a proper, safe, first seed (unblock) in short = order after that. > - * > - * That said, the below would be useful where folks are more = concerned with > - * a quick start than with extra paranoia in a low-entropy = environment. > - * > - * markm - October 2013. > + * Reseed the active adaptor shortly before starting init(8). > */ > -#ifdef RANDOM_AUTOSEED > /* ARGSUSED */ > static void > random_adaptors_seed(void *unused __unused) > @@ -484,6 +462,5 @@ random_adaptors_seed(void *unused __unus >=20 > arc4rand(NULL, 0, 1); > } > -SYSINIT(random_seed, SI_SUB_INTRINSIC_POST, SI_ORDER_LAST, > - random_adaptors_reseed, NULL); > -#endif /* RANDOM_AUTOSEED */ > +SYSINIT(random_seed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, > + random_adaptors_seed, NULL); >=20 > Modified: head/sys/dev/random/yarrow.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/random/yarrow.c Sun Nov 2 01:47:27 2014 = (r273957) > +++ head/sys/dev/random/yarrow.c Sun Nov 2 02:01:55 2014 = (r273958) > @@ -508,7 +508,9 @@ void > random_yarrow_reseed(void) > { >=20 > + mtx_lock(&random_reseed_mtx); > reseed(SLOW); > + mtx_unlock(&random_reseed_mtx); > } >=20 > int >=20 --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:52:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 974154CB; Sun, 2 Nov 2014 09:52:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68D7DD8; Sun, 2 Nov 2014 09:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA29qNRv010201; Sun, 2 Nov 2014 09:52:23 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA29qNxc010198; Sun, 2 Nov 2014 09:52:23 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411020952.sA29qNxc010198@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 2 Nov 2014 09:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273962 - in head/sys/dev/drm2: . radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:52:23 -0000 Author: dumbbell Date: Sun Nov 2 09:52:22 2014 New Revision: 273962 URL: https://svnweb.freebsd.org/changeset/base/273962 Log: drm: Lower priority of two messages related to invalid EDID Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled. MFC after: 1 week Modified: head/sys/dev/drm2/drm_edid.c head/sys/dev/drm2/radeon/radeon_connectors.c Modified: head/sys/dev/drm2/drm_edid.c ============================================================================== --- head/sys/dev/drm2/drm_edid.c Sun Nov 2 09:37:45 2014 (r273961) +++ head/sys/dev/drm2/drm_edid.c Sun Nov 2 09:52:22 2014 (r273962) @@ -171,7 +171,7 @@ drm_edid_block_valid(u8 *raw_edid) for (i = 0; i < EDID_LENGTH; i++) csum += raw_edid[i]; if (csum) { - DRM_DEBUG("EDID checksum is invalid, remainder is %d\n", csum); + DRM_DEBUG_KMS("EDID checksum is invalid, remainder is %d\n", csum); /* allow CEA to slide through, switches mangle this */ if (raw_edid[0] != 0x02) @@ -366,7 +366,7 @@ drm_do_get_edid(struct drm_connector *co return block; carp: - DRM_ERROR("%s: EDID block %d invalid.\n", + DRM_DEBUG_KMS("%s: EDID block %d invalid.\n", drm_get_connector_name(connector), j); out: Modified: head/sys/dev/drm2/radeon/radeon_connectors.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_connectors.c Sun Nov 2 09:37:45 2014 (r273961) +++ head/sys/dev/drm2/radeon/radeon_connectors.c Sun Nov 2 09:52:22 2014 (r273962) @@ -748,7 +748,7 @@ radeon_vga_detect(struct drm_connector * radeon_connector->edid = drm_get_edid(&radeon_connector->base, radeon_connector->ddc_bus->adapter); if (!radeon_connector->edid) { - DRM_ERROR("%s: probed a monitor but no|invalid EDID\n", + DRM_DEBUG_KMS("%s: probed a monitor but no|invalid EDID\n", drm_get_connector_name(connector)); ret = connector_status_connected; } else { From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 09:59:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E32BF7CF for ; Sun, 2 Nov 2014 09:59:54 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 682A210F for ; Sun, 2 Nov 2014 09:59:53 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id gq15so8304328lab.35 for ; Sun, 02 Nov 2014 01:59:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=4GQZzeswQvmlh4TbbiehG+wZXtOsd7DHEP5DWsPAgS0=; b=F2lRfUwRRhPpF2rG1Y6VVs/2DvuVODkY9UukjzSrNsaGWRMK0aMQO6XMpY3an/lA1T R2HHAJtRQ64kTlf+Aa+fTYmcDfmt0ora5Vk3Lp9ZFyNktv2EoPu5ROjfuiKh0vnaN+a4 Qt26waBn6dg43qm2rUUsdeK82pDdx67ecBAe17eYDPeigTEqt62pVdqdrZABM+iS7XRK QrYxZqFT/w6Qmvuf1BAhOSzzf1+fYKHILvNdwU03sFrNGDilS0mCq9ZPAhvN1zTd698z EETYSUY3h8FjZbms7U2GmwuD4yzTuOA/sEZQup4mcfCbm5m/bt5pnBtAH4aRLLpO32zs Utjw== X-Gm-Message-State: ALoCoQlQ8n16e3AZUDY/kVoksyiCHxBMc6pRAunQ1d8dtEThpjEFoIxj885FLyf/CfvnMpBcelHK X-Received: by 10.152.36.33 with SMTP id n1mr2983169laj.95.1414922385705; Sun, 02 Nov 2014 01:59:45 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id an6sm6566899lac.18.2014.11.02.01.59.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Nov 2014 01:59:45 -0800 (PST) Message-ID: <54560091.90006@freebsd.org> Date: Sun, 02 Nov 2014 12:59:45 +0300 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Mark R V Murray , =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdy?= =?UTF-8?B?YXY=?= Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> In-Reply-To: <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:59:55 -0000 On 02.11.2014 12:45, Mark R V Murray wrote: > Hi DES, > > I’m scared witless of this being on-by-default, for the reason given in the removed comment. I’d much prefer to see it only turned on if a kernel option is set, and the embedded folks /et al/ can use that. We don't need yet one kernel knob to make sysadmin life a bit more harder. This thing needs to be autosensed somehow. F.e. if no disk interrupts or ethernet interrupt hooks are executed, switch to AUTOSEED automatically (or by any other automatic way). -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 10:07:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21005A0C; Sun, 2 Nov 2014 10:07:22 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD8BF1D1; Sun, 2 Nov 2014 10:07:21 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xks48-000GLr-5p; Sun, 02 Nov 2014 10:07:20 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <54560091.90006@freebsd.org> Date: Sun, 2 Nov 2014 10:07:19 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <1F934348-5477-455A-A910-054628B276ED@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <54560091.90006@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 10:07:22 -0000 > On 2 Nov 2014, at 09:59, Andrey Chernov wrote: >=20 > On 02.11.2014 12:45, Mark R V Murray wrote: >> Hi DES, >>=20 >> I=E2=80=99m scared witless of this being on-by-default, for the = reason given in the removed comment. I=E2=80=99d much prefer to see it = only turned on if a kernel option is set, and the embedded folks /et al/ = can use that. >=20 > We don't need yet one kernel knob to make sysadmin life a bit more > harder. This thing needs to be autosensed somehow. F.e. if no disk > interrupts or ethernet interrupt hooks are executed, switch to = AUTOSEED > automatically (or by any other automatic way). DES=E2=80=99s change makes no difference in a Tier-1 platform, except = potentially hiding a security problem. In the embedded world Tier-2+ (MIPS/ARM) where the problem is raising = its head, customised kernels are very common indeed, and this option = gives further control to the engineer configuring the system. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 11:26:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FAA61FE; Sun, 2 Nov 2014 11:26:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AF7E9FC; Sun, 2 Nov 2014 11:26:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2BQeFP053571; Sun, 2 Nov 2014 11:26:40 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2BQcx4053562; Sun, 2 Nov 2014 11:26:38 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201411021126.sA2BQcx4053562@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 2 Nov 2014 11:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273963 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 11:26:40 -0000 Author: tijl Date: Sun Nov 2 11:26:37 2014 New Revision: 273963 URL: https://svnweb.freebsd.org/changeset/base/273963 Log: In agp(4) avoid the need to flush all cpu caches with wbinvd between updating the GTT and flushing the AGP TLB by storing the GTT in write-combining memory. On x86 flushing the AGP TLB is done by an I/O operation or a store to a MMIO register in uncacheable memory. Both cases imply that WC buffers are flushed so no memory barriers are needed. On powerpc there is no WC memory type. It maps to uncacheable memory and two stores to uncacheable memory, such as to the GTT and then to an MMIO register, are strongly ordered, so no memory barriers are needed either. MFC after: 1 month Modified: head/sys/dev/agp/agp.c head/sys/dev/agp/agp_amd.c head/sys/dev/agp/agp_amd64.c head/sys/dev/agp/agp_apple.c head/sys/dev/agp/agp_ati.c head/sys/dev/agp/agp_i810.c head/sys/dev/agp/agppriv.h Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp.c Sun Nov 2 11:26:37 2014 (r273963) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -84,14 +86,6 @@ static devclass_t agp_devclass; /* Helper functions for implementing chipset mini drivers. */ -void -agp_flush_cache() -{ -#if defined(__i386__) || defined(__amd64__) - wbinvd(); -#endif -} - u_int8_t agp_find_caps(device_t dev) { @@ -158,17 +152,16 @@ agp_alloc_gatt(device_t dev) return 0; gatt->ag_entries = entries; - gatt->ag_virtual = contigmalloc(entries * sizeof(u_int32_t), M_AGP, 0, - 0, ~0, PAGE_SIZE, 0); + gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual); - agp_flush_cache(); return gatt; } @@ -176,8 +169,8 @@ agp_alloc_gatt(device_t dev) void agp_free_gatt(struct agp_gatt *gatt) { - contigfree(gatt->ag_virtual, - gatt->ag_entries * sizeof(u_int32_t), M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } @@ -280,7 +273,6 @@ agp_free_res(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, sc->as_aperture); mtx_destroy(&sc->as_lock); - agp_flush_cache(); } int @@ -605,12 +597,6 @@ agp_generic_bind_memory(device_t dev, st VM_OBJECT_WUNLOCK(mem->am_obj); /* - * Flush the cpu cache since we are providing a new mapping - * for these pages. - */ - agp_flush_cache(); - - /* * Make sure the chipset gets the new mappings. */ AGP_FLUSH_TLB(dev); @@ -668,7 +654,6 @@ agp_generic_unbind_memory(device_t dev, } VM_OBJECT_WUNLOCK(mem->am_obj); - agp_flush_cache(); AGP_FLUSH_TLB(dev); mem->am_offset = 0; @@ -1040,7 +1025,6 @@ agp_bind_pages(device_t dev, vm_page_t * } } - agp_flush_cache(); AGP_FLUSH_TLB(dev); mtx_unlock(&sc->as_lock); @@ -1063,7 +1047,6 @@ agp_unbind_pages(device_t dev, vm_size_t for (i = 0; i < size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, offset + i); - agp_flush_cache(); AGP_FLUSH_TLB(dev); mtx_unlock(&sc->as_lock); Modified: head/sys/dev/agp/agp_amd.c ============================================================================== --- head/sys/dev/agp/agp_amd.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp_amd.c Sun Nov 2 11:26:37 2014 (r273963) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -92,34 +94,35 @@ agp_amd_alloc_gatt(device_t dev) /* * The AMD751 uses a page directory to map a non-contiguous - * gatt so we don't need to use contigmalloc. - * Malloc individual gatt pages and map them into the page + * gatt so we don't need to use kmem_alloc_contig. + * Allocate individual GATT pages and map them into the page * directory. */ gatt->ag_entries = entries; - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), - M_AGP, M_NOWAIT); + gatt->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); /* * Allocate the page directory. */ - gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); + gatt->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_vdir) { if (bootverbose) device_printf(dev, "failed to allocate page directory\n"); - free(gatt->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + entries * sizeof(u_int32_t)); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_vdir, AGP_PAGE_SIZE); gatt->ag_pdir = vtophys((vm_offset_t) gatt->ag_vdir); if(bootverbose) @@ -158,19 +161,15 @@ agp_amd_alloc_gatt(device_t dev) gatt->ag_vdir[i + pdir_offset] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return gatt; } static void agp_amd_free_gatt(struct agp_amd_gatt *gatt) { - free(gatt->ag_virtual, M_AGP); - free(gatt->ag_vdir, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } Modified: head/sys/dev/agp/agp_amd64.c ============================================================================== --- head/sys/dev/agp/agp_amd64.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp_amd64.c Sun Nov 2 11:26:37 2014 (r273963) @@ -241,8 +241,6 @@ agp_amd64_attach(device_t dev) 4); } - agp_flush_cache(); - return (0); } Modified: head/sys/dev/agp/agp_apple.c ============================================================================== --- head/sys/dev/agp/agp_apple.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp_apple.c Sun Nov 2 11:26:37 2014 (r273963) @@ -224,8 +224,6 @@ agp_apple_bind_page(device_t dev, vm_off return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } @@ -238,8 +236,6 @@ agp_apple_unbind_page(device_t dev, vm_o return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } Modified: head/sys/dev/agp/agp_ati.c ============================================================================== --- head/sys/dev/agp/agp_ati.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp_ati.c Sun Nov 2 11:26:37 2014 (r273963) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -129,20 +131,23 @@ agp_ati_alloc_gatt(device_t dev) /* Alloc the GATT -- pointers to pages of AGP memory */ sc->ag_entries = entries; - sc->ag_virtual = malloc(entries * sizeof(u_int32_t), M_AGP, - M_NOWAIT | M_ZERO); + sc->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (sc->ag_virtual == NULL) { if (bootverbose) - device_printf(dev, "aperture allocation failed\n"); + device_printf(dev, "GATT allocation failed\n"); return ENOMEM; } /* Alloc the page directory -- pointers to each page of the GATT */ - sc->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT | M_ZERO); + sc->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (sc->ag_vdir == NULL) { if (bootverbose) device_printf(dev, "pagedir allocation failed\n"); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + entries * sizeof(u_int32_t)); return ENOMEM; } sc->ag_pdir = vtophys((vm_offset_t)sc->ag_vdir); @@ -158,11 +163,6 @@ agp_ati_alloc_gatt(device_t dev) sc->ag_vdir[apbase_offset + i] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return 0; } @@ -264,8 +264,9 @@ agp_ati_detach(device_t dev) temp = pci_read_config(dev, apsize_reg, 4); pci_write_config(dev, apsize_reg, temp & ~1, 4); - free(sc->ag_vdir, M_AGP); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + sc->ag_entries * sizeof(u_int32_t)); bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs); agp_free_res(dev); Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agp_i810.c Sun Nov 2 11:26:37 2014 (r273963) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -1388,17 +1390,16 @@ agp_i810_install_gatt(device_t dev) sc->dcache_size = 0; /* According to the specs the gatt on the i810 must be 64k. */ - sc->gatt->ag_virtual = contigmalloc(64 * 1024, M_AGP, 0, 0, ~0, - PAGE_SIZE, 0); + sc->gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + 64 * 1024, M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (sc->gatt->ag_virtual == NULL) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); return (ENOMEM); } - bzero(sc->gatt->ag_virtual, sc->gatt->ag_entries * sizeof(u_int32_t)); sc->gatt->ag_physical = vtophys((vm_offset_t)sc->gatt->ag_virtual); - agp_flush_cache(); /* Install the GATT. */ bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, sc->gatt->ag_physical | 1); @@ -1497,7 +1498,7 @@ agp_i810_deinstall_gatt(device_t dev) sc = device_get_softc(dev); bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0); - contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->gatt->ag_virtual, 64 * 1024); } static void @@ -2052,7 +2053,6 @@ agp_i810_bind_memory(device_t dev, struc sc->match->driver->install_gtt_pte(dev, (offset + i) >> AGP_PAGE_SHIFT, mem->am_physical + i, 0); } - agp_flush_cache(); mem->am_offset = offset; mem->am_is_bound = 1; mtx_unlock(&sc->agp.as_lock); @@ -2093,7 +2093,6 @@ agp_i810_unbind_memory(device_t dev, str sc->match->driver->install_gtt_pte(dev, (mem->am_offset + i) >> AGP_PAGE_SHIFT, 0, 0); } - agp_flush_cache(); mem->am_is_bound = 0; mtx_unlock(&sc->agp.as_lock); return (0); Modified: head/sys/dev/agp/agppriv.h ============================================================================== --- head/sys/dev/agp/agppriv.h Sun Nov 2 09:52:22 2014 (r273962) +++ head/sys/dev/agp/agppriv.h Sun Nov 2 11:26:37 2014 (r273963) @@ -83,7 +83,6 @@ struct agp_gatt { vm_offset_t ag_physical; }; -void agp_flush_cache(void); u_int8_t agp_find_caps(device_t dev); struct agp_gatt *agp_alloc_gatt(device_t dev); void agp_set_aperture_resource(device_t dev, int rid); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 11:28:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F160D343; Sun, 2 Nov 2014 11:28:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE8CA04; Sun, 2 Nov 2014 11:28:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2BSFOW053816; Sun, 2 Nov 2014 11:28:15 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2BSFJw053815; Sun, 2 Nov 2014 11:28:15 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201411021128.sA2BSFJw053815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 2 Nov 2014 11:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273964 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 11:28:16 -0000 Author: tijl Date: Sun Nov 2 11:28:15 2014 New Revision: 273964 URL: https://svnweb.freebsd.org/changeset/base/273964 Log: In agp_amd_bind_page don't flush the AGP TLB. It's done by the calling function. Modified: head/sys/dev/agp/agp_amd.c Modified: head/sys/dev/agp/agp_amd.c ============================================================================== --- head/sys/dev/agp/agp_amd.c Sun Nov 2 11:26:37 2014 (r273963) +++ head/sys/dev/agp/agp_amd.c Sun Nov 2 11:28:15 2014 (r273964) @@ -347,9 +347,6 @@ agp_amd_bind_page(device_t dev, vm_offse return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; - - /* invalidate the cache */ - AGP_FLUSH_TLB(dev); return 0; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 11:47:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48A986A1; Sun, 2 Nov 2014 11:47:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357E4B92; Sun, 2 Nov 2014 11:47:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2Blfer063198; Sun, 2 Nov 2014 11:47:41 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2BlfVQ063197; Sun, 2 Nov 2014 11:47:41 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201411021147.sA2BlfVQ063197@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 2 Nov 2014 11:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273965 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 11:47:41 -0000 Author: tijl Date: Sun Nov 2 11:47:40 2014 New Revision: 273965 URL: https://svnweb.freebsd.org/changeset/base/273965 Log: - agp_generic_unbind_memory: flush AGP TLB before unwiring pages - agp_bind_pages: assert that pages have been wired down MFC after: 1 month Modified: head/sys/dev/agp/agp.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Sun Nov 2 11:28:15 2014 (r273964) +++ head/sys/dev/agp/agp.c Sun Nov 2 11:47:40 2014 (r273965) @@ -645,6 +645,9 @@ agp_generic_unbind_memory(device_t dev, */ for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, mem->am_offset + i); + + AGP_FLUSH_TLB(dev); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); @@ -653,8 +656,6 @@ agp_generic_unbind_memory(device_t dev, vm_page_unlock(m); } VM_OBJECT_WUNLOCK(mem->am_obj); - - AGP_FLUSH_TLB(dev); mem->am_offset = 0; mem->am_is_bound = 0; @@ -1000,6 +1001,8 @@ agp_bind_pages(device_t dev, vm_page_t * mtx_lock(&sc->as_lock); for (i = 0; i < size; i += PAGE_SIZE) { m = pages[OFF_TO_IDX(i)]; + KASSERT(m->wire_count > 0, + ("agp_bind_pages: page %p hasn't been wired", m)); /* * Install entries in the GATT, making sure that if From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 12:41:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DE662B0; Sun, 2 Nov 2014 12:41:24 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 3E785CE; Sun, 2 Nov 2014 12:41:23 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CFFE2AC33; Sun, 2 Nov 2014 12:41:22 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 2FE0410B2E; Sun, 2 Nov 2014 13:41:23 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark R V Murray Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> Date: Sun, 02 Nov 2014 13:41:23 +0100 In-Reply-To: <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> (Mark R. V. Murray's message of "Sun, 2 Nov 2014 09:45:15 +0000") Message-ID: <86mw894vws.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 12:41:24 -0000 Mark R V Murray writes: > I=E2=80=99m scared witless of this being on-by-default, for the reason gi= ven > in the removed comment. I=E2=80=99d much prefer to see it only turned on = if a > kernel option is set, and the embedded folks /et al/ can use that. You didn't seem to mind this code when we introduced it in 10-CURRENT. Removing it breaks pretty much everything, not just embedded systems. We can add a sysctl to turn it off, but it has to be on by default. Note that the alternative is to feed more trash into /dev/random at boot, as we did before. It may give us a warm and fuzzy feeling which we don't get from automatically seeding, but the reality is that we have no idea how good that trash is either. In fact, most of what we used to feed into /dev/random at boot (ps, sysctls etc) was constant or nearly so. I prefer to trust that we get enough entropy from attachtimes and I/O in the boot process - and the data I gathered indicates that there is more than enough entropy from attachtimes alone, even on SFF systems and VMs. > Moving the point of the auto-firstseed to where is good, thanks. ...except that I'm not sure it doesn't break root-on-geli etc, but at least it doesn't break it more than not having auto-firstseed at all. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 12:42:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD5A340C; Sun, 2 Nov 2014 12:42:29 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7F096E3; Sun, 2 Nov 2014 12:42:29 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 9A377AC3B; Sun, 2 Nov 2014 12:42:28 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 44C0B10B30; Sun, 2 Nov 2014 13:42:29 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark R V Murray Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <54560091.90006@freebsd.org> <1F934348-5477-455A-A910-054628B276ED@grondar.org> Date: Sun, 02 Nov 2014 13:42:29 +0100 In-Reply-To: <1F934348-5477-455A-A910-054628B276ED@grondar.org> (Mark R. V. Murray's message of "Sun, 2 Nov 2014 10:07:19 +0000") Message-ID: <86ioix4vuy.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 12:42:29 -0000 Mark R V Murray writes: > DES=E2=80=99s change makes no difference in a Tier-1 platform, except > potentially hiding a security problem. I will assume that you did not read the discussion that lead up to my commits, because if you did, you know this is a lie. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 12:51:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67E40668; Sun, 2 Nov 2014 12:51:08 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 28ABD19D; Sun, 2 Nov 2014 12:51:07 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id A135BAC61; Sun, 2 Nov 2014 12:51:06 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 6DB8610B33; Sun, 2 Nov 2014 13:51:09 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jan Beich Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... References: <201410302121.s9ULLsEw055630@svn.freebsd.org> Date: Sun, 02 Nov 2014 13:51:09 +0100 In-Reply-To: (Jan Beich's message of "Sun, 02 Nov 2014 04:26:21 +0100") Message-ID: <86egtl4vgi.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mark Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 12:51:08 -0000 Jan Beich writes: > I have a minimalistic kernel where everything is pushed to a module for > easier/faster debugging before kload. As its config has no |device random| > loading random.ko fails because nothing provides random_adaptors [...] Yes, there is work to be done there. Ideally, the random module should include the random_adaptors framework and /dev/random itself, while Yarrow and Fortuna should be separate modules which can coexist, rather than mutually exclusive kernel options. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:08:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7260594D; Sun, 2 Nov 2014 13:08:26 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 387D227B; Sun, 2 Nov 2014 13:08:26 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkutM-000GYl-4o; Sun, 02 Nov 2014 13:08:24 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <86egtl4vgi.fsf@nine.des.no> Date: Sun, 2 Nov 2014 13:08:22 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <32C3BF80-C600-455C-9467-7C1D50D49BFB@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <86egtl4vgi.fsf@nine.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jan Beich X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:08:26 -0000 > On 2 Nov 2014, at 12:51, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Jan Beich writes: >> I have a minimalistic kernel where everything is pushed to a module = for >> easier/faster debugging before kload. As its config has no |device = random| >> loading random.ko fails because nothing provides random_adaptors = [...] >=20 > Yes, there is work to be done there. Ideally, the random module = should > include the random_adaptors framework and /dev/random itself, while > Yarrow and Fortuna should be separate modules which can coexist, = rather > than mutually exclusive kernel options. Compiling both into the kernel is possible, but tricky, so I didn=E2=80=99= t do it this time round. The reason for the trickiness is that randomdev_soft.c = gets compiled for each hash (Yarrow, Fortuna) with hash-specific #defines = set. Not insoluble, but I just didn=E2=80=99t get to it. I=E2=80=99ll fix the random_adaptors bit shortly. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:10:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52DD7A91; Sun, 2 Nov 2014 13:10:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34390283; Sun, 2 Nov 2014 13:10:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2DAXaa003304; Sun, 2 Nov 2014 13:10:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2DAWmD003298; Sun, 2 Nov 2014 13:10:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411021310.sA2DAWmD003298@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Nov 2014 13:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273966 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:10:33 -0000 Author: kib Date: Sun Nov 2 13:10:31 2014 New Revision: 273966 URL: https://svnweb.freebsd.org/changeset/base/273966 Log: Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines whether the shared request for already shared-locked lock could be granted. Both problems result in the exclusive locker starvation. The concurrent exclusive request is indicated by either LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse condition, i.e. no exclusive waiters, must check that both flags are cleared. Add a flag LK_NODDLKTREAT for shared lock request to indicate that current thread guarantees that it does not own the lock in shared mode. This turns back the exclusive lock starvation avoidance code; see man page update for detailed description. Use LK_NODDLKTREAT when doing lookup(9). Reported and tested by: pho No objections from: attilio Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/share/man/man9/lock.9 head/sys/kern/kern_lock.c head/sys/kern/vfs_lookup.c head/sys/sys/lockmgr.h Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Sun Nov 2 11:47:40 2014 (r273965) +++ head/share/man/man9/lock.9 Sun Nov 2 13:10:31 2014 (r273966) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2013 +.Dd November 2, 2014 .Dt LOCK 9 .Os .Sh NAME @@ -145,7 +145,7 @@ Their arguments are: A pointer to the lock to manipulate. .It Fa flags Flags indicating what action is to be taken. -.Bl -tag -width ".Dv LK_CANRECURSE" +.Bl -tag -width ".Dv LK_NODDLKTREAT" .It Dv LK_SHARED Acquire a shared lock. If an exclusive lock is currently held, @@ -199,6 +199,29 @@ Allow recursion on an exclusive lock. For every lock there must be a release. .It Dv LK_INTERLOCK Unlock the interlock (which should be locked already). +.It Dv LK_NODDLKTREAT +Normally, +.Fn lockmgr +postpones serving further shared requests for shared-locked lock if there is +exclusive waiter, to avoid exclusive lock starvation. +But, if the thread requesting the shared lock already owns a shared lockmgr +lock, the request is granted even in presence of the parallel exclusive lock +request, which is done to avoid deadlocks with recursive shared acquisition. +.Pp +The +.Dv LK_NODDLKTREAT +flag can only be used by code which requests shared non-recursive lock. +The flag allows exclusive requests to preempt the current shared request +even if the current thread owns shared locks. +This is safe since shared lock is guaranteed to not recurse, and is used +when thread is known to held unrelated shared locks, to not cause +unneccessary starvation. An example is +.Dv vp +locking in VFS +.Xr lookup 9 , +when +.Dv dvp +is already locked. .El .It Fa ilk An interlock mutex for controlling group access to the lock. Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Nov 2 11:47:40 2014 (r273965) +++ head/sys/kern/kern_lock.c Sun Nov 2 13:10:31 2014 (r273966) @@ -115,10 +115,11 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & } \ } while (0) -#define LK_CAN_SHARE(x) \ - (((x) & LK_SHARE) && (((x) & LK_EXCLUSIVE_WAITERS) == 0 || \ - ((x) & LK_EXCLUSIVE_SPINNERS) == 0 || \ - curthread->td_lk_slocks || (curthread->td_pflags & TDP_DEADLKTREAT))) +#define LK_CAN_SHARE(x, flags) \ + (((x) & LK_SHARE) && \ + (((x) & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) == 0 || \ + (curthread->td_lk_slocks != 0 && !(flags & LK_NODDLKTREAT)) || \ + (curthread->td_pflags & TDP_DEADLKTREAT))) #define LK_TRYOP(x) \ ((x) & LK_NOWAIT) @@ -530,7 +531,7 @@ __lockmgr_args(struct lock *lk, u_int fl * waiters, if we fail to acquire the shared lock * loop back and retry. */ - if (LK_CAN_SHARE(x)) { + if (LK_CAN_SHARE(x, flags)) { if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, x + LK_ONE_SHARER)) break; @@ -635,7 +636,7 @@ __lockmgr_args(struct lock *lk, u_int fl * if the lock can be acquired in shared mode, try * again. */ - if (LK_CAN_SHARE(x)) { + if (LK_CAN_SHARE(x, flags)) { sleepq_release(&lk->lock_object); continue; } Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Nov 2 11:47:40 2014 (r273965) +++ head/sys/kern/vfs_lookup.c Sun Nov 2 13:10:31 2014 (r273966) @@ -390,6 +390,7 @@ compute_cn_lkflags(struct mount *mp, int lkflags &= ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } + lkflags |= LK_NODDLKTREAT; return (lkflags); } Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Sun Nov 2 11:47:40 2014 (r273965) +++ head/sys/sys/lockmgr.h Sun Nov 2 13:10:31 2014 (r273966) @@ -158,6 +158,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_RETRY 0x000400 #define LK_SLEEPFAIL 0x000800 #define LK_TIMELOCK 0x001000 +#define LK_NODDLKTREAT 0x002000 /* * Operations for lockmgr(). From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:14:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4353CC58; Sun, 2 Nov 2014 13:14:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 162A5349; Sun, 2 Nov 2014 13:14:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2DEtvd005385; Sun, 2 Nov 2014 13:14:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2DEtHY005384; Sun, 2 Nov 2014 13:14:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411021314.sA2DEtHY005384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Nov 2014 13:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273967 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:14:56 -0000 Author: kib Date: Sun Nov 2 13:14:55 2014 New Revision: 273967 URL: https://svnweb.freebsd.org/changeset/base/273967 Log: When non-forced unmount or remount rw->ro is performed, writes on UFS are not suspended. In particular, on the SU-enabled vulumes, there is no reason why, between the call to softdep_flushfiles() and softdep_waitidle(), SU work items cannot be queued. Correct the condition to trigger the panic by only checking when forced operation is done. Convert direct panic() call into KASSERT(), there is no invalid on-disk data structures directly involved, so follow the usual debugging vs. non-debugging approach. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 13:10:31 2014 (r273966) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Nov 2 13:14:55 2014 (r273967) @@ -735,7 +735,7 @@ static struct malloc_type *memtype[] = { static void check_clear_deps(struct mount *); static void softdep_error(char *, int); static int softdep_process_worklist(struct mount *, int); -static int softdep_waitidle(struct mount *); +static int softdep_waitidle(struct mount *, int); static void drain_output(struct vnode *); static struct buf *getdirtybuf(struct buf *, struct rwlock *, int); static void clear_remove(struct mount *); @@ -1911,7 +1911,7 @@ softdep_flushworklist(oldmnt, countp, td } static int -softdep_waitidle(struct mount *mp) +softdep_waitidle(struct mount *mp, int flags __unused) { struct ufsmount *ump; int error; @@ -1921,8 +1921,9 @@ softdep_waitidle(struct mount *mp) ACQUIRE_LOCK(ump); for (i = 0; i < 10 && ump->softdep_deps; i++) { ump->softdep_req = 1; - if (ump->softdep_on_worklist) - panic("softdep_waitidle: work added after flush."); + KASSERT((flags & FORCECLOSE) == 0 || + ump->softdep_on_worklist == 0, + ("softdep_waitidle: work added after flush")); msleep(&ump->softdep_deps, LOCK_PTR(ump), PVM, "softdeps", 1); } ump->softdep_req = 0; @@ -1990,7 +1991,7 @@ retry_flush: error = EBUSY; } if (!error) - error = softdep_waitidle(oldmnt); + error = softdep_waitidle(oldmnt, flags); if (!error) { if (oldmnt->mnt_kern_flag & MNTK_UNMOUNT) { retry = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:18:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7AC2DD5; Sun, 2 Nov 2014 13:18:30 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E19A35B; Sun, 2 Nov 2014 13:18:30 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xkv36-000GZk-Ij; Sun, 02 Nov 2014 13:18:29 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <86mw894vws.fsf@nine.des.no> Date: Sun, 2 Nov 2014 13:18:27 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <2B5FAE76-C3F7-4299-8B1F-AC9C660C7505@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <86mw894vws.fsf@nine.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:18:30 -0000 > On 2 Nov 2014, at 12:41, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Mark R V Murray writes: >> I=E2=80=99m scared witless of this being on-by-default, for the = reason given >> in the removed comment. I=E2=80=99d much prefer to see it only turned = on if a >> kernel option is set, and the embedded folks /et al/ can use that. >=20 > You didn't seem to mind this code when we introduced it in 10-CURRENT. > Removing it breaks pretty much everything, not just embedded systems. > We can add a sysctl to turn it off, but it has to be on by default. I=E2=80=99ve had a closer look at things, and I=E2=80=99m coming round = to your side. Note that this has NO effect on Fortuna. Fortuna=E2=80=99s self-starting = appears to be more reliable. > Note that the alternative is to feed more trash into /dev/random at > boot, as we did before. It may give us a warm and fuzzy feeling which > we don't get from automatically seeding, but the reality is that we = have > no idea how good that trash is either. In fact, most of what we used = to > feed into /dev/random at boot (ps, sysctls etc) was constant or nearly > so. I prefer to trust that we get enough entropy from attachtimes and > I/O in the boot process - and the data I gathered indicates that there > is more than enough entropy from attachtimes alone, even on SFF = systems > and VMs. OK, Fair enough. :-) >> Moving the point of the auto-firstseed to where is good, thanks. >=20 > ...except that I'm not sure it doesn't break root-on-geli etc, but at > least it doesn't break it more than not having auto-firstseed at all. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:23:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CFAB137; Sun, 2 Nov 2014 13:23:03 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA3F611; Sun, 2 Nov 2014 13:23:02 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xkv7V-0002O0-7a; Sun, 02 Nov 2014 13:23:01 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA2DN06D089540; Sun, 2 Nov 2014 06:23:00 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+XI/saCs4YwtQLoLs0YEJy X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273958 - head/sys/dev/random From: Ian Lepore To: Mark R V Murray In-Reply-To: <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> Content-Type: text/plain; charset="iso-8859-13" Date: Sun, 02 Nov 2014 06:22:59 -0700 Message-ID: <1414934579.17308.248.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA2DN06D089540 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:23:03 -0000 On Sun, 2014-11-02 at 09:45 +0000, Mark R V Murray wrote: > Hi DES, >=20 > I=FFm scared witless of this being on-by-default, for the reason given = in the removed comment. I=FFd much prefer to see it only turned on if a k= ernel option is set, and the embedded folks /et al/ can use that. >=20 > Please reinstate the #ifdef RANDOM_AUTOSEED, and set a kernel option to= turn it on. Please also leave the comment; summarily turning on an unpre= pared generator is not going to be obvious to anyone but an attacker. >=20 > Moving the point of the auto-firstseed to where is good, thanks. >=20 > M >=20 To give you some idea of how usable this new stuff is on a system that isn't an x86 server or someone's desktop or laptop... after commenting out the postrandom so that a board would at least boot (but before DES' resend change), I left a board sitting idle at the login prompt. It was somewhere between 40 minutes and an hour before I saw this: FreeBSD/arm (rpi) (ttyu0) login: random: reseed - fast - thresh 96,1 - 0 48 0 0 0 130 0 0 620 0 0 = 0 0 0 0 0 0 0 0 0 random: reseed - slow - thresh 128,2 - 0 44 0 0 0 130 0 0 619 0 0 0 0 0 = 0 0 0 0 0 0 random: unblocking device. Securing a system against some theoretical attack has value only to the point where the system is no longer usable at all. At that point you kind of have to declare the attacker the winner, and he didn't even have to actually launch an attack. -- Ian > > On 2 Nov 2014, at 02:01, Dag-Erling Sm=B8rgrav wrot= e: > >=20 > > Author: des > > Date: Sun Nov 2 02:01:55 2014 > > New Revision: 273958 > > URL: https://svnweb.freebsd.org/changeset/base/273958 > >=20 > > Log: > > Restore the auto-reseed logic, but move it to a much later point, > > immediately before kick_init. > >=20 > > Approved by: so (self) > >=20 > > Modified: > > head/sys/dev/random/random_adaptors.c > > head/sys/dev/random/yarrow.c > >=20 > > Modified: head/sys/dev/random/random_adaptors.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/dev/random/random_adaptors.c Sun Nov 2 01:47:27 2014 (r= 273957) > > +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 02:01:55 2014 (r= 273958) > > @@ -447,30 +447,8 @@ random_adaptors_deinit(void) > > } > >=20 > > /* > > - * First seed. > > - * > > - * NB! NB! NB! > > - * NB! NB! NB! > > - * > > - * It turns out this is bloody dangerous. I was fiddling with code e= lsewhere > > - * and managed to get conditions where a safe (i.e. seeded) entropy = device should > > - * not have been possible. This managed to hide that by unblocking t= he device anyway. > > - * As crap randomness is not directly distinguishable from good rand= omness, this > > - * could have gone unnoticed for quite a while. > > - * > > - * NB! NB! NB! > > - * NB! NB! NB! > > - * > > - * Very luckily, the probe-time entropy is very nearly good enough t= o cause a > > - * first seed all of the time, and the default settings for other en= tropy > > - * harvesting causes a proper, safe, first seed (unblock) in short o= rder after that. > > - * > > - * That said, the below would be useful where folks are more concern= ed with > > - * a quick start than with extra paranoia in a low-entropy environme= nt. > > - * > > - * markm - October 2013. > > + * Reseed the active adaptor shortly before starting init(8). > > */ > > -#ifdef RANDOM_AUTOSEED > > /* ARGSUSED */ > > static void > > random_adaptors_seed(void *unused __unused) > > @@ -484,6 +462,5 @@ random_adaptors_seed(void *unused __unus > >=20 > > arc4rand(NULL, 0, 1); > > } > > -SYSINIT(random_seed, SI_SUB_INTRINSIC_POST, SI_ORDER_LAST, > > - random_adaptors_reseed, NULL); > > -#endif /* RANDOM_AUTOSEED */ > > +SYSINIT(random_seed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, > > + random_adaptors_seed, NULL); > >=20 > > Modified: head/sys/dev/random/yarrow.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/dev/random/yarrow.c Sun Nov 2 01:47:27 2014 (r273957) > > +++ head/sys/dev/random/yarrow.c Sun Nov 2 02:01:55 2014 (r273958) > > @@ -508,7 +508,9 @@ void > > random_yarrow_reseed(void) > > { > >=20 > > + mtx_lock(&random_reseed_mtx); > > reseed(SLOW); > > + mtx_unlock(&random_reseed_mtx); > > } > >=20 > > int > >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:26:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16A65288; Sun, 2 Nov 2014 13:26:58 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D28C3622; Sun, 2 Nov 2014 13:26:57 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkvBG-000GaZ-Sm; Sun, 02 Nov 2014 13:26:56 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <86ioix4vuy.fsf@nine.des.no> Date: Sun, 2 Nov 2014 13:26:53 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9938E21D-9495-4CDD-88A7-86EBB05C6737@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <54560091.90006@freebsd.org> <1F934348-5477-455A-A910-054628B276ED@grondar.org> <86ioix4vuy.fsf@nine.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:26:58 -0000 > On 2 Nov 2014, at 12:42, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Mark R V Murray writes: >> DES=E2=80=99s change makes no difference in a Tier-1 platform, except >> potentially hiding a security problem. >=20 > I will assume that you did not read the discussion that lead up to my > commits, because if you did, you know this is a lie. Telling me that I got it wrong would be a lot more accurate than accusing me of lying. Lying would require an act of malice on my part, which I can assure you is absent. Please choose your words more carefully. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:29:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 037EB479; Sun, 2 Nov 2014 13:29:41 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C023463E; Sun, 2 Nov 2014 13:29:40 +0000 (UTC) Received: from [2001:470:9174:1:407c:4bb6:6af1:63e2] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XkvDv-000Gam-0O; Sun, 02 Nov 2014 13:29:39 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <1414934579.17308.248.camel@revolution.hippie.lan> Date: Sun, 2 Nov 2014 13:29:37 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:29:41 -0000 > On 2 Nov 2014, at 13:22, Ian Lepore wrote: >=20 > On Sun, 2014-11-02 at 09:45 +0000, Mark R V Murray wrote: >> Hi DES, >>=20 >> I=C2=B4m scared witless of this being on-by-default, for the reason = given in the removed comment. I=C2=B4d much prefer to see it only turned = on if a kernel option is set, and the embedded folks /et al/ can use = that. >>=20 >> Please reinstate the #ifdef RANDOM_AUTOSEED, and set a kernel option = to turn it on. Please also leave the comment; summarily turning on an = unprepared generator is not going to be obvious to anyone but an = attacker. >>=20 >> Moving the point of the auto-firstseed to where is good, thanks. >>=20 >> M >>=20 >=20 > To give you some idea of how usable this new stuff is on a system that > isn't an x86 server or someone's desktop or laptop... after commenting > out the postrandom so that a board would at least boot (but before = DES' > resend change), I left a board sitting idle at the login prompt. It = was > somewhere between 40 minutes and an hour before I saw this: >=20 > FreeBSD/arm (rpi) (ttyu0) >=20 > login: random: reseed - fast - thresh 96,1 - 0 48 0 0 0 130 0 0 620 0 = 0 0 0 0 0 0 0 0 0 0 > random: reseed - slow - thresh 128,2 - 0 44 0 0 0 130 0 0 619 0 0 0 0 = 0 0 0 0 0 0 0 > random: unblocking device. Thanks for doing this, Ian. This is good information, and tells me a lot about Yarrow on some systems. > Securing a system against some theoretical attack has value only to = the > point where the system is no longer usable at all. At that point you > kind of have to declare the attacker the winner, and he didn't even = have > to actually launch an attack. Point conceded. :-) M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 13:43:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D1EC7B6; Sun, 2 Nov 2014 13:43:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E25E37F7; Sun, 2 Nov 2014 13:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2Dh4nL019421; Sun, 2 Nov 2014 13:43:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2Dh4hb019420; Sun, 2 Nov 2014 13:43:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411021343.sA2Dh4hb019420@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Nov 2014 13:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273968 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 13:43:05 -0000 Author: mjg Date: Sun Nov 2 13:43:04 2014 New Revision: 273968 URL: https://svnweb.freebsd.org/changeset/base/273968 Log: filedesc: factor out some code out of fdescfree Previously it had a huge self-contained chunk dedicated to dealing with shared tables. No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 2 13:14:55 2014 (r273967) +++ head/sys/kern/kern_descrip.c Sun Nov 2 13:43:04 2014 (r273968) @@ -1946,18 +1946,97 @@ fdcopy(struct filedesc *fdp) } /* + * Clear POSIX style locks. This is only used when fdp looses a reference (i.e. + * one of processes using it exits) and the table used to be shared. + */ +static void +fdclearlocks(struct thread *td) +{ + struct filedesc *fdp; + struct filedesc_to_leader *fdtol; + struct flock lf; + struct file *fp; + struct proc *p; + struct vnode *vp; + int i; + + p = td->td_proc; + fdp = p->p_fd; + fdtol = p->p_fdtol; + MPASS(fdtol != NULL); + + FILEDESC_XLOCK(fdp); + KASSERT(fdtol->fdl_refcount > 0, + ("filedesc_to_refcount botch: fdl_refcount=%d", + fdtol->fdl_refcount)); + if (fdtol->fdl_refcount == 1 && + (p->p_leader->p_flag & P_ADVLOCK) != 0) { + for (i = 0; i <= fdp->fd_lastfile; i++) { + fp = fdp->fd_ofiles[i].fde_file; + if (fp == NULL || fp->f_type != DTYPE_VNODE) + continue; + fhold(fp); + FILEDESC_XUNLOCK(fdp); + lf.l_whence = SEEK_SET; + lf.l_start = 0; + lf.l_len = 0; + lf.l_type = F_UNLCK; + vp = fp->f_vnode; + (void) VOP_ADVLOCK(vp, + (caddr_t)p->p_leader, F_UNLCK, + &lf, F_POSIX); + FILEDESC_XLOCK(fdp); + fdrop(fp, td); + } + } +retry: + if (fdtol->fdl_refcount == 1) { + if (fdp->fd_holdleaderscount > 0 && + (p->p_leader->p_flag & P_ADVLOCK) != 0) { + /* + * close() or do_dup() has cleared a reference + * in a shared file descriptor table. + */ + fdp->fd_holdleaderswakeup = 1; + sx_sleep(&fdp->fd_holdleaderscount, + FILEDESC_LOCK(fdp), PLOCK, "fdlhold", 0); + goto retry; + } + if (fdtol->fdl_holdcount > 0) { + /* + * Ensure that fdtol->fdl_leader remains + * valid in closef(). + */ + fdtol->fdl_wakeup = 1; + sx_sleep(fdtol, FILEDESC_LOCK(fdp), PLOCK, + "fdlhold", 0); + goto retry; + } + } + fdtol->fdl_refcount--; + if (fdtol->fdl_refcount == 0 && + fdtol->fdl_holdcount == 0) { + fdtol->fdl_next->fdl_prev = fdtol->fdl_prev; + fdtol->fdl_prev->fdl_next = fdtol->fdl_next; + } else + fdtol = NULL; + p->p_fdtol = NULL; + FILEDESC_XUNLOCK(fdp); + if (fdtol != NULL) + free(fdtol, M_FILEDESC_TO_LEADER); +} + +/* * Release a filedesc structure. */ void fdescfree(struct thread *td) { struct filedesc *fdp; - int i; - struct filedesc_to_leader *fdtol; struct filedescent *fde; struct file *fp; - struct vnode *cdir, *jdir, *rdir, *vp; - struct flock lf; + struct vnode *cdir, *jdir, *rdir; + int i; /* Certain daemons might not have file descriptors. */ fdp = td->td_proc->p_fd; @@ -1970,69 +2049,8 @@ fdescfree(struct thread *td) PROC_UNLOCK(td->td_proc); #endif - /* Check for special need to clear POSIX style locks */ - fdtol = td->td_proc->p_fdtol; - if (fdtol != NULL) { - FILEDESC_XLOCK(fdp); - KASSERT(fdtol->fdl_refcount > 0, - ("filedesc_to_refcount botch: fdl_refcount=%d", - fdtol->fdl_refcount)); - if (fdtol->fdl_refcount == 1 && - (td->td_proc->p_leader->p_flag & P_ADVLOCK) != 0) { - for (i = 0; i <= fdp->fd_lastfile; i++) { - fp = fdp->fd_ofiles[i].fde_file; - if (fp == NULL || fp->f_type != DTYPE_VNODE) - continue; - fhold(fp); - FILEDESC_XUNLOCK(fdp); - lf.l_whence = SEEK_SET; - lf.l_start = 0; - lf.l_len = 0; - lf.l_type = F_UNLCK; - vp = fp->f_vnode; - (void) VOP_ADVLOCK(vp, - (caddr_t)td->td_proc->p_leader, F_UNLCK, - &lf, F_POSIX); - FILEDESC_XLOCK(fdp); - fdrop(fp, td); - } - } - retry: - if (fdtol->fdl_refcount == 1) { - if (fdp->fd_holdleaderscount > 0 && - (td->td_proc->p_leader->p_flag & P_ADVLOCK) != 0) { - /* - * close() or do_dup() has cleared a reference - * in a shared file descriptor table. - */ - fdp->fd_holdleaderswakeup = 1; - sx_sleep(&fdp->fd_holdleaderscount, - FILEDESC_LOCK(fdp), PLOCK, "fdlhold", 0); - goto retry; - } - if (fdtol->fdl_holdcount > 0) { - /* - * Ensure that fdtol->fdl_leader remains - * valid in closef(). - */ - fdtol->fdl_wakeup = 1; - sx_sleep(fdtol, FILEDESC_LOCK(fdp), PLOCK, - "fdlhold", 0); - goto retry; - } - } - fdtol->fdl_refcount--; - if (fdtol->fdl_refcount == 0 && - fdtol->fdl_holdcount == 0) { - fdtol->fdl_next->fdl_prev = fdtol->fdl_prev; - fdtol->fdl_prev->fdl_next = fdtol->fdl_next; - } else - fdtol = NULL; - td->td_proc->p_fdtol = NULL; - FILEDESC_XUNLOCK(fdp); - if (fdtol != NULL) - free(fdtol, M_FILEDESC_TO_LEADER); - } + if (td->td_proc->p_fdtol != NULL) + fdclearlocks(td); mtx_lock(&fdesc_mtx); td->td_proc->p_fd = NULL; From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 14:08:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6165B8B; Sun, 2 Nov 2014 14:08:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2B4098D; Sun, 2 Nov 2014 14:08:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2E8sps029901; Sun, 2 Nov 2014 14:08:54 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2E8sM2029900; Sun, 2 Nov 2014 14:08:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201411021408.sA2E8sM2029900@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 2 Nov 2014 14:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273969 - head/sys/dev/drm2/ttm 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 14:08:54 -0000 Author: tijl Date: Sun Nov 2 14:08:54 2014 New Revision: 273969 URL: https://svnweb.freebsd.org/changeset/base/273969 Log: Use default memory type for TTM buffer objects that may be cached. MFC after: 1 week Modified: head/sys/dev/drm2/ttm/ttm_bo_util.c Modified: head/sys/dev/drm2/ttm/ttm_bo_util.c ============================================================================== --- head/sys/dev/drm2/ttm/ttm_bo_util.c Sun Nov 2 13:43:04 2014 (r273968) +++ head/sys/dev/drm2/ttm/ttm_bo_util.c Sun Nov 2 14:08:54 2014 (r273969) @@ -508,8 +508,7 @@ static int ttm_bo_kmap_ttm(struct ttm_bu * or to make the buffer object look contiguous. */ prot = (mem->placement & TTM_PL_FLAG_CACHED) ? - VM_MEMATTR_WRITE_COMBINING : - ttm_io_prot(mem->placement); + VM_MEMATTR_DEFAULT : ttm_io_prot(mem->placement); map->bo_kmap_type = ttm_bo_map_vmap; map->num_pages = num_pages; map->virtual = (void *)kva_alloc(num_pages * PAGE_SIZE); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 14:12:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DACE6CDB; Sun, 2 Nov 2014 14:12:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C76A3A2A; Sun, 2 Nov 2014 14:12:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2EC3l7033921; Sun, 2 Nov 2014 14:12:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2EC3Hl033920; Sun, 2 Nov 2014 14:12:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411021412.sA2EC3Hl033920@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Nov 2014 14:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273970 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 14:12:04 -0000 Author: mjg Date: Sun Nov 2 14:12:03 2014 New Revision: 273970 URL: https://svnweb.freebsd.org/changeset/base/273970 Log: filedesc: move freeing old tables to fdescfree They cannot be accessed by anyone and hold count only protects the structure from being freed. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 2 14:08:54 2014 (r273969) +++ head/sys/kern/kern_descrip.c Sun Nov 2 14:12:03 2014 (r273970) @@ -1856,8 +1856,6 @@ fdhold(struct proc *p) static void fddrop(struct filedesc *fdp) { - struct filedesc0 *fdp0; - struct freetable *ft; int i; mtx_lock(&fdesc_mtx); @@ -1867,11 +1865,6 @@ fddrop(struct filedesc *fdp) return; FILEDESC_LOCK_DESTROY(fdp); - fdp0 = (struct filedesc0 *)fdp; - while ((ft = SLIST_FIRST(&fdp0->fd_free)) != NULL) { - SLIST_REMOVE_HEAD(&fdp0->fd_free, ft_next); - free(ft->ft_table, M_FILEDESC); - } free(fdp, M_FILEDESC); } @@ -2032,7 +2025,9 @@ retry: void fdescfree(struct thread *td) { + struct filedesc0 *fdp0; struct filedesc *fdp; + struct freetable *ft; struct filedescent *fde; struct file *fp; struct vnode *cdir, *jdir, *rdir; @@ -2085,6 +2080,12 @@ fdescfree(struct thread *td) if (fdp->fd_nfiles > NDFILE) free(fdp->fd_files, M_FILEDESC); + fdp0 = (struct filedesc0 *)fdp; + while ((ft = SLIST_FIRST(&fdp0->fd_free)) != NULL) { + SLIST_REMOVE_HEAD(&fdp0->fd_free, ft_next); + free(ft->ft_table, M_FILEDESC); + } + if (cdir != NULL) vrele(cdir); if (rdir != NULL) From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 15:27:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D819C7B; Sun, 2 Nov 2014 15:27:27 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 636B4FDC; Sun, 2 Nov 2014 15:27:27 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id sA2FRO5Q022438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 Nov 2014 07:27:25 -0800 Message-ID: <54564D5C.8090100@freebsd.org> Date: Sun, 02 Nov 2014 07:27:24 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273963 - head/sys/dev/agp References: <201411021126.sA2BQcx4053562@svn.freebsd.org> In-Reply-To: <201411021126.sA2BQcx4053562@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVY2SxQUXz/qaaGbGrFK0D2dRBTzeUGk5UFuRKCSAwE7pl16272nkn3JPZQuN14YSNsy90Mz7uEGiMKlc3mZjuWGQNGJhupEXjw= X-Sonic-ID: C;hDIzv6Ri5BG+afL/BCAIFQ== M;nOFrv6Ri5BG+afL/BCAIFQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 15:27:27 -0000 There is actually a write-combining memory type on PowerPC. You can set it the same way as on x86 (with VM_MEMATTR_WRITE_COMBINING). -Nathan On 11/02/14 03:26, Tijl Coosemans wrote: > Author: tijl > Date: Sun Nov 2 11:26:37 2014 > New Revision: 273963 > URL: https://svnweb.freebsd.org/changeset/base/273963 > > Log: > In agp(4) avoid the need to flush all cpu caches with wbinvd between > updating the GTT and flushing the AGP TLB by storing the GTT in > write-combining memory. > > On x86 flushing the AGP TLB is done by an I/O operation or a store to a > MMIO register in uncacheable memory. Both cases imply that WC buffers are > flushed so no memory barriers are needed. > > On powerpc there is no WC memory type. It maps to uncacheable memory and > two stores to uncacheable memory, such as to the GTT and then to an MMIO > register, are strongly ordered, so no memory barriers are needed either. > > MFC after: 1 month > > Modified: > head/sys/dev/agp/agp.c > head/sys/dev/agp/agp_amd.c > head/sys/dev/agp/agp_amd64.c > head/sys/dev/agp/agp_apple.c > head/sys/dev/agp/agp_ati.c > head/sys/dev/agp/agp_i810.c > head/sys/dev/agp/agppriv.h > > Modified: head/sys/dev/agp/agp.c > ============================================================================== > --- head/sys/dev/agp/agp.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > +#include > #include > #include > #include > @@ -84,14 +86,6 @@ static devclass_t agp_devclass; > > /* Helper functions for implementing chipset mini drivers. */ > > -void > -agp_flush_cache() > -{ > -#if defined(__i386__) || defined(__amd64__) > - wbinvd(); > -#endif > -} > - > u_int8_t > agp_find_caps(device_t dev) > { > @@ -158,17 +152,16 @@ agp_alloc_gatt(device_t dev) > return 0; > > gatt->ag_entries = entries; > - gatt->ag_virtual = contigmalloc(entries * sizeof(u_int32_t), M_AGP, 0, > - 0, ~0, PAGE_SIZE, 0); > + gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, > + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, > + 0, VM_MEMATTR_WRITE_COMBINING); > if (!gatt->ag_virtual) { > if (bootverbose) > device_printf(dev, "contiguous allocation failed\n"); > free(gatt, M_AGP); > return 0; > } > - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); > gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual); > - agp_flush_cache(); > > return gatt; > } > @@ -176,8 +169,8 @@ agp_alloc_gatt(device_t dev) > void > agp_free_gatt(struct agp_gatt *gatt) > { > - contigfree(gatt->ag_virtual, > - gatt->ag_entries * sizeof(u_int32_t), M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, > + gatt->ag_entries * sizeof(u_int32_t)); > free(gatt, M_AGP); > } > > @@ -280,7 +273,6 @@ agp_free_res(device_t dev) > bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, > sc->as_aperture); > mtx_destroy(&sc->as_lock); > - agp_flush_cache(); > } > > int > @@ -605,12 +597,6 @@ agp_generic_bind_memory(device_t dev, st > VM_OBJECT_WUNLOCK(mem->am_obj); > > /* > - * Flush the cpu cache since we are providing a new mapping > - * for these pages. > - */ > - agp_flush_cache(); > - > - /* > * Make sure the chipset gets the new mappings. > */ > AGP_FLUSH_TLB(dev); > @@ -668,7 +654,6 @@ agp_generic_unbind_memory(device_t dev, > } > VM_OBJECT_WUNLOCK(mem->am_obj); > > - agp_flush_cache(); > AGP_FLUSH_TLB(dev); > > mem->am_offset = 0; > @@ -1040,7 +1025,6 @@ agp_bind_pages(device_t dev, vm_page_t * > } > } > > - agp_flush_cache(); > AGP_FLUSH_TLB(dev); > > mtx_unlock(&sc->as_lock); > @@ -1063,7 +1047,6 @@ agp_unbind_pages(device_t dev, vm_size_t > for (i = 0; i < size; i += AGP_PAGE_SIZE) > AGP_UNBIND_PAGE(dev, offset + i); > > - agp_flush_cache(); > AGP_FLUSH_TLB(dev); > > mtx_unlock(&sc->as_lock); > > Modified: head/sys/dev/agp/agp_amd.c > ============================================================================== > --- head/sys/dev/agp/agp_amd.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp_amd.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > +#include > #include > #include > #include > @@ -92,34 +94,35 @@ agp_amd_alloc_gatt(device_t dev) > > /* > * The AMD751 uses a page directory to map a non-contiguous > - * gatt so we don't need to use contigmalloc. > - * Malloc individual gatt pages and map them into the page > + * gatt so we don't need to use kmem_alloc_contig. > + * Allocate individual GATT pages and map them into the page > * directory. > */ > gatt->ag_entries = entries; > - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), > - M_AGP, M_NOWAIT); > + gatt->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, > + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, > + VM_MEMATTR_WRITE_COMBINING); > if (!gatt->ag_virtual) { > if (bootverbose) > device_printf(dev, "allocation failed\n"); > free(gatt, M_AGP); > return 0; > } > - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); > > /* > * Allocate the page directory. > */ > - gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); > + gatt->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, > + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); > if (!gatt->ag_vdir) { > if (bootverbose) > device_printf(dev, > "failed to allocate page directory\n"); > - free(gatt->ag_virtual, M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, > + entries * sizeof(u_int32_t)); > free(gatt, M_AGP); > return 0; > } > - bzero(gatt->ag_vdir, AGP_PAGE_SIZE); > > gatt->ag_pdir = vtophys((vm_offset_t) gatt->ag_vdir); > if(bootverbose) > @@ -158,19 +161,15 @@ agp_amd_alloc_gatt(device_t dev) > gatt->ag_vdir[i + pdir_offset] = pa | 1; > } > > - /* > - * Make sure the chipset can see everything. > - */ > - agp_flush_cache(); > - > return gatt; > } > > static void > agp_amd_free_gatt(struct agp_amd_gatt *gatt) > { > - free(gatt->ag_virtual, M_AGP); > - free(gatt->ag_vdir, M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_vdir, AGP_PAGE_SIZE); > + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, > + gatt->ag_entries * sizeof(u_int32_t)); > free(gatt, M_AGP); > } > > > Modified: head/sys/dev/agp/agp_amd64.c > ============================================================================== > --- head/sys/dev/agp/agp_amd64.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp_amd64.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -241,8 +241,6 @@ agp_amd64_attach(device_t dev) > 4); > } > > - agp_flush_cache(); > - > return (0); > } > > > Modified: head/sys/dev/agp/agp_apple.c > ============================================================================== > --- head/sys/dev/agp/agp_apple.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp_apple.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -224,8 +224,6 @@ agp_apple_bind_page(device_t dev, vm_off > return EINVAL; > > sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; > - __asm __volatile("dcbst 0,%0; sync" :: > - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); > return (0); > } > > @@ -238,8 +236,6 @@ agp_apple_unbind_page(device_t dev, vm_o > return EINVAL; > > sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; > - __asm __volatile("dcbst 0,%0; sync" :: > - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); > return (0); > } > > > Modified: head/sys/dev/agp/agp_ati.c > ============================================================================== > --- head/sys/dev/agp/agp_ati.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp_ati.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > +#include > #include > #include > #include > @@ -129,20 +131,23 @@ agp_ati_alloc_gatt(device_t dev) > > /* Alloc the GATT -- pointers to pages of AGP memory */ > sc->ag_entries = entries; > - sc->ag_virtual = malloc(entries * sizeof(u_int32_t), M_AGP, > - M_NOWAIT | M_ZERO); > + sc->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, > + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, > + VM_MEMATTR_WRITE_COMBINING); > if (sc->ag_virtual == NULL) { > if (bootverbose) > - device_printf(dev, "aperture allocation failed\n"); > + device_printf(dev, "GATT allocation failed\n"); > return ENOMEM; > } > > /* Alloc the page directory -- pointers to each page of the GATT */ > - sc->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT | M_ZERO); > + sc->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, > + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); > if (sc->ag_vdir == NULL) { > if (bootverbose) > device_printf(dev, "pagedir allocation failed\n"); > - free(sc->ag_virtual, M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, > + entries * sizeof(u_int32_t)); > return ENOMEM; > } > sc->ag_pdir = vtophys((vm_offset_t)sc->ag_vdir); > @@ -158,11 +163,6 @@ agp_ati_alloc_gatt(device_t dev) > sc->ag_vdir[apbase_offset + i] = pa | 1; > } > > - /* > - * Make sure the chipset can see everything. > - */ > - agp_flush_cache(); > - > return 0; > } > > @@ -264,8 +264,9 @@ agp_ati_detach(device_t dev) > temp = pci_read_config(dev, apsize_reg, 4); > pci_write_config(dev, apsize_reg, temp & ~1, 4); > > - free(sc->ag_vdir, M_AGP); > - free(sc->ag_virtual, M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)sc->ag_vdir, AGP_PAGE_SIZE); > + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, > + sc->ag_entries * sizeof(u_int32_t)); > > bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs); > agp_free_res(dev); > > Modified: head/sys/dev/agp/agp_i810.c > ============================================================================== > --- head/sys/dev/agp/agp_i810.c Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agp_i810.c Sun Nov 2 11:26:37 2014 (r273963) > @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); > #include > > #include > +#include > +#include > #include > #include > #include > @@ -1388,17 +1390,16 @@ agp_i810_install_gatt(device_t dev) > sc->dcache_size = 0; > > /* According to the specs the gatt on the i810 must be 64k. */ > - sc->gatt->ag_virtual = contigmalloc(64 * 1024, M_AGP, 0, 0, ~0, > - PAGE_SIZE, 0); > + sc->gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, > + 64 * 1024, M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, > + 0, VM_MEMATTR_WRITE_COMBINING); > if (sc->gatt->ag_virtual == NULL) { > if (bootverbose) > device_printf(dev, "contiguous allocation failed\n"); > return (ENOMEM); > } > > - bzero(sc->gatt->ag_virtual, sc->gatt->ag_entries * sizeof(u_int32_t)); > sc->gatt->ag_physical = vtophys((vm_offset_t)sc->gatt->ag_virtual); > - agp_flush_cache(); > /* Install the GATT. */ > bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, > sc->gatt->ag_physical | 1); > @@ -1497,7 +1498,7 @@ agp_i810_deinstall_gatt(device_t dev) > > sc = device_get_softc(dev); > bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0); > - contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP); > + kmem_free(kernel_arena, (vm_offset_t)sc->gatt->ag_virtual, 64 * 1024); > } > > static void > @@ -2052,7 +2053,6 @@ agp_i810_bind_memory(device_t dev, struc > sc->match->driver->install_gtt_pte(dev, (offset + i) >> > AGP_PAGE_SHIFT, mem->am_physical + i, 0); > } > - agp_flush_cache(); > mem->am_offset = offset; > mem->am_is_bound = 1; > mtx_unlock(&sc->agp.as_lock); > @@ -2093,7 +2093,6 @@ agp_i810_unbind_memory(device_t dev, str > sc->match->driver->install_gtt_pte(dev, > (mem->am_offset + i) >> AGP_PAGE_SHIFT, 0, 0); > } > - agp_flush_cache(); > mem->am_is_bound = 0; > mtx_unlock(&sc->agp.as_lock); > return (0); > > Modified: head/sys/dev/agp/agppriv.h > ============================================================================== > --- head/sys/dev/agp/agppriv.h Sun Nov 2 09:52:22 2014 (r273962) > +++ head/sys/dev/agp/agppriv.h Sun Nov 2 11:26:37 2014 (r273963) > @@ -83,7 +83,6 @@ struct agp_gatt { > vm_offset_t ag_physical; > }; > > -void agp_flush_cache(void); > u_int8_t agp_find_caps(device_t dev); > struct agp_gatt *agp_alloc_gatt(device_t dev); > void agp_set_aperture_resource(device_t dev, int rid); > From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 15:36:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81BF2E9C; Sun, 2 Nov 2014 15:36:36 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A51FC119; Sun, 2 Nov 2014 15:36:35 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id b13so8887515wgh.11 for ; Sun, 02 Nov 2014 07:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=FBPVJzu4VcSjpGjHH+vkMZYStiF6AYEfRjexLMU5xKc=; b=EaLpHzL6x+w+AYktp2NVCl/xPByPtt0Wx4T+dHcQxKHBXz300sTwS5mZQezDffrC8S oCOq+QAGNZPU8gkPjBfIOhukOwKX5fXbJEoymKgntCSaInVxZQBLqGsrJ7o9F4wWi+2e RRYDGFnrMMFheePdllUAyvNLqUfQo9Nd160/kablsCp29nsgMrua9+DisgYvfnWQ5go8 6ozAcmn4/vrNLgfnXi7DIS4x3aOLX/9MjZZ40Ts9g4rpx+fTnBaZN+7c3KGUfLxYKtkC EKH8qN4GHidLQksMUXnYKC66edqf37qLMu7Z8xnjm7sPBgDth/ZPPreZUy/mbVsYxCiS JOdA== MIME-Version: 1.0 X-Received: by 10.181.8.72 with SMTP id di8mr10487709wid.1.1414942593973; Sun, 02 Nov 2014 07:36:33 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 07:36:33 -0800 (PST) In-Reply-To: <201411021310.sA2DAWmD003298@svn.freebsd.org> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> Date: Sun, 2 Nov 2014 16:36:33 +0100 X-Google-Sender-Auth: csIK21nrawP4MWcz6A9XTDzS8gg Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 15:36:36 -0000 On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: > Author: kib > Date: Sun Nov 2 13:10:31 2014 > New Revision: 273966 > URL: https://svnweb.freebsd.org/changeset/base/273966 > > Log: > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines > whether the shared request for already shared-locked lock could be > granted. Both problems result in the exclusive locker starvation. > > The concurrent exclusive request is indicated by either > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse > condition, i.e. no exclusive waiters, must check that both flags are > cleared. > > Add a flag LK_NODDLKTREAT for shared lock request to indicate that > current thread guarantees that it does not own the lock in shared > mode. This turns back the exclusive lock starvation avoidance code; > see man page update for detailed description. > > Use LK_NODDLKTREAT when doing lookup(9). > > Reported and tested by: pho > No objections from: attilio Not true, I objected to the part of the patch that modifies the semantic for changing the writer starvation avoidance technique. As I said the td_lk_slocks must work for every consumer of lockmgr, it is not specific to any usage in the kernel, including namei() or lookups. This is an hinerent property of lockmgr, it has not strict relation with its callers. Now you can deadlock lockmgr if you use recursive shared acquisition in a path that has not been identified. This part of the patch should be reverted. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 15:54:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9E7E247; Sun, 2 Nov 2014 15:54:48 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E79362BB; Sun, 2 Nov 2014 15:54:47 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id h11so4585791wiw.12 for ; Sun, 02 Nov 2014 07:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=bun0VUAfAUdlP17Apk9dMw8Mry/8k9JS16it6CC4KAg=; b=Ett01WYS6KHhjLzmQQIXs5Xcaal1UrauEZhpIrT2zvth+5dYv7bM/VLS8AzNMUWt/3 qbmY8sLYwgx6WzlajCaOE9rJB1DTl8YFle4knA1peBu03QLvnbMR3y1TvV61feuZDQR4 sl0C/jdK/BbYMqVFs5Wf9dEbsTi52+uw0hdrr7kz93dOO8Yf2qSYyxLRhDMV4thLj+J+ oXXakal8iRpRSvIs19THZCueWgh8dMc3o6bE7Rg/+mj95Vv5q0AGoKq258x1FgPxeJKb KH8ZrLO0PSYR1oaawsYqEbFeyGTNqJacusuuUpBmoiD2TGvEEM4bR93bDNxACbBgVuFL Eaiw== MIME-Version: 1.0 X-Received: by 10.194.92.82 with SMTP id ck18mr2739529wjb.103.1414943686088; Sun, 02 Nov 2014 07:54:46 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 07:54:46 -0800 (PST) In-Reply-To: <201411021310.sA2DAWmD003298@svn.freebsd.org> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> Date: Sun, 2 Nov 2014 16:54:46 +0100 X-Google-Sender-Auth: kjr-sf0B1NVXruipMokKM9te-0Y Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 15:54:48 -0000 On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: > Author: kib > Date: Sun Nov 2 13:10:31 2014 > New Revision: 273966 > URL: https://svnweb.freebsd.org/changeset/base/273966 > > Log: > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines > whether the shared request for already shared-locked lock could be > granted. Both problems result in the exclusive locker starvation. > > The concurrent exclusive request is indicated by either > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse > condition, i.e. no exclusive waiters, must check that both flags are > cleared. > > Add a flag LK_NODDLKTREAT for shared lock request to indicate that > current thread guarantees that it does not own the lock in shared > mode. This turns back the exclusive lock starvation avoidance code; > see man page update for detailed description. > > Use LK_NODDLKTREAT when doing lookup(9). The right way to implement this (selectively disabling writer starvation avoidance) must be on a lock-basis. So you need a new flag to pass to lockinit(). This is to support it "globaly". Then, you can pass it on a lockmgr() instance basis (like FreeBSD also passes, for example, LK_NOWITNESS). You can use it during lookup() calls. Maybe you will need to propagate it via the vn_lock() interface. The patch will be bigger but much cleaner and more correct than what is in head now. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:04:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5972F49E; Sun, 2 Nov 2014 16:04:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4570138C; Sun, 2 Nov 2014 16:04:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2G4nK7088430; Sun, 2 Nov 2014 16:04:49 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2G4n1R088429; Sun, 2 Nov 2014 16:04:49 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411021604.sA2G4n1R088429@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Sun, 2 Nov 2014 16:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273973 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 16:04:49 -0000 Author: dumbbell Date: Sun Nov 2 16:04:48 2014 New Revision: 273973 URL: https://svnweb.freebsd.org/changeset/base/273973 Log: vt(4): Fix keyboard allocation when kbdmux(4) isn't used The problem was that only the kbdmux keyboard index was saved in vd->vd_keyboard. This index is -1 when kbdmux isn't used. In this case, the keyboard was correctly allocated, but the returned index was discarded. PR: 194718 MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Nov 2 14:28:20 2014 (r273972) +++ head/sys/dev/vt/vt_core.c Sun Nov 2 16:04:48 2014 (r273973) @@ -866,7 +866,6 @@ vt_allocate_keyboard(struct vt_device *v keyboard_info_t ki; idx0 = kbd_allocate("kbdmux", -1, vd, vt_kbdevent, vd); - vd->vd_keyboard = idx0; if (idx0 >= 0) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); k0 = kbd_get_keyboard(idx0); @@ -894,6 +893,7 @@ vt_allocate_keyboard(struct vt_device *v return (-1); } } + vd->vd_keyboard = idx0; DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); return (idx0); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:07:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA0026CE; Sun, 2 Nov 2014 16:07:56 +0000 (UTC) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 038743CF; Sun, 2 Nov 2014 16:07:55 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsIIADRWVlRbsIXe/2dsb2JhbABcgw6BIQvUXgQCAoERFwEBAQEBfYQDAQEEOhwjEAsOCgklDyoeBhOIRQHJFQEBAQEBAQQBAQEBAR2REAeESwEEngCWUYN5PC+CSwEBAQ Received: from 222.133-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.133.222]) by relay.skynet.be with ESMTP; 02 Nov 2014 17:07:47 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id sA2G7k9i002422; Sun, 2 Nov 2014 17:07:46 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sun, 2 Nov 2014 17:07:46 +0100 From: Tijl Coosemans To: Nathan Whitehorn Subject: Re: svn commit: r273963 - head/sys/dev/agp Message-ID: <20141102170746.287a64e1@kalimero.tijl.coosemans.org> In-Reply-To: <54564D5C.8090100@freebsd.org> References: <201411021126.sA2BQcx4053562@svn.freebsd.org> <54564D5C.8090100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 16:07:57 -0000 On Sun, 02 Nov 2014 07:27:24 -0800 Nathan Whitehorn wrote: > There is actually a write-combining memory type on PowerPC. You can set > it the same way as on x86 (with VM_MEMATTR_WRITE_COMBINING). Yes, that's what the patch does, but in sys/powerpc (aim/mmu_oea.c, aim/mmu_oea64.c and booke/pmap.c) VM_MEMATTR_WRITE_COMBINING becomes PTE_I meaning Caching Inhibited. Does powerpc do write-combining for this type? That code also maps VM_MEMATTR_WRITE_BACK to PTE_I by the way. I think that should be PTE_M (write-back caching + cache coherency). From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:37:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E38BEF6; Sun, 2 Nov 2014 16:37:36 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5A0883; Sun, 2 Nov 2014 16:37:36 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2GbTJV078317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 18:37:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2GbTJV078317 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2GbSNo078316; Sun, 2 Nov 2014 18:37:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 18:37:28 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102163728.GX53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 16:37:36 -0000 On Sun, Nov 02, 2014 at 04:54:46PM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Nov 2 13:10:31 2014 > > New Revision: 273966 > > URL: https://svnweb.freebsd.org/changeset/base/273966 > > > > Log: > > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines > > whether the shared request for already shared-locked lock could be > > granted. Both problems result in the exclusive locker starvation. > > > > The concurrent exclusive request is indicated by either > > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse > > condition, i.e. no exclusive waiters, must check that both flags are > > cleared. > > > > Add a flag LK_NODDLKTREAT for shared lock request to indicate that > > current thread guarantees that it does not own the lock in shared > > mode. This turns back the exclusive lock starvation avoidance code; > > see man page update for detailed description. > > > > Use LK_NODDLKTREAT when doing lookup(9). > > The right way to implement this (selectively disabling writer > starvation avoidance) must be on a lock-basis. > So you need a new flag to pass to lockinit(). This is to support it "globaly". Any vnode (except some very special) does participate in lookup. So the proposed new flag has to be passed to every lockmgr init call. Disabling exclusive starvation support for all vnode lock calls is also wrong. > Then, you can pass it on a lockmgr() instance basis (like FreeBSD also > passes, for example, LK_NOWITNESS). > You can use it during lookup() calls. Maybe you will need to propagate > it via the vn_lock() interface. Well, if you indeed looked at the patch, you would note that this is exactly what is done. The flag is passed only to vn_lock() calls which are coming from lookup (VOP_LOOKUP as well). The flag use is safe since deadlock prevention by td_lk_slocks only matters when the same lock was previously taken by the same thread which does recursive shared request [*]. td_lk_slocks is the poor and very indiscriminative way to express this, but might be unavoidable since shared owners are not recorded. * I believe there are also situation (like vnode locking in page fault) where it matters in way similar to TDP_DEADLKTREAT without flag being set, but lookup() cannot expose them. Now, thread calling namei() cannot own shared lock on the vnode it tries to lock, since such code will cause deadlock for many reason. As such, td_lk_slocks counter is not relevant for the vn_lock() calls from lookup. More, when vn_lock() call is performed, the counter is always >= 1, due to the lookup already owning the lock for the different (parent) vnode. The last fact means that the exclusive starvation happen. > > The patch will be bigger but much cleaner and more correct than what > is in head now. I do not understand what would change except adding useless flag to init. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:42:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24495257; Sun, 2 Nov 2014 16:42:58 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64A7494B; Sun, 2 Nov 2014 16:42:57 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id a1so9571642wgh.34 for ; Sun, 02 Nov 2014 08:42:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ASyxTDpSmCBRXzZKZEg+vCaKThV73+6znjrjvkEbJQY=; b=qD7DcaPY3DRJWE/u6jSLcHU13wKmk43MITBKt1m13RwDXKYgUC3dQQ6bdBPhKYaBQI yrxvxKupa7WLN/YygwNvZJNRFw8EUWDDTtqM/cDGYhDpYR3GU5VgIq3wpGJ8xq31+3pv dwpFojAZPvlgJxpZ0AjnSeRS+8+msXglePKDR8rjUSHjr0P3F+eG/Zboj86L8L+4zvuo mtkuwCcE7Xc8hp3B1WuDaN2Cw/5UGtkws64hjUW5aHf5kzV3pnjuG/ivM5EHrD1NX7fU zXYOHlVozyCcGuAlBoZFXuL4cogTYubHZ4UZD9JKSxKgoYAo3RppW/6/+Uuo2MhwHEb5 /87A== MIME-Version: 1.0 X-Received: by 10.180.83.37 with SMTP id n5mr10685050wiy.7.1414946575491; Sun, 02 Nov 2014 08:42:55 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 08:42:55 -0800 (PST) In-Reply-To: <20141102163728.GX53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 17:42:55 +0100 X-Google-Sender-Auth: ZVyUWbw1R7uao24H2v52QwKYqCA Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 16:42:58 -0000 On Sun, Nov 2, 2014 at 5:37 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 04:54:46PM +0100, Attilio Rao wrote: >> On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: >> > Author: kib >> > Date: Sun Nov 2 13:10:31 2014 >> > New Revision: 273966 >> > URL: https://svnweb.freebsd.org/changeset/base/273966 >> > >> > Log: >> > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines >> > whether the shared request for already shared-locked lock could be >> > granted. Both problems result in the exclusive locker starvation. >> > >> > The concurrent exclusive request is indicated by either >> > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse >> > condition, i.e. no exclusive waiters, must check that both flags are >> > cleared. >> > >> > Add a flag LK_NODDLKTREAT for shared lock request to indicate that >> > current thread guarantees that it does not own the lock in shared >> > mode. This turns back the exclusive lock starvation avoidance code; >> > see man page update for detailed description. >> > >> > Use LK_NODDLKTREAT when doing lookup(9). >> >> The right way to implement this (selectively disabling writer >> starvation avoidance) must be on a lock-basis. >> So you need a new flag to pass to lockinit(). This is to support it "globaly". > Any vnode (except some very special) does participate in lookup. > So the proposed new flag has to be passed to every lockmgr init call. > Disabling exclusive starvation support for all vnode lock calls is > also wrong. > >> Then, you can pass it on a lockmgr() instance basis (like FreeBSD also >> passes, for example, LK_NOWITNESS). >> You can use it during lookup() calls. Maybe you will need to propagate >> it via the vn_lock() interface. > Well, if you indeed looked at the patch, you would note that this is > exactly what is done. The flag is passed only to vn_lock() calls > which are coming from lookup (VOP_LOOKUP as well). > > The flag use is safe since deadlock prevention by td_lk_slocks only > matters when the same lock was previously taken by the same thread > which does recursive shared request [*]. td_lk_slocks is the poor and > very indiscriminative way to express this, but might be unavoidable > since shared owners are not recorded. If you have a better way to fix this into a "rich and discriminative" way I'm all ears. > * I believe there are also situation (like vnode locking in page fault) > where it matters in way similar to TDP_DEADLKTREAT without flag being > set, but lookup() cannot expose them. > > Now, thread calling namei() cannot own shared lock on the vnode it > tries to lock, since such code will cause deadlock for many reason. As > such, td_lk_slocks counter is not relevant for the vn_lock() calls from > lookup. More, when vn_lock() call is performed, the counter is always >= > 1, due to the lookup already owning the lock for the different (parent) > vnode. The last fact means that the exclusive starvation happen. > >> >> The patch will be bigger but much cleaner and more correct than what >> is in head now. > I do not understand what would change except adding useless flag > to init. I didn't look into details of the original problem, but this would cleanup semantics. As it is now it is just confusing for people. I think that we should invest some time in cleaning up (or keep clean) interface that will be used into drivers and thirdy part code. Right now the new flag is just a shot in the dark. As always, feel free to skip my suggestions. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 16:59:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9D36CD; Sun, 2 Nov 2014 16:59:22 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0D87A33; Sun, 2 Nov 2014 16:59:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2GxGsu082740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 18:59:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2GxGsu082740 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2GxGVV082739; Sun, 2 Nov 2014 18:59:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 18:59:16 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102165916.GY53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 16:59:22 -0000 On Sun, Nov 02, 2014 at 05:42:55PM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 5:37 PM, Konstantin Belousov wrote: > > On Sun, Nov 02, 2014 at 04:54:46PM +0100, Attilio Rao wrote: > >> On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: > >> > Author: kib > >> > Date: Sun Nov 2 13:10:31 2014 > >> > New Revision: 273966 > >> > URL: https://svnweb.freebsd.org/changeset/base/273966 > >> > > >> > Log: > >> > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines > >> > whether the shared request for already shared-locked lock could be > >> > granted. Both problems result in the exclusive locker starvation. > >> > > >> > The concurrent exclusive request is indicated by either > >> > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse > >> > condition, i.e. no exclusive waiters, must check that both flags are > >> > cleared. > >> > > >> > Add a flag LK_NODDLKTREAT for shared lock request to indicate that > >> > current thread guarantees that it does not own the lock in shared > >> > mode. This turns back the exclusive lock starvation avoidance code; > >> > see man page update for detailed description. > >> > > >> > Use LK_NODDLKTREAT when doing lookup(9). > >> > >> The right way to implement this (selectively disabling writer > >> starvation avoidance) must be on a lock-basis. > >> So you need a new flag to pass to lockinit(). This is to support it "globaly". > > Any vnode (except some very special) does participate in lookup. > > So the proposed new flag has to be passed to every lockmgr init call. > > Disabling exclusive starvation support for all vnode lock calls is > > also wrong. > > > >> Then, you can pass it on a lockmgr() instance basis (like FreeBSD also > >> passes, for example, LK_NOWITNESS). > >> You can use it during lookup() calls. Maybe you will need to propagate > >> it via the vn_lock() interface. > > Well, if you indeed looked at the patch, you would note that this is > > exactly what is done. The flag is passed only to vn_lock() calls > > which are coming from lookup (VOP_LOOKUP as well). > > > > The flag use is safe since deadlock prevention by td_lk_slocks only > > matters when the same lock was previously taken by the same thread > > which does recursive shared request [*]. td_lk_slocks is the poor and > > very indiscriminative way to express this, but might be unavoidable > > since shared owners are not recorded. > > If you have a better way to fix this into a "rich and discriminative" > way I'm all ears. It is easy and cheap to record the set of the owned lockmgr locks for current thread. I do not believe that we have a situation where more than 3 locks are held in one time. To give it some slack, we can record 8 locks shared-owned and do the check for recursion in LK_CAN_SHARE(). If the thread-locks table overflows, we could either panic() or fall back to indiscriminative deadlock avoidance (i.e. relying on the sole td_lk_slocks value). > > > * I believe there are also situation (like vnode locking in page fault) > > where it matters in way similar to TDP_DEADLKTREAT without flag being > > set, but lookup() cannot expose them. > > > > Now, thread calling namei() cannot own shared lock on the vnode it > > tries to lock, since such code will cause deadlock for many reason. As > > such, td_lk_slocks counter is not relevant for the vn_lock() calls from > > lookup. More, when vn_lock() call is performed, the counter is always >= > > 1, due to the lookup already owning the lock for the different (parent) > > vnode. The last fact means that the exclusive starvation happen. > > > >> > >> The patch will be bigger but much cleaner and more correct than what > >> is in head now. > > I do not understand what would change except adding useless flag > > to init. > > I didn't look into details of the original problem, but this would > cleanup semantics. Oh. > As it is now it is just confusing for people. > I think that we should invest some time in cleaning up (or keep clean) > interface that will be used into drivers and thirdy part code. > Right now the new flag is just a shot in the dark. > > As always, feel free to skip my suggestions. > > Attilio > > > -- > Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:07:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8225C971; Sun, 2 Nov 2014 17:07:23 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1BA1AF1; Sun, 2 Nov 2014 17:07:22 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id ex7so4682207wid.4 for ; Sun, 02 Nov 2014 09:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=0fGAldwBgByOwkSKFuNpg8zgIy20Ki7k9ieme/5kmhM=; b=pKBf5K1gGMZsRiXzrA694NO9hk5IV4XHzA7uzVV5d4GYJm6EF91zClS6aJio6kmOJQ 3U/fJODyErMztMnRy1yTlMxKNCrSC5+8nuApDFkS8rzVHZEF6tOXS4Dykrrh0B0cthCJ f3ch76MvLx156gNWuDYOkqfUR+iHwHakIqPtpxBhoS4wbdQA5e9bLG1ulRdvDEvSzNqL pEuxo6s5qE3rHXeRUNtb1wzB7qYd3SaCT7zz53+2rFc+e+DoZJY4gxrSrMoy1Lj6sZ0F z4DkI7mP2RYpGHFx9KPSvn9mC332BPCNFQYHGlt8eFElyOIoVOzntm3KuNQuY+q5TIyZ /VFg== MIME-Version: 1.0 X-Received: by 10.194.185.229 with SMTP id ff5mr2077891wjc.122.1414948040956; Sun, 02 Nov 2014 09:07:20 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 09:07:20 -0800 (PST) In-Reply-To: <20141102165916.GY53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 18:07:20 +0100 X-Google-Sender-Auth: WQwtTCfCtEsenzH1H356ssaeH64 Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:07:23 -0000 On Sun, Nov 2, 2014 at 5:59 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 05:42:55PM +0100, Attilio Rao wrote: >> On Sun, Nov 2, 2014 at 5:37 PM, Konstantin Belousov wrote: >> > On Sun, Nov 02, 2014 at 04:54:46PM +0100, Attilio Rao wrote: >> >> On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov wrote: >> >> > Author: kib >> >> > Date: Sun Nov 2 13:10:31 2014 >> >> > New Revision: 273966 >> >> > URL: https://svnweb.freebsd.org/changeset/base/273966 >> >> > >> >> > Log: >> >> > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines >> >> > whether the shared request for already shared-locked lock could be >> >> > granted. Both problems result in the exclusive locker starvation. >> >> > >> >> > The concurrent exclusive request is indicated by either >> >> > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse >> >> > condition, i.e. no exclusive waiters, must check that both flags are >> >> > cleared. >> >> > >> >> > Add a flag LK_NODDLKTREAT for shared lock request to indicate that >> >> > current thread guarantees that it does not own the lock in shared >> >> > mode. This turns back the exclusive lock starvation avoidance code; >> >> > see man page update for detailed description. >> >> > >> >> > Use LK_NODDLKTREAT when doing lookup(9). >> >> >> >> The right way to implement this (selectively disabling writer >> >> starvation avoidance) must be on a lock-basis. >> >> So you need a new flag to pass to lockinit(). This is to support it "globaly". >> > Any vnode (except some very special) does participate in lookup. >> > So the proposed new flag has to be passed to every lockmgr init call. >> > Disabling exclusive starvation support for all vnode lock calls is >> > also wrong. >> > >> >> Then, you can pass it on a lockmgr() instance basis (like FreeBSD also >> >> passes, for example, LK_NOWITNESS). >> >> You can use it during lookup() calls. Maybe you will need to propagate >> >> it via the vn_lock() interface. >> > Well, if you indeed looked at the patch, you would note that this is >> > exactly what is done. The flag is passed only to vn_lock() calls >> > which are coming from lookup (VOP_LOOKUP as well). >> > >> > The flag use is safe since deadlock prevention by td_lk_slocks only >> > matters when the same lock was previously taken by the same thread >> > which does recursive shared request [*]. td_lk_slocks is the poor and >> > very indiscriminative way to express this, but might be unavoidable >> > since shared owners are not recorded. >> >> If you have a better way to fix this into a "rich and discriminative" >> way I'm all ears. > It is easy and cheap to record the set of the owned lockmgr locks for > current thread. I do not believe that we have a situation where more > than 3 locks are held in one time. To give it some slack, we can record > 8 locks shared-owned and do the check for recursion in LK_CAN_SHARE(). > If the thread-locks table overflows, we could either panic() or fall > back to indiscriminative deadlock avoidance (i.e. relying on the sole > td_lk_slocks value). I don't think it is going to be cheap (and certainly it is not viable for things like sx locks and rwlocks). Checking for the owner chain anytime you acquire the lock is certainly not I would call cheap. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:19:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B02FC87; Sun, 2 Nov 2014 17:19:20 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EF48BDE; Sun, 2 Nov 2014 17:19:19 +0000 (UTC) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id sA2HJH0c010705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 Nov 2014 09:19:18 -0800 Message-ID: <54566795.6060204@freebsd.org> Date: Sun, 02 Nov 2014 09:19:17 -0800 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Tijl Coosemans Subject: Re: svn commit: r273963 - head/sys/dev/agp References: <201411021126.sA2BQcx4053562@svn.freebsd.org> <54564D5C.8090100@freebsd.org> <20141102170746.287a64e1@kalimero.tijl.coosemans.org> In-Reply-To: <20141102170746.287a64e1@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVZjPVEsLmT18KsWnyG+KUtw/rEBUa/n8BqKiPLo2ZmpNyEf+81NeKQx4DZbC22U6oUl/lCycsa/RmsVpKdIPsvd1D4SdF1eHhc= X-Sonic-ID: C;BqdoYLRi5BGLBCgW/FJGkA== M;9gm2YLRi5BGLBCgW/FJGkA== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:19:20 -0000 On 11/02/14 08:07, Tijl Coosemans wrote: > On Sun, 02 Nov 2014 07:27:24 -0800 Nathan Whitehorn wrote: >> There is actually a write-combining memory type on PowerPC. You can set >> it the same way as on x86 (with VM_MEMATTR_WRITE_COMBINING). > Yes, that's what the patch does, but in sys/powerpc (aim/mmu_oea.c, > aim/mmu_oea64.c and booke/pmap.c) VM_MEMATTR_WRITE_COMBINING becomes > PTE_I meaning Caching Inhibited. Does powerpc do write-combining for > this type? It is write-combining on all north bridges that support write combining. Regular caching-inhibited is PTE_I | PTE_G. PTE_I means there is no caching, which you want, and PTE_G means that every read/write instruction is a read/write operation of exactly that length exactly right then on the bus. Removing the PTE_G (guarded) flag means the bus is free to do write-combining if it wants to and is the standard way to signal this. > That code also maps VM_MEMATTR_WRITE_BACK to PTE_I by the way. I think > that should be PTE_M (write-back caching + cache coherency). > I think you're right but would like to consider for a few days before changing it. -Nathan From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:23:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 907F9DEC; Sun, 2 Nov 2014 17:23:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7100EC79; Sun, 2 Nov 2014 17:23:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HNj5g027547; Sun, 2 Nov 2014 17:23:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HNjJB027546; Sun, 2 Nov 2014 17:23:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021723.sA2HNjJB027546@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:23:45 +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: r273974 - stable/10/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:23:45 -0000 Author: mav Date: Sun Nov 2 17:23:44 2014 New Revision: 273974 URL: https://svnweb.freebsd.org/changeset/base/273974 Log: MFC r272401, r272402: Rework the logic of sequential SCSI LUN scanner. Previous logic was not differentiating disconnected LUNs and absent targets. That made it to stop scan if LUN 0 was not found for any reason. That made problematic, for example, using iSCSI targets declaring SPC-2 compliance and having no LUN 0 configured. The new logic continues sequential LUN scan if: -- we have more configured LUNs that need recheck; -- this LUN is connected and its SCSI version allows more LUNs; -- this LUN is disconnected, its SCSI version allows more LUNs and we guess they may be connected (we haven't scanned first 8 LUNs yet or kern.cam.cam_srch_hi sysctl is set to scan more). Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 16:04:48 2014 (r273973) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:23:44 2014 (r273974) @@ -1138,6 +1138,7 @@ out: u_int8_t periph_qual; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; + scsi_find_quirk(path->device); inq_buf = &path->device->inq_data; periph_qual = SID_QUAL(inq_buf); @@ -1166,8 +1167,6 @@ out: goto out; } - scsi_find_quirk(path->device); - scsi_devise_transport(path); if (path->device->lun_id == 0 && @@ -1216,10 +1215,13 @@ out: : SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { goto outr; - } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + } else { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + /* Don't wedge the queue */ + xpt_release_devq(done_ccb->ccb_h.path, + /*count*/1, /*run_queue*/TRUE); + } + path->device->flags &= ~CAM_DEV_INQUIRY_DATA_VALID; } /* * If we get to this point, we got an error status back @@ -1980,7 +1982,7 @@ scsi_scan_bus(struct cam_periph *periph, struct cam_path *path, *oldpath; scsi_scan_bus_info *scan_info; struct cam_et *target; - struct cam_ed *device; + struct cam_ed *device, *nextdev; int next_target; path_id_t path_id; target_id_t target_id; @@ -1989,18 +1991,10 @@ scsi_scan_bus(struct cam_periph *periph, oldpath = request_ccb->ccb_h.path; status = cam_ccb_status(request_ccb); - /* Reuse the same CCB to query if a device was really found */ scan_info = (scsi_scan_bus_info *)request_ccb->ccb_h.ppriv_ptr0; - xpt_setup_ccb(&request_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - request_ccb->ccb_h.func_code = XPT_GDEV_TYPE; - - path_id = request_ccb->ccb_h.path_id; target_id = request_ccb->ccb_h.target_id; lun_id = request_ccb->ccb_h.target_lun; - xpt_action(request_ccb); - target = request_ccb->ccb_h.path->target; next_target = 1; @@ -2077,56 +2071,39 @@ scsi_scan_bus(struct cam_periph *periph, } } } else { - mtx_unlock(&target->luns_mtx); - if (request_ccb->ccb_h.status != CAM_REQ_CMP) { - int phl; - - /* - * If we already probed lun 0 successfully, or - * we have additional configured luns on this - * target that might have "gone away", go onto - * the next lun. - */ - /* - * We may touch devices that we don't - * hold references too, so ensure they - * don't disappear out from under us. - * The target above is referenced by the - * path in the request ccb. - */ - phl = 0; - device = TAILQ_FIRST(&target->ed_entries); - if (device != NULL) { - phl = CAN_SRCH_HI_SPARSE(device); - if (device->lun_id == 0) - device = TAILQ_NEXT(device, links); - } - if ((lun_id != 0) || (device != NULL)) { - if (lun_id < (CAM_SCSI2_MAXLUN-1) || phl) { - lun_id++; - next_target = 0; - } - } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } else { - + mtx_unlock(&target->luns_mtx); device = request_ccb->ccb_h.path->device; - - if ((SCSI_QUIRK(device)->quirks & - CAM_QUIRK_NOLUNS) == 0) { - /* Try the next lun */ - if (lun_id < (CAM_SCSI2_MAXLUN-1) - || CAN_SRCH_HI_DENSE(device)) { - lun_id++; + /* Continue sequential LUN scan if: */ + /* -- we have more LUNs that need recheck */ + mtx_lock(&target->bus->eb_mtx); + nextdev = device; + while ((nextdev = TAILQ_NEXT(nextdev, links)) != NULL) + if ((nextdev->flags & CAM_DEV_UNCONFIGURED) == 0) + break; + mtx_unlock(&target->bus->eb_mtx); + if (nextdev != NULL) { + next_target = 0; + /* -- stop if CAM_QUIRK_NOLUNS is set. */ + } else if (SCSI_QUIRK(device)->quirks & CAM_QUIRK_NOLUNS) { + next_target = 1; + /* -- this LUN is connected and its SCSI version + * allows more LUNs. */ + } else if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_DENSE(device)) + next_target = 0; + /* -- this LUN is disconnected, its SCSI version + * allows more LUNs and we guess they may be. */ + } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) { + if (lun_id < (CAM_SCSI2_MAXLUN-1) || + CAN_SRCH_HI_SPARSE(device)) next_target = 0; - } } - if (lun_id == request_ccb->ccb_h.target_lun - || lun_id > scan_info->cpi->max_lun) - next_target = 1; - } + if (next_target == 0) { + lun_id++; + if (lun_id > scan_info->cpi->max_lun) + next_target = 1; + } } /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:25:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBA66FF9; Sun, 2 Nov 2014 17:25:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D53CC8A; Sun, 2 Nov 2014 17:25:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HP4ZN027898; Sun, 2 Nov 2014 17:25:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HP463027897; Sun, 2 Nov 2014 17:25:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021725.sA2HP463027897@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:25: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: r273975 - stable/10/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:25:04 -0000 Author: mav Date: Sun Nov 2 17:25:03 2014 New Revision: 273975 URL: https://svnweb.freebsd.org/changeset/base/273975 Log: MFC r272406: Make disconnected LUN 0 don't remain in half-configured state if there are no LUNs on SPC-3 target after we tried REPORT LUNS. Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:23:44 2014 (r273974) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:25:03 2014 (r273975) @@ -1197,12 +1197,6 @@ out: SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { - if (path->device->flags & - CAM_DEV_UNCONFIGURED) { - path->device->flags &= - ~CAM_DEV_UNCONFIGURED; - xpt_acquire_device(path->device); - } PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); periph->path->target->rpl_size = 16; xpt_release_ccb(done_ccb); @@ -1313,14 +1307,6 @@ out: tlun, 8); CAM_DEBUG(path, CAM_DEBUG_PROBE, ("lun 0 in position %u\n", idx)); - } else { - /* - * There is no lun 0 in our list. Destroy - * the validity of the inquiry data so we - * bail here and now. - */ - path->device->flags &= - ~CAM_DEV_INQUIRY_DATA_VALID; } } /* @@ -1333,7 +1319,8 @@ out: probe_purge_old(path, lp, softc->flags); lp = NULL; } - if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { + if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && + SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) { struct scsi_inquiry_data *inq_buf; inq_buf = &path->device->inq_data; if (INQ_DATA_TQ_ENABLED(inq_buf)) @@ -1348,6 +1335,8 @@ out: if (lp) { free(lp, M_CAMXPT); } + PROBE_SET_ACTION(softc, PROBE_INVALID); + xpt_release_ccb(done_ccb); break; } case PROBE_MODE_SENSE: From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:26:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A20D1F1; Sun, 2 Nov 2014 17:26:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17224C9B; Sun, 2 Nov 2014 17:26:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HQDuF028109; Sun, 2 Nov 2014 17:26:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HQDSE028108; Sun, 2 Nov 2014 17:26:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021726.sA2HQDSE028108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:26:13 +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: r273976 - stable/10/sys/cam/scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:26:14 -0000 Author: mav Date: Sun Nov 2 17:26:13 2014 New Revision: 273976 URL: https://svnweb.freebsd.org/changeset/base/273976 Log: MFC r272409: Use REPORT LUNS command for SPC-2 devices with LUN 0 disconnected. SPC-2 tells REPORT LUNS shall be supported by devices supporting LUNs other then LUN 0. If we see LUN 0 disconnected, guess there may be others, and so REPORT LUNS shall be supported. Modified: stable/10/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:25:03 2014 (r273975) +++ stable/10/sys/cam/scsi/scsi_xpt.c Sun Nov 2 17:26:13 2014 (r273976) @@ -1194,7 +1194,7 @@ out: xpt_schedule(periph, priority); goto out; } else if (path->device->lun_id == 0 && - SID_ANSI_REV(inq_buf) > SCSI_REV_SPC2 && + SID_ANSI_REV(inq_buf) >= SCSI_REV_SPC2 && (SCSI_QUIRK(path->device)->quirks & CAM_QUIRK_NORPTLUNS) == 0) { PROBE_SET_ACTION(softc, PROBE_REPORT_LUNS); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:28:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92F5936E; Sun, 2 Nov 2014 17:28:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748A3CB3; Sun, 2 Nov 2014 17:28:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HSAeu028405; Sun, 2 Nov 2014 17:28:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HS9De028401; Sun, 2 Nov 2014 17:28:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021728.sA2HS9De028401@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:28: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: r273977 - in stable/10/sys/cam: ctl scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:28:10 -0000 Author: mav Date: Sun Nov 2 17:28:08 2014 New Revision: 273977 URL: https://svnweb.freebsd.org/changeset/base/273977 Log: MFC r273073: Some groundwork for later Informational Exceptions support. This includes support for: - Read-Write Error Recovery mode page; - Informational Exceptions Control mode page; - Logical Block Provisioning mode page; - LOG SENSE command. No real Informational Exceptions features yet. This is only a placeholder. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:08 2014 (r273977) @@ -178,6 +178,34 @@ static struct copan_debugconf_subpage de {0xff,0xff}, /* ctl_time_io_secs */ }; +static struct scsi_da_rw_recovery_page rw_er_page_default = { + /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, + /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, + /*byte3*/SMS_RWER_AWRE|SMS_RWER_ARRE, + /*read_retry_count*/0, + /*correction_span*/0, + /*head_offset_count*/0, + /*data_strobe_offset_cnt*/0, + /*byte8*/0, + /*write_retry_count*/0, + /*reserved2*/0, + /*recovery_time_limit*/{0, 0}, +}; + +static struct scsi_da_rw_recovery_page rw_er_page_changeable = { + /*page_code*/SMS_RW_ERROR_RECOVERY_PAGE, + /*page_length*/sizeof(struct scsi_da_rw_recovery_page) - 2, + /*byte3*/0, + /*read_retry_count*/0, + /*correction_span*/0, + /*head_offset_count*/0, + /*data_strobe_offset_cnt*/0, + /*byte8*/0, + /*write_retry_count*/0, + /*reserved2*/0, + /*recovery_time_limit*/{0, 0}, +}; + static struct scsi_format_page format_page_default = { /*page_code*/SMS_FORMAT_DEVICE_PAGE, /*page_length*/sizeof(struct scsi_format_page) - 2, @@ -300,6 +328,41 @@ static struct scsi_control_page control_ /*extended_selftest_completion_time*/{0, 0} }; +static struct scsi_info_exceptions_page ie_page_default = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, + /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, + /*info_flags*/SIEP_FLAGS_DEXCPT, + /*mrie*/0, + /*interval_timer*/{0, 0, 0, 0}, + /*report_count*/{0, 0, 0, 0} +}; + +static struct scsi_info_exceptions_page ie_page_changeable = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE, + /*page_length*/sizeof(struct scsi_info_exceptions_page) - 2, + /*info_flags*/0, + /*mrie*/0, + /*interval_timer*/{0, 0, 0, 0}, + /*report_count*/{0, 0, 0, 0} +}; + +static struct scsi_logical_block_provisioning_page lbp_page_default = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, + /*subpage_code*/0x02, + /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*flags*/0, + /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + /*descr*/{} +}; + +static struct scsi_logical_block_provisioning_page lbp_page_changeable = { + /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, + /*subpage_code*/0x02, + /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*flags*/0, + /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + /*descr*/{} +}; /* * XXX KDM move these into the softc. @@ -4155,14 +4218,11 @@ ctl_init_page_index(struct ctl_lun *lun) { int i; struct ctl_page_index *page_index; - struct ctl_softc *softc; const char *value; memcpy(&lun->mode_pages.index, page_index_template, sizeof(page_index_template)); - softc = lun->ctl_softc; - for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { page_index = &lun->mode_pages.index[i]; @@ -4177,6 +4237,25 @@ ctl_init_page_index(struct ctl_lun *lun) continue; switch (page_index->page_code & SMPH_PC_MASK) { + case SMS_RW_ERROR_RECOVERY_PAGE: { + if (page_index->subpage != SMS_SUBPAGE_PAGE_0) + panic("subpage is incorrect!"); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT], + &rw_er_page_default, + sizeof(rw_er_page_default)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_CHANGEABLE], + &rw_er_page_changeable, + sizeof(rw_er_page_changeable)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_DEFAULT], + &rw_er_page_default, + sizeof(rw_er_page_default)); + memcpy(&lun->mode_pages.rw_er_page[CTL_PAGE_SAVED], + &rw_er_page_default, + sizeof(rw_er_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.rw_er_page; + break; + } case SMS_FORMAT_DEVICE_PAGE: { struct scsi_format_page *format_page; @@ -4366,6 +4445,42 @@ ctl_init_page_index(struct ctl_lun *lun) break; } + case SMS_INFO_EXCEPTIONS_PAGE: { + switch (page_index->subpage) { + case SMS_SUBPAGE_PAGE_0: + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_CURRENT], + &ie_page_default, + sizeof(ie_page_default)); + memcpy(&lun->mode_pages.ie_page[ + CTL_PAGE_CHANGEABLE], &ie_page_changeable, + sizeof(ie_page_changeable)); + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_DEFAULT], + &ie_page_default, + sizeof(ie_page_default)); + memcpy(&lun->mode_pages.ie_page[CTL_PAGE_SAVED], + &ie_page_default, + sizeof(ie_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.ie_page; + break; + case 0x02: + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_CURRENT], + &lbp_page_default, + sizeof(lbp_page_default)); + memcpy(&lun->mode_pages.lbp_page[ + CTL_PAGE_CHANGEABLE], &lbp_page_changeable, + sizeof(lbp_page_changeable)); + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_DEFAULT], + &lbp_page_default, + sizeof(lbp_page_default)); + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_SAVED], + &lbp_page_default, + sizeof(lbp_page_default)); + page_index->page_data = + (uint8_t *)lun->mode_pages.lbp_page; + } + break; + } case SMS_VENDOR_SPECIFIC_PAGE:{ switch (page_index->subpage) { case PWR_SUBPAGE_CODE: { @@ -4489,6 +4604,45 @@ ctl_init_page_index(struct ctl_lun *lun) return (CTL_RETVAL_COMPLETE); } +static int +ctl_init_log_page_index(struct ctl_lun *lun) +{ + struct ctl_page_index *page_index; + int i, j, prev; + + memcpy(&lun->log_pages.index, log_page_index_template, + sizeof(log_page_index_template)); + + prev = -1; + for (i = 0, j = 0; i < CTL_NUM_LOG_PAGES; i++) { + + page_index = &lun->log_pages.index[i]; + /* + * If this is a disk-only mode page, there's no point in + * setting it up. For some pages, we have to have some + * basic information about the disk in order to calculate the + * mode page data. + */ + if ((lun->be_lun->lun_type != T_DIRECT) + && (page_index->page_flags & CTL_PAGE_FLAG_DISK_ONLY)) + continue; + + if (page_index->page_code != prev) { + lun->log_pages.pages_page[j] = page_index->page_code; + prev = page_index->page_code; + j++; + } + lun->log_pages.subpages_page[i*2] = page_index->page_code; + lun->log_pages.subpages_page[i*2+1] = page_index->subpage; + } + lun->log_pages.index[0].page_data = &lun->log_pages.pages_page[0]; + lun->log_pages.index[0].page_len = j; + lun->log_pages.index[1].page_data = &lun->log_pages.subpages_page[0]; + lun->log_pages.index[1].page_len = i * 2; + + return (CTL_RETVAL_COMPLETE); +} + /* * LUN allocation. * @@ -4684,9 +4838,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_tpc_lun_init(lun); /* - * Initialize the mode page index. + * Initialize the mode and log page index. */ ctl_init_page_index(lun); + ctl_init_log_page_index(lun); /* * Set the poweron UA for all initiators on this LUN only. @@ -7270,6 +7425,91 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } int +ctl_log_sense(struct ctl_scsiio *ctsio) +{ + struct ctl_lun *lun; + int i, pc, page_code, subpage; + int alloc_len, total_len; + struct ctl_page_index *page_index; + struct scsi_log_sense *cdb; + struct scsi_log_header *header; + + CTL_DEBUG_PRINT(("ctl_log_sense\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_log_sense *)ctsio->cdb; + pc = (cdb->page & SLS_PAGE_CTRL_MASK) >> 6; + page_code = cdb->page & SLS_PAGE_CODE; + subpage = cdb->subpage; + alloc_len = scsi_2btoul(cdb->length); + + page_index = NULL; + for (i = 0; i < CTL_NUM_LOG_PAGES; i++) { + page_index = &lun->log_pages.index[i]; + + /* Look for the right page code */ + if ((page_index->page_code & SL_PAGE_CODE) != page_code) + continue; + + /* Look for the right subpage or the subpage wildcard*/ + if (page_index->subpage != subpage) + continue; + + break; + } + if (i >= CTL_NUM_LOG_PAGES) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 2, + /*bit_valid*/ 0, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + total_len = sizeof(struct scsi_log_header) + page_index->page_len; + + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + ctsio->kern_sg_entries = 0; + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + + header = (struct scsi_log_header *)ctsio->kern_data_ptr; + header->page = page_index->page_code; + if (page_index->subpage) { + header->page |= SL_SPF; + header->subpage = page_index->subpage; + } + scsi_ulto2b(page_index->page_len, header->datalen); + + /* + * Call the handler, if it exists, to update the + * page to the latest values. + */ + if (page_index->sense_handler != NULL) + page_index->sense_handler(ctsio, page_index, pc); + + memcpy(header + 1, page_index->page_data, page_index->page_len); + + ctsio->scsi_status = SCSI_STATUS_OK; + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + + return (CTL_RETVAL_COMPLETE); +} + +int ctl_read_capacity(struct ctl_scsiio *ctsio) { struct scsi_read_capacity *cdb; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 2 17:28:08 2014 (r273977) @@ -850,7 +850,10 @@ const struct ctl_cmd_entry ctl_cmd_table {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, /* 4D LOG SENSE */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_log_sense, CTL_SERIDX_LOG_SNS, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, 10, {0, 0xff, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0x07} }, /* 4E STOP PLAY/SCAN */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:08 2014 (r273977) @@ -302,6 +302,8 @@ struct ctl_page_index { #define CTL_PAGE_SAVED 0x03 static const struct ctl_page_index page_index_template[] = { + {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, + CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_FORMAT_DEVICE_PAGE, 0, sizeof(struct scsi_format_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_RIGID_DISK_PAGE, 0, sizeof(struct scsi_rigid_disk_page), NULL, @@ -310,6 +312,11 @@ static const struct ctl_page_index page_ CTL_PAGE_FLAG_DISK_ONLY, NULL, ctl_caching_sp_handler}, {SMS_CONTROL_MODE_PAGE, 0, sizeof(struct scsi_control_page), NULL, CTL_PAGE_FLAG_NONE, NULL, ctl_control_page_handler}, + {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, + {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, + sizeof(struct scsi_logical_block_provisioning_page), NULL, + CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, PWR_SUBPAGE_CODE, sizeof(struct copan_power_subpage), NULL, CTL_PAGE_FLAG_NONE, ctl_power_sp_sense_handler, ctl_power_sp_handler}, @@ -325,16 +332,35 @@ static const struct ctl_page_index page_ sizeof(page_index_template[0]) struct ctl_mode_pages { + struct scsi_da_rw_recovery_page rw_er_page[4]; struct scsi_format_page format_page[4]; struct scsi_rigid_disk_page rigid_disk_page[4]; struct scsi_caching_page caching_page[4]; struct scsi_control_page control_page[4]; + struct scsi_info_exceptions_page ie_page[4]; + struct scsi_logical_block_provisioning_page lbp_page[4]; struct copan_power_subpage power_subpage[4]; struct copan_aps_subpage aps_subpage[4]; struct copan_debugconf_subpage debugconf_subpage[4]; struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; +static const struct ctl_page_index log_page_index_template[] = { + {SLS_SUPPORTED_PAGES_PAGE, 0, 0, NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, + {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, + CTL_PAGE_FLAG_NONE, NULL, NULL}, +}; + +#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ + sizeof(log_page_index_template[0]) + +struct ctl_log_pages { + uint8_t pages_page[CTL_NUM_LOG_PAGES]; + uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; + struct ctl_page_index index[CTL_NUM_LOG_PAGES]; +}; + struct ctl_lun_delay_info { ctl_delay_type datamove_type; uint32_t datamove_delay; @@ -391,6 +417,7 @@ struct ctl_lun { #endif ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; struct ctl_mode_pages mode_pages; + struct ctl_log_pages log_pages; struct ctl_lun_io_stats stats; uint32_t res_idx; unsigned int PRGeneration; @@ -482,6 +509,7 @@ int ctl_write_same(struct ctl_scsiio *ct int ctl_unmap(struct ctl_scsiio *ctsio); int ctl_mode_select(struct ctl_scsiio *ctsio); int ctl_mode_sense(struct ctl_scsiio *ctsio); +int ctl_log_sense(struct ctl_scsiio *ctsio); int ctl_read_capacity(struct ctl_scsiio *ctsio); int ctl_read_capacity_16(struct ctl_scsiio *ctsio); int ctl_read_defect(struct ctl_scsiio *ctsio); Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:26:13 2014 (r273976) +++ stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:08 2014 (r273977) @@ -551,7 +551,7 @@ struct scsi_log_sense #define SLS_PPC 0x02 u_int8_t page; #define SLS_PAGE_CODE 0x3F -#define SLS_ALL_PAGES_PAGE 0x00 +#define SLS_SUPPORTED_PAGES_PAGE 0x00 #define SLS_OVERRUN_PAGE 0x01 #define SLS_ERROR_WRITE_PAGE 0x02 #define SLS_ERROR_READ_PAGE 0x03 @@ -566,7 +566,9 @@ struct scsi_log_sense #define SLS_PAGE_CTRL_CUMULATIVE 0x40 #define SLS_PAGE_CTRL_THRESH_DEFAULT 0x80 #define SLS_PAGE_CTRL_CUMUL_DEFAULT 0xC0 - u_int8_t reserved[2]; + u_int8_t subpage; +#define SLS_SUPPORTED_SUBPAGES_SUBPAGE 0xff + u_int8_t reserved; u_int8_t paramptr[2]; u_int8_t length[2]; u_int8_t control; @@ -592,7 +594,10 @@ struct scsi_log_select struct scsi_log_header { u_int8_t page; - u_int8_t reserved; +#define SL_PAGE_CODE 0x3F +#define SL_SPF 0x40 +#define SL_DS 0x80 + u_int8_t subpage; u_int8_t datalen[2]; }; @@ -767,6 +772,23 @@ struct scsi_info_exceptions_page { u_int8_t report_count[4]; }; +struct scsi_logical_block_provisioning_page_descr { + uint8_t flags; + uint8_t resource; + uint8_t reserved[2]; + uint8_t count[4]; +}; + +struct scsi_logical_block_provisioning_page { + uint8_t page_code; + uint8_t subpage_code; + uint8_t page_length[2]; + uint8_t flags; +#define SLBPP_SITUA 0x01 + uint8_t reserved[11]; + struct scsi_logical_block_provisioning_page_descr descr[0]; +}; + /* * SCSI protocol identifier values, current as of SPC4r36l. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:28:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6237D4E2; Sun, 2 Nov 2014 17:28:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE55CBD; Sun, 2 Nov 2014 17:28:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HSkeD028534; Sun, 2 Nov 2014 17:28:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HSiPm028528; Sun, 2 Nov 2014 17:28:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021728.sA2HSiPm028528@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:28: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: r273978 - in stable/10/sys/cam: ctl scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:28:46 -0000 Author: mav Date: Sun Nov 2 17:28:44 2014 New Revision: 273978 URL: https://svnweb.freebsd.org/changeset/base/273978 Log: MFC r273075: Remove couple Copan's vendor-specific mode pages. Those pages are highly system-/hardware-specific, the code is incomplete, and so they hardly can be useful for anybody else. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_backend.h stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:44 2014 (r273978) @@ -109,56 +109,6 @@ struct ctl_softc *control_softc = NULL; * Note that these are default values only. The actual values will be * filled in when the user does a mode sense. */ -static struct copan_power_subpage power_page_default = { - /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, - /*subpage*/ PWR_SUBPAGE_CODE, - /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, - (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, - /*page_version*/ PWR_VERSION, - /* total_luns */ 26, - /* max_active_luns*/ PWR_DFLT_MAX_LUNS, - /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0} -}; - -static struct copan_power_subpage power_page_changeable = { - /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, - /*subpage*/ PWR_SUBPAGE_CODE, - /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, - (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, - /*page_version*/ 0, - /* total_luns */ 0, - /* max_active_luns*/ 0, - /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0} -}; - -static struct copan_aps_subpage aps_page_default = { - APS_PAGE_CODE | SMPH_SPF, //page_code - APS_SUBPAGE_CODE, //subpage - {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, - (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length - APS_VERSION, //page_version - 0, //lock_active - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0} //reserved -}; - -static struct copan_aps_subpage aps_page_changeable = { - APS_PAGE_CODE | SMPH_SPF, //page_code - APS_SUBPAGE_CODE, //subpage - {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, - (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length - 0, //page_version - 0, //lock_active - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0} //reserved -}; - static struct copan_debugconf_subpage debugconf_page_default = { DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ DBGCNF_SUBPAGE_CODE, /* subpage */ @@ -371,7 +321,6 @@ static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; static int ctl_is_single = 1; -static int index_to_aps_page; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; @@ -951,26 +900,6 @@ ctl_isc_event_handler(ctl_ha_channel cha case CTL_MSG_SYNC_FE: rcv_sync_msg = 1; break; - case CTL_MSG_APS_LOCK: { - // It's quicker to execute this then to - // queue it. - struct ctl_lun *lun; - struct ctl_page_index *page_index; - struct copan_aps_subpage *current_sp; - uint32_t targ_lun; - - targ_lun = msg_info.hdr.nexus.targ_mapped_lun; - lun = ctl_softc->ctl_luns[targ_lun]; - mtx_lock(&lun->lun_lock); - page_index = &lun->mode_pages.index[index_to_aps_page]; - current_sp = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - - current_sp->lock_active = msg_info.aps.lock_flag; - mtx_unlock(&lun->lun_lock); - break; - } default: printf("How did I get here?\n"); } @@ -4059,156 +3988,6 @@ ctl_copy_io(union ctl_io *src, union ctl dest->io_hdr.flags |= CTL_FLAG_INT_COPY; } -#ifdef NEEDTOPORT -static void -ctl_update_power_subpage(struct copan_power_subpage *page) -{ - int num_luns, num_partitions, config_type; - struct ctl_softc *softc; - cs_BOOL_t aor_present, shelf_50pct_power; - cs_raidset_personality_t rs_type; - int max_active_luns; - - softc = control_softc; - - /* subtract out the processor LUN */ - num_luns = softc->num_luns - 1; - /* - * Default to 7 LUNs active, which was the only number we allowed - * in the past. - */ - max_active_luns = 7; - - num_partitions = config_GetRsPartitionInfo(); - config_type = config_GetConfigType(); - shelf_50pct_power = config_GetShelfPowerMode(); - aor_present = config_IsAorRsPresent(); - - rs_type = ddb_GetRsRaidType(1); - if ((rs_type != CS_RAIDSET_PERSONALITY_RAID5) - && (rs_type != CS_RAIDSET_PERSONALITY_RAID1)) { - EPRINT(0, "Unsupported RS type %d!", rs_type); - } - - - page->total_luns = num_luns; - - switch (config_type) { - case 40: - /* - * In a 40 drive configuration, it doesn't matter what DC - * cards we have, whether we have AOR enabled or not, - * partitioning or not, or what type of RAIDset we have. - * In that scenario, we can power up every LUN we present - * to the user. - */ - max_active_luns = num_luns; - - break; - case 64: - if (shelf_50pct_power == CS_FALSE) { - /* 25% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 7; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 14; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 8; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 16; - } else { - /* XXX KDM now what?? */ - } - } - } else { - /* 50% power */ - /* - * With 50% power in a 64 drive configuration, we - * can power all LUNs we present. - */ - max_active_luns = num_luns; - } - break; - case 112: - if (shelf_50pct_power == CS_FALSE) { - /* 25% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 7; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 14; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 8; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 16; - } else { - /* XXX KDM now what?? */ - } - } - } else { - /* 50% power */ - if (aor_present == CS_TRUE) { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 14; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - /* - * We're assuming here that disk - * caching is enabled, and so we're - * able to power up half of each - * LUN, and cache all writes. - */ - max_active_luns = num_luns; - } else { - /* XXX KDM now what?? */ - } - } else { - if (rs_type == - CS_RAIDSET_PERSONALITY_RAID5) { - max_active_luns = 15; - } else if (rs_type == - CS_RAIDSET_PERSONALITY_RAID1){ - max_active_luns = 30; - } else { - /* XXX KDM now what?? */ - } - } - } - break; - default: - /* - * In this case, we have an unknown configuration, so we - * just use the default from above. - */ - break; - } - - page->max_active_luns = max_active_luns; -#if 0 - printk("%s: total_luns = %d, max_active_luns = %d\n", __func__, - page->total_luns, page->max_active_luns); -#endif -} -#endif /* NEEDTOPORT */ - /* * This routine could be used in the future to load default and/or saved * mode page parameters for a particuar lun. @@ -4483,77 +4262,6 @@ ctl_init_page_index(struct ctl_lun *lun) } case SMS_VENDOR_SPECIFIC_PAGE:{ switch (page_index->subpage) { - case PWR_SUBPAGE_CODE: { - struct copan_power_subpage *current_page, - *saved_page; - - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_CURRENT], - &power_page_default, - sizeof(power_page_default)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_CHANGEABLE], - &power_page_changeable, - sizeof(power_page_changeable)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_DEFAULT], - &power_page_default, - sizeof(power_page_default)); - memcpy(&lun->mode_pages.power_subpage[ - CTL_PAGE_SAVED], - &power_page_default, - sizeof(power_page_default)); - page_index->page_data = - (uint8_t *)lun->mode_pages.power_subpage; - - current_page = (struct copan_power_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_CURRENT)); - saved_page = (struct copan_power_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_SAVED)); - break; - } - case APS_SUBPAGE_CODE: { - struct copan_aps_subpage *current_page, - *saved_page; - - // This gets set multiple times but - // it should always be the same. It's - // only done during init so who cares. - index_to_aps_page = i; - - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_CURRENT], - &aps_page_default, - sizeof(aps_page_default)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_CHANGEABLE], - &aps_page_changeable, - sizeof(aps_page_changeable)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_DEFAULT], - &aps_page_default, - sizeof(aps_page_default)); - memcpy(&lun->mode_pages.aps_subpage[ - CTL_PAGE_SAVED], - &aps_page_default, - sizeof(aps_page_default)); - page_index->page_data = - (uint8_t *)lun->mode_pages.aps_subpage; - - current_page = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_CURRENT)); - saved_page = (struct copan_aps_subpage *) - (page_index->page_data + - (page_index->page_len * - CTL_PAGE_SAVED)); - break; - } case DBGCNF_SUBPAGE_CODE: { struct copan_debugconf_subpage *current_page, *saved_page; @@ -5272,95 +4980,6 @@ ctl_lun_operable(struct ctl_be_lun *be_l return (0); } -int -ctl_lun_power_lock(struct ctl_be_lun *be_lun, struct ctl_nexus *nexus, - int lock) -{ - struct ctl_softc *softc; - struct ctl_lun *lun; - struct copan_aps_subpage *current_sp; - struct ctl_page_index *page_index; - int i; - - softc = control_softc; - - mtx_lock(&softc->ctl_lock); - - lun = (struct ctl_lun *)be_lun->ctl_lun; - mtx_lock(&lun->lun_lock); - - page_index = NULL; - for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { - if ((lun->mode_pages.index[i].page_code & SMPH_PC_MASK) != - APS_PAGE_CODE) - continue; - - if (lun->mode_pages.index[i].subpage != APS_SUBPAGE_CODE) - continue; - page_index = &lun->mode_pages.index[i]; - } - - if (page_index == NULL) { - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - printf("%s: APS subpage not found for lun %ju!\n", __func__, - (uintmax_t)lun->lun); - return (1); - } -#if 0 - if ((softc->aps_locked_lun != 0) - && (softc->aps_locked_lun != lun->lun)) { - printf("%s: attempt to lock LUN %llu when %llu is already " - "locked\n"); - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (1); - } -#endif - - current_sp = (struct copan_aps_subpage *)(page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - - if (lock != 0) { - current_sp->lock_active = APS_LOCK_ACTIVE; - softc->aps_locked_lun = lun->lun; - } else { - current_sp->lock_active = 0; - softc->aps_locked_lun = 0; - } - - - /* - * If we're in HA mode, try to send the lock message to the other - * side. - */ - if (ctl_is_single == 0) { - int isc_retval; - union ctl_ha_msg lock_msg; - - lock_msg.hdr.nexus = *nexus; - lock_msg.hdr.msg_type = CTL_MSG_APS_LOCK; - if (lock != 0) - lock_msg.aps.lock_flag = 1; - else - lock_msg.aps.lock_flag = 0; - isc_retval = ctl_ha_msg_send(CTL_HA_CHAN_CTL, &lock_msg, - sizeof(lock_msg), 0); - if (isc_retval > CTL_HA_STATUS_SUCCESS) { - printf("%s: APS (lock=%d) error returned from " - "ctl_ha_msg_send: %d\n", __func__, lock, isc_retval); - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (1); - } - } - - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - - return (0); -} - void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) { @@ -6519,121 +6138,6 @@ ctl_caching_sp_handler(struct ctl_scsiio } int -ctl_power_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr) -{ - return (0); -} - -int -ctl_power_sp_sense_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, int pc) -{ - struct copan_power_subpage *page; - - page = (struct copan_power_subpage *)page_index->page_data + - (page_index->page_len * pc); - - switch (pc) { - case SMS_PAGE_CTRL_CHANGEABLE >> 6: - /* - * We don't update the changable bits for this page. - */ - break; - case SMS_PAGE_CTRL_CURRENT >> 6: - case SMS_PAGE_CTRL_DEFAULT >> 6: - case SMS_PAGE_CTRL_SAVED >> 6: -#ifdef NEEDTOPORT - ctl_update_power_subpage(page); -#endif - break; - default: -#ifdef NEEDTOPORT - EPRINT(0, "Invalid PC %d!!", pc); -#endif - break; - } - return (0); -} - - -int -ctl_aps_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr) -{ - struct copan_aps_subpage *user_sp; - struct copan_aps_subpage *current_sp; - union ctl_modepage_info *modepage_info; - struct ctl_softc *softc; - struct ctl_lun *lun; - int retval; - - retval = CTL_RETVAL_COMPLETE; - current_sp = (struct copan_aps_subpage *)(page_index->page_data + - (page_index->page_len * CTL_PAGE_CURRENT)); - softc = control_softc; - lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - - user_sp = (struct copan_aps_subpage *)page_ptr; - - modepage_info = (union ctl_modepage_info *) - ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes; - - modepage_info->header.page_code = page_index->page_code & SMPH_PC_MASK; - modepage_info->header.subpage = page_index->subpage; - modepage_info->aps.lock_active = user_sp->lock_active; - - mtx_lock(&softc->ctl_lock); - - /* - * If there is a request to lock the LUN and another LUN is locked - * this is an error. If the requested LUN is already locked ignore - * the request. If no LUN is locked attempt to lock it. - * if there is a request to unlock the LUN and the LUN is currently - * locked attempt to unlock it. Otherwise ignore the request. i.e. - * if another LUN is locked or no LUN is locked. - */ - if (user_sp->lock_active & APS_LOCK_ACTIVE) { - if (softc->aps_locked_lun == lun->lun) { - /* - * This LUN is already locked, so we're done. - */ - retval = CTL_RETVAL_COMPLETE; - } else if (softc->aps_locked_lun == 0) { - /* - * No one has the lock, pass the request to the - * backend. - */ - retval = lun->backend->config_write( - (union ctl_io *)ctsio); - } else { - /* - * Someone else has the lock, throw out the request. - */ - ctl_set_already_locked(ctsio); - free(ctsio->kern_data_ptr, M_CTL); - ctl_done((union ctl_io *)ctsio); - - /* - * Set the return value so that ctl_do_mode_select() - * won't try to complete the command. We already - * completed it here. - */ - retval = CTL_RETVAL_ERROR; - } - } else if (softc->aps_locked_lun == lun->lun) { - /* - * This LUN is locked, so pass the unlock request to the - * backend. - */ - retval = lun->backend->config_write((union ctl_io *)ctsio); - } - mtx_unlock(&softc->ctl_lock); - - return (retval); -} - -int ctl_debugconf_sp_select_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr) Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:28:44 2014 (r273978) @@ -172,12 +172,6 @@ int ctl_failover_sp_handler(struct ctl_s struct ctl_page_index *page_index, uint8_t *page_ptr); **/ -int ctl_power_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr); -int ctl_power_sp_sense_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, int pc); -int ctl_aps_sp_handler(struct ctl_scsiio *ctsio, - struct ctl_page_index *page_index, uint8_t *page_ptr); int ctl_debugconf_sp_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc); Modified: stable/10/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_backend.h Sun Nov 2 17:28:44 2014 (r273978) @@ -280,14 +280,6 @@ int ctl_lun_inoperable(struct ctl_be_lun int ctl_lun_operable(struct ctl_be_lun *be_lun); /* - * If a LUN is locked on or unlocked from a power/APS standpoint, call - * ctl_lun_power_lock() to update the current status in CTL's APS subpage. - * Set the lock flag to 1 to lock the LUN, set it to 0 to unlock the LUN. - */ -int ctl_lun_power_lock(struct ctl_be_lun *be_lun, struct ctl_nexus *nexus, - int lock); - -/* * To take a LUN offline, call ctl_lun_offline(). Generally the LUN will * be online again once the user sends a SCSI START STOP UNIT command with * the start and on/offline bits set. The backend can bring the LUN back Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_io.h Sun Nov 2 17:28:44 2014 (r273978) @@ -234,7 +234,6 @@ typedef enum { CTL_MSG_MANAGE_TASKS, CTL_MSG_PERS_ACTION, CTL_MSG_SYNC_FE, - CTL_MSG_APS_LOCK, CTL_MSG_DATAMOVE, CTL_MSG_DATAMOVE_DONE } ctl_msg_type; @@ -424,14 +423,6 @@ struct ctl_ha_msg_hdr { #define CTL_HA_MAX_SG_ENTRIES 16 /* - * Used for CTL_MSG_APS_LOCK. - */ -struct ctl_ha_msg_aps { - struct ctl_ha_msg_hdr hdr; - uint8_t lock_flag; -}; - -/* * Used for CTL_MSG_PERS_ACTION. */ struct ctl_ha_msg_pr { @@ -500,7 +491,6 @@ union ctl_ha_msg { struct ctl_ha_msg_scsi scsi; struct ctl_ha_msg_dt dt; struct ctl_ha_msg_pr pr; - struct ctl_ha_msg_aps aps; }; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/ctl/ctl_private.h Sun Nov 2 17:28:44 2014 (r273978) @@ -317,12 +317,6 @@ static const struct ctl_page_index page_ {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, sizeof(struct scsi_logical_block_provisioning_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, - {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, PWR_SUBPAGE_CODE, - sizeof(struct copan_power_subpage), NULL, CTL_PAGE_FLAG_NONE, - ctl_power_sp_sense_handler, ctl_power_sp_handler}, - {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, APS_SUBPAGE_CODE, - sizeof(struct copan_aps_subpage), NULL, CTL_PAGE_FLAG_NONE, - NULL, ctl_aps_sp_handler}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, ctl_debugconf_sp_sense_handler, ctl_debugconf_sp_select_handler}, @@ -339,8 +333,6 @@ struct ctl_mode_pages { struct scsi_control_page control_page[4]; struct scsi_info_exceptions_page ie_page[4]; struct scsi_logical_block_provisioning_page lbp_page[4]; - struct copan_power_subpage power_subpage[4]; - struct copan_aps_subpage aps_subpage[4]; struct copan_debugconf_subpage debugconf_subpage[4]; struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; @@ -469,7 +461,6 @@ struct ctl_softc { uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; struct ctl_lun *ctl_luns[CTL_MAX_LUNS]; uint32_t ctl_port_mask[(CTL_MAX_PORTS + 31) / 32]; - uint64_t aps_locked_lun; STAILQ_HEAD(, ctl_lun) lun_list; STAILQ_HEAD(, ctl_be_lun) pending_lun_queue; uint32_t num_frontends; Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:08 2014 (r273977) +++ stable/10/sys/cam/scsi/scsi_all.h Sun Nov 2 17:28:44 2014 (r273978) @@ -709,40 +709,6 @@ struct scsi_caching_page { /* * XXX KDM move this off to a vendor shim. */ -struct copan_power_subpage { - uint8_t page_code; -#define PWR_PAGE_CODE 0x00 - uint8_t subpage; -#define PWR_SUBPAGE_CODE 0x02 - uint8_t page_length[2]; - uint8_t page_version; -#define PWR_VERSION 0x01 - uint8_t total_luns; - uint8_t max_active_luns; -#define PWR_DFLT_MAX_LUNS 0x07 - uint8_t reserved[25]; -}; - -/* - * XXX KDM move this off to a vendor shim. - */ -struct copan_aps_subpage { - uint8_t page_code; -#define APS_PAGE_CODE 0x00 - uint8_t subpage; -#define APS_SUBPAGE_CODE 0x03 - uint8_t page_length[2]; - uint8_t page_version; -#define APS_VERSION 0x00 - uint8_t lock_active; -#define APS_LOCK_ACTIVE 0x01 -#define APS_LOCK_INACTIVE 0x00 - uint8_t reserved[26]; -}; - -/* - * XXX KDM move this off to a vendor shim. - */ struct copan_debugconf_subpage { uint8_t page_code; #define DBGCNF_PAGE_CODE 0x00 From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:29:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2405613; Sun, 2 Nov 2014 17:29:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C355FCC2; Sun, 2 Nov 2014 17:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HTmbY028724; Sun, 2 Nov 2014 17:29:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HTm02028723; Sun, 2 Nov 2014 17:29:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021729.sA2HTm02028723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:29:48 +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: r273979 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:29:49 -0000 Author: mav Date: Sun Nov 2 17:29:48 2014 New Revision: 273979 URL: https://svnweb.freebsd.org/changeset/base/273979 Log: MFC r273640: Add support for 12/16-byte EUI and 16-byte NAA IDs. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:28:44 2014 (r273978) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:29:48 2014 (r273979) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -4351,6 +4352,36 @@ ctl_init_log_page_index(struct ctl_lun * return (CTL_RETVAL_COMPLETE); } +static int +hex2bin(const char *str, uint8_t *buf, int buf_size) +{ + int i; + u_char c; + + memset(buf, 0, buf_size); + while (isspace(str[0])) + str++; + if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) + str += 2; + buf_size *= 2; + for (i = 0; str[i] != 0 && i < buf_size; i++) { + c = str[i]; + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= 16) + break; + if ((i & 1) == 0) + buf[i / 2] |= (c << 4); + else + buf[i / 2] |= c; + } + return ((i + 1) / 2); +} + /* * LUN allocation. * @@ -4416,15 +4447,14 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } eui = ctl_get_opt(&be_lun->options, "eui"); if (eui != NULL) { - len += sizeof(struct scsi_vpd_id_descriptor) + 8; + len += sizeof(struct scsi_vpd_id_descriptor) + 16; } naa = ctl_get_opt(&be_lun->options, "naa"); if (naa != NULL) { - len += sizeof(struct scsi_vpd_id_descriptor) + 8; + len += sizeof(struct scsi_vpd_id_descriptor) + 16; } lun->lun_devid = malloc(sizeof(struct ctl_devid) + len, M_CTL, M_WAITOK | M_ZERO); - lun->lun_devid->len = len; desc = (struct scsi_vpd_id_descriptor *)lun->lun_devid->data; desc->proto_codeset = SVPD_ID_CODESET_ASCII; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10; @@ -4454,8 +4484,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft desc->proto_codeset = SVPD_ID_CODESET_BINARY; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_EUI64; - desc->length = 8; - scsi_u64to8b(strtouq(eui, NULL, 0), desc->identifier); + desc->length = hex2bin(eui, desc->identifier, 16); + desc->length = desc->length > 12 ? 16 : + (desc->length > 8 ? 12 : 8); + len -= 16 - desc->length; } if (naa != NULL) { desc = (struct scsi_vpd_id_descriptor *)(&desc->identifier[0] + @@ -4463,9 +4495,11 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft desc->proto_codeset = SVPD_ID_CODESET_BINARY; desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_NAA; - desc->length = 8; - scsi_u64to8b(strtouq(naa, NULL, 0), desc->identifier); + desc->length = hex2bin(naa, desc->identifier, 16); + desc->length = desc->length > 8 ? 16 : 8; + len -= 16 - desc->length; } + lun->lun_devid->len = len; mtx_lock(&ctl_softc->ctl_lock); /* From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:30:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3A5B74B; Sun, 2 Nov 2014 17:30:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C507ACCB; Sun, 2 Nov 2014 17:30:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HUVIg028992; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HUV30028990; Sun, 2 Nov 2014 17:30:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021730.sA2HUV30028990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:30: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: r273980 - in stable/10: sys/cam/ctl usr.sbin/ctladm 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:30:32 -0000 Author: mav Date: Sun Nov 2 17:30:30 2014 New Revision: 273980 URL: https://svnweb.freebsd.org/changeset/base/273980 Log: MFC r273687: Add "rpm" and "formfactor" LUN options to match istgt functionality. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:30:30 2014 (r273980) @@ -10209,6 +10209,8 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * { struct scsi_vpd_block_device_characteristics *bdc_ptr; struct ctl_lun *lun; + const char *value; + u_int i; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; @@ -10241,7 +10243,18 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * bdc_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; bdc_ptr->page_code = SVPD_BDC; scsi_ulto2b(sizeof(*bdc_ptr) - 4, bdc_ptr->page_length); - scsi_ulto2b(SVPD_NON_ROTATING, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) + i = strtol(value, NULL, 0); + else + i = SVPD_NON_ROTATING; + scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); + if (lun != NULL && + (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) + i = strtol(value, NULL, 0); + else + i = 0; + bdc_ptr->wab_wac_ff = (i & 0x0f); bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; ctsio->scsi_status = SCSI_STATUS_OK; Modified: stable/10/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:29:48 2014 (r273979) +++ stable/10/usr.sbin/ctladm/ctladm.8 Sun Nov 2 17:30:30 2014 (r273980) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 12, 2014 +.Dd October 26, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,12 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va rpm +Specifies medium rotation rate of the device: 0 -- not reported, +1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. +.It Va formfactor +Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", +2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. .It Va writecache From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:31:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6067C87D; Sun, 2 Nov 2014 17:31:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32815CCE; Sun, 2 Nov 2014 17:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HVBRL029603; Sun, 2 Nov 2014 17:31:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HVAqZ029600; Sun, 2 Nov 2014 17:31:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021731.sA2HVAqZ029600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:31: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: r273981 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:31:11 -0000 Author: mav Date: Sun Nov 2 17:31:10 2014 New Revision: 273981 URL: https://svnweb.freebsd.org/changeset/base/273981 Log: MFC r273693: Fix printing non-terminated strings in devlist XML. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:30:30 2014 (r273980) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:10 2014 (r273981) @@ -2202,13 +2202,14 @@ ctl_copyout_args(int num_args, struct ct * Escape characters that are illegal or not recommended in XML. */ int -ctl_sbuf_printf_esc(struct sbuf *sb, char *str) +ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size) { + char *end = str + size; int retval; retval = 0; - for (; *str; str++) { + for (; *str && str < end; str++) { switch (*str) { case '&': retval = sbuf_printf(sb, "&"); @@ -3200,7 +3201,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; retval = ctl_sbuf_printf_esc(sb, - lun->be_lun->serial_num); + lun->be_lun->serial_num, + sizeof(lun->be_lun->serial_num)); if (retval != 0) break; @@ -3215,7 +3217,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (retval != 0) break; - retval = ctl_sbuf_printf_esc(sb,lun->be_lun->device_id); + retval = ctl_sbuf_printf_esc(sb, + lun->be_lun->device_id, + sizeof(lun->be_lun->device_id)); if (retval != 0) break; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:30:30 2014 (r273980) +++ stable/10/sys/cam/ctl/ctl.h Sun Nov 2 17:31:10 2014 (r273981) @@ -156,7 +156,7 @@ int ctl_port_list(struct ctl_port_entry * Put a string into an sbuf, escaping characters that are illegal or not * recommended in XML. Note this doesn't escape everything, just > < and &. */ -int ctl_sbuf_printf_esc(struct sbuf *sb, char *str); +int ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size); int ctl_ffz(uint32_t *mask, uint32_t size); int ctl_set_mask(uint32_t *mask, uint32_t bit); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:31:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED3CB9B0; Sun, 2 Nov 2014 17:31:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D85D3CDA; Sun, 2 Nov 2014 17:31:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2HVjko032012; Sun, 2 Nov 2014 17:31:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2HVjwn032011; Sun, 2 Nov 2014 17:31:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411021731.sA2HVjwn032011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 2 Nov 2014 17:31:45 +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: r273982 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:31:46 -0000 Author: mav Date: Sun Nov 2 17:31:45 2014 New Revision: 273982 URL: https://svnweb.freebsd.org/changeset/base/273982 Log: MFC r273708: Fix support for LUN flat space addressing. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:10 2014 (r273981) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:45 2014 (r273982) @@ -9405,17 +9405,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio * Flat addressing method. */ lun_data->luns[num_filled].lundata[0] = - RPL_LUNDATA_ATYP_FLAT | - (targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK); -#ifdef OLDCTLHEADERS - (SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) | - (targ_lun_id & SRLD_BUS_LUN_MASK); -#endif + RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8); lun_data->luns[num_filled].lundata[1] = -#ifdef OLDCTLHEADERS - targ_lun_id >> SRLD_BUS_LUN_BITS; -#endif - targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS; + (targ_lun_id & 0xff); + num_filled++; + } else if (targ_lun_id <= 0xffffff) { + /* + * Extended flat addressing method. + */ + lun_data->luns[num_filled].lundata[0] = + RPL_LUNDATA_ATYP_EXTLUN | 0x12; + scsi_ulto3b(targ_lun_id, + &lun_data->luns[num_filled].lundata[1]); num_filled++; } else { printf("ctl_report_luns: bogus LUN number %jd, " From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:50:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA531E46; Sun, 2 Nov 2014 17:50:05 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BAF0E6B; Sun, 2 Nov 2014 17:50:05 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2HnxC8093868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 19:49:59 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2HnxC8093868 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2HnxdL093867; Sun, 2 Nov 2014 19:49:59 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 19:49:59 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102174958.GZ53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:50:06 -0000 On Sun, Nov 02, 2014 at 06:07:20PM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 5:59 PM, Konstantin Belousov wrote: > > It is easy and cheap to record the set of the owned lockmgr locks for > > current thread. I do not believe that we have a situation where more > > than 3 locks are held in one time. To give it some slack, we can record > > 8 locks shared-owned and do the check for recursion in LK_CAN_SHARE(). > > If the thread-locks table overflows, we could either panic() or fall > > back to indiscriminative deadlock avoidance (i.e. relying on the sole > > td_lk_slocks value). > > I don't think it is going to be cheap (and certainly it is not viable > for things like sx locks and rwlocks). sx and rw do not implement exclusive starvation avoidance. > Checking for the owner chain anytime you acquire the lock is certainly > not I would call cheap. I did not proposed to verify owner chain. I said that it is easy to record the locks owned by current thread, only for current thread consumption. Below is the prototype. diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 24d94cc..2b60345 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -75,8 +75,6 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #define TD_LOCKS_INC(td) ((td)->td_locks++) #define TD_LOCKS_DEC(td) ((td)->td_locks--) #endif -#define TD_SLOCKS_INC(td) ((td)->td_lk_slocks++) -#define TD_SLOCKS_DEC(td) ((td)->td_lk_slocks--) #ifndef DEBUG_LOCKS #define STACK_PRINT(lk) @@ -115,11 +113,77 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & } \ } while (0) -#define LK_CAN_SHARE(x, flags) \ - (((x) & LK_SHARE) && \ - (((x) & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) == 0 || \ - (curthread->td_lk_slocks != 0 && !(flags & LK_NODDLKTREAT)) || \ - (curthread->td_pflags & TDP_DEADLKTREAT))) +static inline bool +lk_can_share(struct thread *td, void *lk, uintptr_t x, int flags) +{ + int i, idx, mask; + + if ((x & LK_SHARE) == 0) + return (false); + if (td->td_lk_slocks < nitems(td->td_lk_slocksp)) { + mask = td->td_lk_smask; + for (i = 0; i < td->td_lk_slocks; i++) { + idx = ffs(mask) - 1; + + /* + * Current thread definitely owns the same + * lock in shared mode already, grant the + * request despite possible presence of the + * exclusive waiters, to avoid deadlocks. + */ + if (lk == td->td_lk_slocksp[i]) + return (true); + + mask &= ~(1 << idx); + } + } else { + /* + * All slots filled, fall to the safe side. + * XXXKIB: panic instead ? + */ + return (true); + } + if ((curthread->td_pflags & TDP_DEADLKTREAT) != 0) + return (true); + if ((x & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) != 0) + return (false); + return (true); +} + +static inline void +lk_slocks_inc(struct thread *td, void *lk) +{ + int i; + + if (td->td_lk_slocks < nitems(td->td_lk_slocksp)) { + for (i = 0; i < nitems(td->td_lk_slocksp); i++) { + if (td->td_lk_slocksp[i] == NULL) { + td->td_lk_slocksp[i] = lk; + td->td_lk_smask |= 1 << i; + break; + } + } + KASSERT(i < nitems(td->td_lk_slocksp), ("leaked pointer")); + } + td->td_lk_slocks++; +} + +static inline void +lk_slocks_dec(struct thread *td, void *lk) +{ + int i, mask; + + mask = td->td_lk_smask; + for (i = 0; i < nitems(td->td_lk_slocksp); i++) { + if (lk == td->td_lk_slocksp[i]) { + td->td_lk_slocksp[i] = NULL; + td->td_lk_smask &= ~(1 << i); + break; + } + } + td->td_lk_slocks--; +} + #define LK_TRYOP(x) \ ((x) & LK_NOWAIT) @@ -338,7 +402,7 @@ wakeupshlk(struct lock *lk, const char *file, int line) lock_profile_release_lock(&lk->lock_object); TD_LOCKS_DEC(curthread); - TD_SLOCKS_DEC(curthread); + lk_slocks_dec(curthread, lk); return (wakeup_swapper); } @@ -531,7 +595,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, * waiters, if we fail to acquire the shared lock * loop back and retry. */ - if (LK_CAN_SHARE(x, flags)) { + if (lk_can_share(curthread, lk, x, flags)) { if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, x + LK_ONE_SHARER)) break; @@ -615,7 +679,8 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, __func__, lk, spintries, i); x = lk->lk_lock; if ((x & LK_SHARE) == 0 || - LK_CAN_SHARE(x) != 0) + lk_can_share(curthread, lk, + x, flags) != 0) break; cpu_spinwait(); } @@ -636,7 +701,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, * if the lock can be acquired in shared mode, try * again. */ - if (LK_CAN_SHARE(x, flags)) { + if (lk_can_share(curthread, lk, x, flags)) { sleepq_release(&lk->lock_object); continue; } @@ -698,7 +763,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, WITNESS_LOCK(&lk->lock_object, LK_TRYWIT(flags), file, line); TD_LOCKS_INC(curthread); - TD_SLOCKS_INC(curthread); + lk_slocks_inc(curthread, lk); STACK_SAVE(lk); } break; @@ -719,7 +784,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, line); WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | LK_TRYWIT(flags), file, line); - TD_SLOCKS_DEC(curthread); + lk_slocks_dec(curthread, lk); break; } @@ -974,7 +1039,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, panic("%s: downgrade a recursed lockmgr %s @ %s:%d\n", __func__, iwmesg, file, line); } - TD_SLOCKS_INC(curthread); + lk_slocks_inc(curthread, lk); /* * In order to preserve waiters flags, just spin. diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index f2ffab2..e4f9d64 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -390,7 +390,6 @@ compute_cn_lkflags(struct mount *mp, int lkflags, int cnflags) lkflags &= ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } - lkflags |= LK_NODDLKTREAT; return (lkflags); } diff --git a/sys/sys/lockmgr.h b/sys/sys/lockmgr.h index ff0473d..a48523f 100644 --- a/sys/sys/lockmgr.h +++ b/sys/sys/lockmgr.h @@ -158,7 +158,6 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct rwlock *ilk, #define LK_RETRY 0x000400 #define LK_SLEEPFAIL 0x000800 #define LK_TIMELOCK 0x001000 -#define LK_NODDLKTREAT 0x002000 /* * Operations for lockmgr(). diff --git a/sys/sys/proc.h b/sys/sys/proc.h index fac0915..4562e1a 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -237,6 +237,8 @@ struct thread { short td_rw_rlocks; /* (k) Count of rwlock read locks. */ short td_lk_slocks; /* (k) Count of lockmgr shared locks. */ short td_stopsched; /* (k) Scheduler stopped. */ + void *td_lk_slocksp[8];/* (k) */ + int td_lk_smask; /* (k) */ struct turnstile *td_blocked; /* (t) Lock thread is blocked on. */ const char *td_lockname; /* (t) Name of lock blocked on. */ LIST_HEAD(, turnstile) td_contested; /* (q) Contested locks. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:53:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13463FBE; Sun, 2 Nov 2014 17:53:48 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51D0BF01; Sun, 2 Nov 2014 17:53:47 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi2so4721602wib.13 for ; Sun, 02 Nov 2014 09:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=hkRLGrltbcqMqYOlWic65KaEeA6CuQo/h+QY8FgPi50=; b=YBfbtTZY90BAArFYEVk4/1EHr8utsgKsLbgNQr6ATrGS8NLsLYAp54io5K8FvHwtRp KLjDBl49Rq2GyUGsRmXwj3Sc/rtMAlDIFFvd26HYAP9UWd3PrmA3QJJdtcDbft14Cn7X 5vHm2LsyVxsVzyixslrpI14hFQo+H6VzHEvSUUIKLb40cAtiMYFuLDKgIsiP3ES/yNzI bZWkai5ThPDQu5O4ZhPlqxzzACESGhV7SY3WwAiotsiqSDM4xbyh+qG6kRh6BzmjjhoJ WSc0U28HDZW6L3+sJO82uySdzQhF8wbs8hoEqn2USKbhZGNbPWmmBcvqtSX+hvczZvMU m/vA== MIME-Version: 1.0 X-Received: by 10.180.100.129 with SMTP id ey1mr11302479wib.28.1414950824808; Sun, 02 Nov 2014 09:53:44 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 09:53:44 -0800 (PST) In-Reply-To: <20141102174958.GZ53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 18:53:44 +0100 X-Google-Sender-Auth: OoaGL0FPCr04HyX-HXpPV-l0zNk Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:53:48 -0000 On Sun, Nov 2, 2014 at 6:49 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 06:07:20PM +0100, Attilio Rao wrote: >> On Sun, Nov 2, 2014 at 5:59 PM, Konstantin Belousov wrote: >> > It is easy and cheap to record the set of the owned lockmgr locks for >> > current thread. I do not believe that we have a situation where more >> > than 3 locks are held in one time. To give it some slack, we can record >> > 8 locks shared-owned and do the check for recursion in LK_CAN_SHARE(). >> > If the thread-locks table overflows, we could either panic() or fall >> > back to indiscriminative deadlock avoidance (i.e. relying on the sole >> > td_lk_slocks value). >> >> I don't think it is going to be cheap (and certainly it is not viable >> for things like sx locks and rwlocks). > sx and rw do not implement exclusive starvation avoidance. rw do. It is believed for sx it should not be too helpful, on FreeBSD I've never seen an sx that is particulary congested. It can be added, however and the algorithm they would use is the same than rw. >> Checking for the owner chain anytime you acquire the lock is certainly >> not I would call cheap. > > I did not proposed to verify owner chain. I said that it is easy to > record the locks owned by current thread, only for current thread > consumption. Below is the prototype. I think it is too expensive, think that this must happen for every shared lock. I know we may not be using too many shared locks on lockmgr right now, but it is not a good reason to make shared lock bloated and more expensive on lockmgr. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 17:59:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 996D721F; Sun, 2 Nov 2014 17:59:08 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D72ADF36; Sun, 2 Nov 2014 17:59:07 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id q5so4730109wiv.11 for ; Sun, 02 Nov 2014 09:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=uhzy11nJBpY13HdXtHuA8exdv8+45Ez6Cy4xZIecPEU=; b=NS0YpH0NP52d+25Gb06lnVMna63EW4WEkrJLuiLvrkNfTJlC1ekiDIHa6YJ+8Xfale pJRV9RtXoh4vgu+DWyDRlTCkfQZvzl2W0SCB8LR8ezuIKYvZdefWYi2ZvpL4TQH7XVRb aRrVmm6nE8FgqAjmgfT8K6f19jjCVnF/G9djP+xZ6ykj+/zQvQoNVZEw6khO7QdYExe6 tPH5q8ADFPcePyl4Dj3GI+i35Kdcaw/9JRgdyNpY6h2n0GKQL2YNY6mh327pvRcFVZjD vHKXAY8cjSQAFWz8r3Y1od/kA5HrzwzsHGcGA8+weCAwUi71j35d0aBM8oRyN68YZgL3 I3kw== MIME-Version: 1.0 X-Received: by 10.194.191.163 with SMTP id gz3mr3435965wjc.114.1414951146077; Sun, 02 Nov 2014 09:59:06 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 09:59:06 -0800 (PST) In-Reply-To: References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 18:59:06 +0100 X-Google-Sender-Auth: yetJoBu3-oChSdYT0MLTwm4_4kU Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 17:59:08 -0000 On Sun, Nov 2, 2014 at 6:53 PM, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 6:49 PM, Konstantin Belousov wrote: >> On Sun, Nov 02, 2014 at 06:07:20PM +0100, Attilio Rao wrote: >>> On Sun, Nov 2, 2014 at 5:59 PM, Konstantin Belousov wrote: >>> > It is easy and cheap to record the set of the owned lockmgr locks for >>> > current thread. I do not believe that we have a situation where more >>> > than 3 locks are held in one time. To give it some slack, we can record >>> > 8 locks shared-owned and do the check for recursion in LK_CAN_SHARE(). >>> > If the thread-locks table overflows, we could either panic() or fall >>> > back to indiscriminative deadlock avoidance (i.e. relying on the sole >>> > td_lk_slocks value). >>> >>> I don't think it is going to be cheap (and certainly it is not viable >>> for things like sx locks and rwlocks). >> sx and rw do not implement exclusive starvation avoidance. > > rw do. > It is believed for sx it should not be too helpful, on FreeBSD I've > never seen an sx that is particulary congested. > It can be added, however and the algorithm they would use is the same than rw. > >>> Checking for the owner chain anytime you acquire the lock is certainly >>> not I would call cheap. >> >> I did not proposed to verify owner chain. I said that it is easy to >> record the locks owned by current thread, only for current thread >> consumption. Below is the prototype. > > I think it is too expensive, think that this must happen for every shared lock. > I know we may not be using too many shared locks on lockmgr right now, > but it is not a good reason to make shared lock bloated and more > expensive on lockmgr. And to be honest, I find already wrong the fact that we don't have a faster path for lockmgr() (ie. inlined atomics). I think this sloppiness (at least on my side) cames on the fact that locking overhead is not a major factor for the performance of current lockmgr users. That doesn't mean, however, that we should have a slower primitive. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:05:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EB68B2; Sun, 2 Nov 2014 19:05:30 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6FA7DF; Sun, 2 Nov 2014 19:05:29 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so4592861wiv.4 for ; Sun, 02 Nov 2014 11:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=iAgIPuebZzW+svQrWTT236yTrzrFy9Qm2GsNfHDYBto=; b=mfpvjVXbGJOPlKQDRQyAyU9mv2gSTBRxohCCLtt2jDUnE3BaB2MikcRN4qHXs22eZ7 fzrNMFV8PBqUfUk4p0gZbdiF1fZy8PB36QY8fJd3YxFAmw8iXO7x6nJ5cif0kzm5Pq8P CAh1MYjkMRKRYD136lmWJd8mMLTsCZhkDksYxaiuFO8pYXZdHZ3kjBgxRy8nUmgfuL79 0vz+nrI2mngBh/Z9bsV46iLe6ANC6aERaDOc1cyj26Q8yubHRg+olrE3wqXhhEvu2EWC rl3Mm5rdovnvzKPsNQojgCuuSGtY9f+WrA7XS1HAuyrA4ehAnECbB6/kK2lSU1j7KgUJ vl9Q== MIME-Version: 1.0 X-Received: by 10.180.73.212 with SMTP id n20mr11007818wiv.59.1414955127876; Sun, 02 Nov 2014 11:05:27 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sun, 2 Nov 2014 11:05:27 -0800 (PST) In-Reply-To: <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> Date: Sun, 2 Nov 2014 11:05:27 -0800 X-Google-Sender-Auth: k9B3KT1rRJg7QLON1AOICXKT-IU Message-ID: Subject: Re: svn commit: r273958 - head/sys/dev/random From: Adrian Chadd To: Mark R V Murray Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:05:30 -0000 [snip all the conversation] Ok. There's still a problem that I can trigger by trying to Ctrl-C a process that's blocked reading for randomness. I'll try to chase up more details about and file a PR about it. The unfortunate part is that the kernel side stack trace of the offending / hung process isn't currently helpful. :( -adrian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:07:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A154D281; Sun, 2 Nov 2014 19:07:14 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAD4A7F2; Sun, 2 Nov 2014 19:07:13 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so11003013wgg.8 for ; Sun, 02 Nov 2014 11:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=YP3xVn96l3LgxBDqcRSfiE3/sTwvw6TJAvKoN0OGa+8=; b=XC96KHjVm5KwSlLp6LW7OWHhTd8xo5gZ/JeWpdDpqF+2SwVP7dq6S4ZvNrCqprLotK 5HdtTwGsuddFbXXmFrbp73JzdjIpqrn+Q9jd+sdUVgcCDSzjqeicpKDLlZ36u8ms6+pu IRGjcgP5Ba0WC8C0yX1LVnKYT2d8NNkVILxhZyN/LoRly8OsOIGT4Y7IEJBhXE3f10k5 L2q3HNAKAhCYaAyPXfJCRBWhH83vvpaXg9W1Dk0VxHiifcXooqJR1IE+3lpyh4NMq3zx n59raqxmiaFfYSFy23bHa3Oqe3tABDwI+QYZb5I3VC7s3/DO6nOXBMKOkfdaRS95HhnA sdlQ== MIME-Version: 1.0 X-Received: by 10.180.106.162 with SMTP id gv2mr11296192wib.26.1414955232042; Sun, 02 Nov 2014 11:07:12 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sun, 2 Nov 2014 11:07:11 -0800 (PST) In-Reply-To: <32C3BF80-C600-455C-9467-7C1D50D49BFB@FreeBSD.org> References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <86egtl4vgi.fsf@nine.des.no> <32C3BF80-C600-455C-9467-7C1D50D49BFB@FreeBSD.org> Date: Sun, 2 Nov 2014 11:07:11 -0800 X-Google-Sender-Auth: 0V6qG1VAoZxAZ1gTjLy4jbHl8MI Message-ID: Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... From: Adrian Chadd To: Mark R V Murray Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Jan Beich X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:07:14 -0000 On 2 November 2014 05:08, Mark R V Murray wrote: > >> On 2 Nov 2014, at 12:51, Dag-Erling Sm=C3=B8rgrav wrote: >> >> Jan Beich writes: >>> I have a minimalistic kernel where everything is pushed to a module for >>> easier/faster debugging before kload. As its config has no |device rand= om| >>> loading random.ko fails because nothing provides random_adaptors [...] >> >> Yes, there is work to be done there. Ideally, the random module should >> include the random_adaptors framework and /dev/random itself, while >> Yarrow and Fortuna should be separate modules which can coexist, rather >> than mutually exclusive kernel options. > > Compiling both into the kernel is possible, but tricky, so I didn=E2=80= =99t do it > this time round. The reason for the trickiness is that randomdev_soft.c g= ets > compiled for each hash (Yarrow, Fortuna) with hash-specific #defines set. > > Not insoluble, but I just didn=E2=80=99t get to it. > > I=E2=80=99ll fix the random_adaptors bit shortly. Also as a side note - the kernel on the embedded MIPS boards here are now > 1MiB compressed now because loading random as a module isn't supported or working right. :( -adrian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:09:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98366618; Sun, 2 Nov 2014 19:09:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 833AB83C; Sun, 2 Nov 2014 19:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2J9ZUZ078008; Sun, 2 Nov 2014 19:09:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2J9ZdK078007; Sun, 2 Nov 2014 19:09:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411021909.sA2J9ZdK078007@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Nov 2014 19:09: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: r273983 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:09:35 -0000 Author: delphij Date: Sun Nov 2 19:09:34 2014 New Revision: 273983 URL: https://svnweb.freebsd.org/changeset/base/273983 Log: MFC r273267: Add tunable vfs.zfs.space_map_blksz for space map's maximum block size. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sun Nov 2 17:31:45 2014 (r273982) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c Sun Nov 2 19:09:34 2014 (r273983) @@ -37,6 +37,8 @@ #include #include +SYSCTL_DECL(_vfs_zfs); + /* * The data for a given space map can be kept on blocks of any size. * Larger blocks entail fewer i/o operations, but they also cause the @@ -44,6 +46,8 @@ * when only a few blocks have changed since the last transaction group. */ int space_map_blksz = (1 << 12); +SYSCTL_INT(_vfs_zfs, OID_AUTO, space_map_blksz, CTLFLAG_RDTUN, &space_map_blksz, 0, + "Maximum block size for space map. Must be power of 2 and greater than 4096."); /* * Load the space map disk into the specified range tree. Segments of maptype From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:10:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5279A749; Sun, 2 Nov 2014 19:10:36 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E62D78CD; Sun, 2 Nov 2014 19:10:35 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2JATHW012113 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 21:10:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2JATHW012113 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2JATxc012112; Sun, 2 Nov 2014 21:10:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 21:10:29 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102191029.GA53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:10:36 -0000 On Sun, Nov 02, 2014 at 06:53:44PM +0100, Attilio Rao wrote: > > I did not proposed to verify owner chain. I said that it is easy to > > record the locks owned by current thread, only for current thread > > consumption. Below is the prototype. > > I think it is too expensive, think that this must happen for every shared lock. > I know we may not be using too many shared locks on lockmgr right now, > but it is not a good reason to make shared lock bloated and more > expensive on lockmgr. It can be significantly simplified, if the array of lock pointers is kept dense. Then the only non-trivial operation is unlock out of order, when the array have to be compacted. The code adds one write and n reads on shared lock, where n is the number of shared-locked locks already owned by thread. Typical n is 0 or 1. On unlock, if done in order, the code adds one read; unordered unlock shuffles array elements. Again, for typical lock nesting of 2, this means one read and one write, and even this is rare. All reads and writes are for thread-local memory. I am not going to spend any more time on this if people do not consider the lock tracking worth it. Otherwise, I will benchmark the patch. diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 24d94cc..d63c86f 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -75,8 +75,6 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #define TD_LOCKS_INC(td) ((td)->td_locks++) #define TD_LOCKS_DEC(td) ((td)->td_locks--) #endif -#define TD_SLOCKS_INC(td) ((td)->td_lk_slocks++) -#define TD_SLOCKS_DEC(td) ((td)->td_lk_slocks--) #ifndef DEBUG_LOCKS #define STACK_PRINT(lk) @@ -115,11 +113,70 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & } \ } while (0) -#define LK_CAN_SHARE(x, flags) \ - (((x) & LK_SHARE) && \ - (((x) & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) == 0 || \ - (curthread->td_lk_slocks != 0 && !(flags & LK_NODDLKTREAT)) || \ - (curthread->td_pflags & TDP_DEADLKTREAT))) +static inline bool +lk_can_share(struct thread *td, void *lk, uintptr_t x, int flags) +{ + int i, sl; + + if ((x & LK_SHARE) == 0) + return (false); + sl = td->td_lk_slocks; + if (sl < nitems(td->td_lk_slocksp)) { + for (i = 0; i < sl; i++) { + /* + * Current thread definitely owns the same + * lock in shared mode already, grant the + * request despite possible presence of the + * exclusive waiters, to avoid deadlocks. + */ + if (lk == td->td_lk_slocksp[i]) + return (true); + } + } else { + /* + * All slots filled, fall to the safe side. + * XXXKIB: panic instead ? + */ + return (true); + } + if ((curthread->td_pflags & TDP_DEADLKTREAT) != 0) + return (true); + if ((x & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) != 0) + return (false); + return (true); +} + +static inline void +lk_slocks_inc(struct thread *td, void *lk) +{ + int sl; + + sl = td->td_lk_slocks; + if (sl < nitems(td->td_lk_slocksp)) + td->td_lk_slocksp[sl] = lk; + td->td_lk_slocks++; +} + +static inline void +lk_slocks_dec(struct thread *td, void *lk) +{ + int i, j, sl; + + sl = --td->td_lk_slocks; + KASSERT(sl >= 0, ("missed inc")); + if (sl < nitems(td->td_lk_slocksp) && td->td_lk_slocksp[sl] != lk) { + for (i = sl - 1; i >= 0; i--) { + if (lk == td->td_lk_slocksp[i]) { + for (j = i + 1; j <= sl; j++) { + td->td_lk_slocksp[j - 1] = + td->td_lk_slocksp[j]; + } + } + break; + } + } +} + #define LK_TRYOP(x) \ ((x) & LK_NOWAIT) @@ -338,7 +395,7 @@ wakeupshlk(struct lock *lk, const char *file, int line) lock_profile_release_lock(&lk->lock_object); TD_LOCKS_DEC(curthread); - TD_SLOCKS_DEC(curthread); + lk_slocks_dec(curthread, lk); return (wakeup_swapper); } @@ -531,7 +588,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, * waiters, if we fail to acquire the shared lock * loop back and retry. */ - if (LK_CAN_SHARE(x, flags)) { + if (lk_can_share(curthread, lk, x, flags)) { if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, x + LK_ONE_SHARER)) break; @@ -615,7 +672,8 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, __func__, lk, spintries, i); x = lk->lk_lock; if ((x & LK_SHARE) == 0 || - LK_CAN_SHARE(x) != 0) + lk_can_share(curthread, lk, + x, flags) != 0) break; cpu_spinwait(); } @@ -636,7 +694,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, * if the lock can be acquired in shared mode, try * again. */ - if (LK_CAN_SHARE(x, flags)) { + if (lk_can_share(curthread, lk, x, flags)) { sleepq_release(&lk->lock_object); continue; } @@ -698,7 +756,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, WITNESS_LOCK(&lk->lock_object, LK_TRYWIT(flags), file, line); TD_LOCKS_INC(curthread); - TD_SLOCKS_INC(curthread); + lk_slocks_inc(curthread, lk); STACK_SAVE(lk); } break; @@ -719,7 +777,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, line); WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | LK_TRYWIT(flags), file, line); - TD_SLOCKS_DEC(curthread); + lk_slocks_dec(curthread, lk); break; } @@ -974,7 +1032,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, panic("%s: downgrade a recursed lockmgr %s @ %s:%d\n", __func__, iwmesg, file, line); } - TD_SLOCKS_INC(curthread); + lk_slocks_inc(curthread, lk); /* * In order to preserve waiters flags, just spin. diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index f2ffab2..e4f9d64 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -390,7 +390,6 @@ compute_cn_lkflags(struct mount *mp, int lkflags, int cnflags) lkflags &= ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } - lkflags |= LK_NODDLKTREAT; return (lkflags); } diff --git a/sys/sys/lockmgr.h b/sys/sys/lockmgr.h index ff0473d..a48523f 100644 --- a/sys/sys/lockmgr.h +++ b/sys/sys/lockmgr.h @@ -158,7 +158,6 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct rwlock *ilk, #define LK_RETRY 0x000400 #define LK_SLEEPFAIL 0x000800 #define LK_TIMELOCK 0x001000 -#define LK_NODDLKTREAT 0x002000 /* * Operations for lockmgr(). diff --git a/sys/sys/proc.h b/sys/sys/proc.h index fac0915..c747576 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -237,6 +237,7 @@ struct thread { short td_rw_rlocks; /* (k) Count of rwlock read locks. */ short td_lk_slocks; /* (k) Count of lockmgr shared locks. */ short td_stopsched; /* (k) Scheduler stopped. */ + void *td_lk_slocksp[8];/* (k) */ struct turnstile *td_blocked; /* (t) Lock thread is blocked on. */ const char *td_lockname; /* (t) Name of lock blocked on. */ LIST_HEAD(, turnstile) td_contested; /* (q) Contested locks. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:15:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78F719C9; Sun, 2 Nov 2014 19:15:04 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47462900; Sun, 2 Nov 2014 19:15:03 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xl0cA-000GF3-5M; Sun, 02 Nov 2014 19:15:02 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA2JF1Z3090070; Sun, 2 Nov 2014 12:15:01 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+I3+3/pomxv7wQb6qein1I X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273958 - head/sys/dev/random From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 02 Nov 2014 12:15:00 -0700 Message-ID: <1414955700.1200.6.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:15:04 -0000 On Sun, 2014-11-02 at 11:05 -0800, Adrian Chadd wrote: > [snip all the conversation] > > Ok. There's still a problem that I can trigger by trying to Ctrl-C a > process that's blocked reading for randomness. I'll try to chase up > more details about and file a PR about it. > > The unfortunate part is that the kernel side stack trace of the > offending / hung process isn't currently helpful. :( > > > > > -adrian Possibly related... when I had the boot time save-entropy stuff stuck in a read yesterday I tried ^T and it first reported the hung process in a "block" wait. Any subsequent ^T showed the process as runnable and the cpu usage as 100%. This is on a single-core arm. -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:16:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 633FAB1B; Sun, 2 Nov 2014 19:16:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DF9D912; Sun, 2 Nov 2014 19:16:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2JGg6w082431; Sun, 2 Nov 2014 19:16:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2JGgjW082430; Sun, 2 Nov 2014 19:16:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411021916.sA2JGgjW082430@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Nov 2014 19:16:42 +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: r273984 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:16:42 -0000 Author: delphij Date: Sun Nov 2 19:16:41 2014 New Revision: 273984 URL: https://svnweb.freebsd.org/changeset/base/273984 Log: MFC r273026: Add a tunable for arc_shrink_shift (vfs.zfs.arc_shrink_shift) that controls how much fraction, 1/2^arc_shrink_shift, should be reclaimed when there is memory pressure. Submitted by: Richard Kojedzinszky Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 2 19:09:34 2014 (r273983) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 2 19:16:41 2014 (r273984) @@ -220,6 +220,7 @@ TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min); TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit); TUNABLE_QUAD("vfs.zfs.arc_average_blocksize", &zfs_arc_average_blocksize); +TUNABLE_INT("vfs.zfs.arc_shrink_shift", &zfs_arc_shrink_shift); SYSCTL_DECL(_vfs_zfs); SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0, "Maximum ARC size"); @@ -228,6 +229,10 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN, &zfs_arc_average_blocksize, 0, "ARC average blocksize"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, arc_shrink_shift, CTLFLAG_RW, + &arc_shrink_shift, 0, + "log2(fraction of arc to reclaim)"); + /* * We don't have a tunable for arc_free_target due to the dependency on * pagedaemon initialisation. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:20:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12253CFF; Sun, 2 Nov 2014 19:20:41 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8A409AE; Sun, 2 Nov 2014 19:20:40 +0000 (UTC) Received: from [2001:470:9174:1:1da0:4ef1:3fbf:d630] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xl0hY-000Gz4-FU; Sun, 02 Nov 2014 19:20:37 +0000 Subject: Re: svn commit: r273872 - in head: etc/defaults etc/rc.d libexec/save-entropy share/examples/kld/random_adaptor sys/conf sys/dev/glxsb sys/dev/random sys/kern sys/modules sys/modules/padlock_rng sys/mo... Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: Date: Sun, 2 Nov 2014 19:20:35 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201410302121.s9ULLsEw055630@svn.freebsd.org> <86egtl4vgi.fsf@nine.des.no> <32C3BF80-C600-455C-9467-7C1D50D49BFB@FreeBSD.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Jan Beich X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:20:41 -0000 > On 2 Nov 2014, at 19:07, Adrian Chadd wrote: >=20 > On 2 November 2014 05:08, Mark R V Murray wrote: >>=20 >>> On 2 Nov 2014, at 12:51, Dag-Erling Sm=C3=B8rgrav = wrote: >>>=20 >>> Jan Beich writes: >>>> I have a minimalistic kernel where everything is pushed to a module = for >>>> easier/faster debugging before kload. As its config has no |device = random| >>>> loading random.ko fails because nothing provides random_adaptors = [...] >>>=20 >>> Yes, there is work to be done there. Ideally, the random module = should >>> include the random_adaptors framework and /dev/random itself, while >>> Yarrow and Fortuna should be separate modules which can coexist, = rather >>> than mutually exclusive kernel options. >>=20 >> Compiling both into the kernel is possible, but tricky, so I didn=E2=80= =99t do it >> this time round. The reason for the trickiness is that = randomdev_soft.c gets >> compiled for each hash (Yarrow, Fortuna) with hash-specific #defines = set. >>=20 >> Not insoluble, but I just didn=E2=80=99t get to it. >>=20 >> I=E2=80=99ll fix the random_adaptors bit shortly. >=20 > Also as a side note - the kernel on the embedded MIPS boards here are > now > 1MiB compressed now because loading random as a module isn't > supported or working right. :( I=E2=80=99m looking at it. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:21:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4C74E70; Sun, 2 Nov 2014 19:21:02 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 418349B7; Sun, 2 Nov 2014 19:21:01 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2JKvwN015038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 21:20:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2JKvwN015038 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2JKvKt015037; Sun, 2 Nov 2014 21:20:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 21:20:57 +0200 From: Konstantin Belousov To: Adrian Chadd Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141102192057.GB53947@kib.kiev.ua> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ian Lepore , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:21:03 -0000 On Sun, Nov 02, 2014 at 11:05:27AM -0800, Adrian Chadd wrote: > [snip all the conversation] > > Ok. There's still a problem that I can trigger by trying to Ctrl-C a > process that's blocked reading for randomness. I'll try to chase up > more details about and file a PR about it. > > The unfortunate part is that the kernel side stack trace of the > offending / hung process isn't currently helpful. :( > >From what I see, signals are essentially ignored in the read code. See random_adaptors.c:random_adaptor_read(): /* Sleep instead of going into a spin-frenzy */ tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); The error which would indicate the signal catch, is dropped. Also, unbound sleep does not drop random_adaptor_lock, which means that you cannot module which could provide some more randomness for you, while any thread is stuck in read loop. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:24:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D36119B; Sun, 2 Nov 2014 19:24:16 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21A2F9FC; Sun, 2 Nov 2014 19:24:15 +0000 (UTC) Received: from [2001:470:9174:1:1da0:4ef1:3fbf:d630] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xl0l4-000Gzc-5E; Sun, 02 Nov 2014 19:24:14 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20141102192057.GB53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 19:24:13 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:24:16 -0000 > On 2 Nov 2014, at 19:20, Konstantin Belousov = wrote: >=20 > On Sun, Nov 02, 2014 at 11:05:27AM -0800, Adrian Chadd wrote: >> [snip all the conversation] >>=20 >> Ok. There's still a problem that I can trigger by trying to Ctrl-C a >> process that's blocked reading for randomness. I'll try to chase up >> more details about and file a PR about it. >>=20 >> The unfortunate part is that the kernel side stack trace of the >> offending / hung process isn't currently helpful. :( >>=20 >=20 >> =46rom what I see, signals are essentially ignored in the read code. > See random_adaptors.c:random_adaptor_read(): >=20 > /* Sleep instead of going into a spin-frenzy */ > tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); >=20 > The error which would indicate the signal catch, is dropped. Also, > unbound sleep does not drop random_adaptor_lock, which means that > you cannot module which could provide some more randomness for you, > while any thread is stuck in read loop. Hi I don=E2=80=99t quite follow what you mean, but it sounds like you = understand the problem. Could you please explain with a bit more detail? Thanks, M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:25:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D7122E4; Sun, 2 Nov 2014 19:25:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDD1CA07; Sun, 2 Nov 2014 19:25:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2JPVvX087055; Sun, 2 Nov 2014 19:25:31 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2JPVV0087054; Sun, 2 Nov 2014 19:25:31 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201411021925.sA2JPVV0087054@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Sun, 2 Nov 2014 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273985 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:25:32 -0000 Author: wblock (doc committer) Date: Sun Nov 2 19:25:31 2014 New Revision: 273985 URL: https://svnweb.freebsd.org/changeset/base/273985 Log: Add the less-ambiguous freebsd-version command. Reviewed by: -stable MFC after: 3 days Modified: head/etc/motd Modified: head/etc/motd ============================================================================== --- head/etc/motd Sun Nov 2 19:16:41 2014 (r273984) +++ head/etc/motd Sun Nov 2 19:25:31 2014 (r273985) @@ -13,7 +13,7 @@ Documents installed with the system are directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. -Show the version of FreeBSD installed: uname -a +Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:46:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21657881; Sun, 2 Nov 2014 19:46:31 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5CCDBC1; Sun, 2 Nov 2014 19:46:30 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2JkPCC020725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 21:46:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2JkPCC020725 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2JkP1G020724; Sun, 2 Nov 2014 21:46:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 21:46:25 +0200 From: Konstantin Belousov To: Mark R V Murray Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141102194625.GC53947@kib.kiev.ua> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:46:31 -0000 On Sun, Nov 02, 2014 at 07:24:13PM +0000, Mark R V Murray wrote: > > > On 2 Nov 2014, at 19:20, Konstantin Belousov wrote: > > > > On Sun, Nov 02, 2014 at 11:05:27AM -0800, Adrian Chadd wrote: > >> [snip all the conversation] > >> > >> Ok. There's still a problem that I can trigger by trying to Ctrl-C a > >> process that's blocked reading for randomness. I'll try to chase up > >> more details about and file a PR about it. > >> > >> The unfortunate part is that the kernel side stack trace of the > >> offending / hung process isn't currently helpful. :( > >> > > > >> From what I see, signals are essentially ignored in the read code. > > See random_adaptors.c:random_adaptor_read(): > > > > /* Sleep instead of going into a spin-frenzy */ > > tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); > > > > The error which would indicate the signal catch, is dropped. Also, > > unbound sleep does not drop random_adaptor_lock, which means that > > you cannot module which could provide some more randomness for you, > > while any thread is stuck in read loop. > > Hi > > I don???t quite follow what you mean, but it sounds like you understand > the problem. Could you please explain with a bit more detail? Which problem ? There are two. One is the Adrian' complain. tsleep(9) catches signals, and return EINTR/ERESTART when catched. Typical driver code checks for the errors from {t,m}sleep(9) and aborts the operation if error is returned. I.e. you should do error = tsleep(...); if (error != 0) { abort the loop; return to caller; } The fine detail is that for the case when read has already partially progressed, i.e. something was copied out to uio, the error must not be returned, but short read performed instead. This leads to another question about the code in random_adapter_read(): if ra_read method sleeps, it must handle the signals as well, return error, and the second loop which perorms ra_read/uiomove should be aborted as well. Again, error from either ra_read or uiomove(9) must result in short read if something was already copied to uio. Currently, there is no error returned by ra_read (or it is ignored), and error from uiomove always returned, even if something was already copied. Second problem is that random_adaptor_lock is owned while tsleep() is called (or whatever sleep primitive is used inside ra_read). If platform could only provide randomness through some hw, and module is loaded while thread is blocked, module cannot register, while reading thread cannot make progress. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:49:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 538529F8; Sun, 2 Nov 2014 19:49:28 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5C16BD6; Sun, 2 Nov 2014 19:49:27 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2JnNTJ020766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 21:49:23 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2JnNTJ020766 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2JnNRC020765; Sun, 2 Nov 2014 21:49:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 21:49:23 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141102194922.GD53947@kib.kiev.ua> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <1414955700.1200.6.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1414955700.1200.6.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:49:28 -0000 On Sun, Nov 02, 2014 at 12:15:00PM -0700, Ian Lepore wrote: > On Sun, 2014-11-02 at 11:05 -0800, Adrian Chadd wrote: > > [snip all the conversation] > > > > Ok. There's still a problem that I can trigger by trying to Ctrl-C a > > process that's blocked reading for randomness. I'll try to chase up > > more details about and file a PR about it. > > > > The unfortunate part is that the kernel side stack trace of the > > offending / hung process isn't currently helpful. :( > > > > > > > > > > -adrian > > Possibly related... when I had the boot time save-entropy stuff stuck in > a read yesterday I tried ^T and it first reported the hung process in a > "block" wait. Any subsequent ^T showed the process as runnable and the > cpu usage as 100%. This is on a single-core arm. > Yes, this is because error from tsleep() in random_adaptor_read() does not abort the loop. But next loop iteration calls tsleep() which returns immediately since there is still pending signal. The process continues indefinitely. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:51:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A9A4B3F; Sun, 2 Nov 2014 19:51:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76F2DBE4; Sun, 2 Nov 2014 19:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2JpY9C000492; Sun, 2 Nov 2014 19:51:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2JpY5M000491; Sun, 2 Nov 2014 19:51:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411021951.sA2JpY5M000491@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 2 Nov 2014 19:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273986 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:51:34 -0000 Author: kib Date: Sun Nov 2 19:51:33 2014 New Revision: 273986 URL: https://svnweb.freebsd.org/changeset/base/273986 Log: Followup to r273966. Fix the build with ADAPTIVE_LOCKMGRS kernel option. Note that the option is currently not used in any in-tree kernel configs, including LINTs. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Nov 2 19:25:31 2014 (r273985) +++ head/sys/kern/kern_lock.c Sun Nov 2 19:51:33 2014 (r273986) @@ -615,7 +615,7 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, lk, spintries, i); x = lk->lk_lock; if ((x & LK_SHARE) == 0 || - LK_CAN_SHARE(x) != 0) + LK_CAN_SHARE(x, flags) != 0) break; cpu_spinwait(); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:54:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 030E2CC0; Sun, 2 Nov 2014 19:54:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E37C1C7C; Sun, 2 Nov 2014 19:54:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2JsAlu001335; Sun, 2 Nov 2014 19:54:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2JsAKk001334; Sun, 2 Nov 2014 19:54:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411021954.sA2JsAKk001334@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 19:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273987 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:54:11 -0000 Author: jhb Date: Sun Nov 2 19:54:10 2014 New Revision: 273987 URL: https://svnweb.freebsd.org/changeset/base/273987 Log: Don't check for a NULL curthread. curthread hasn't been NULL after early boot since 5.0. Modified: head/sys/i386/i386/vm86bios.s Modified: head/sys/i386/i386/vm86bios.s ============================================================================== --- head/sys/i386/i386/vm86bios.s Sun Nov 2 19:51:33 2014 (r273986) +++ head/sys/i386/i386/vm86bios.s Sun Nov 2 19:54:10 2014 (r273987) @@ -69,8 +69,6 @@ ENTRY(vm86_bioscall) movl PCPU(CURTHREAD),%ecx cmpl %ecx,PCPU(FPCURTHREAD) /* do we need to save fp? */ jne 1f - testl %ecx,%ecx - je 1f /* no curproc/npxproc */ pushl %edx movl TD_PCB(%ecx),%ecx pushl PCB_SAVEFPU(%ecx) From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 19:56:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A976CE59; Sun, 2 Nov 2014 19:56:14 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D54FC8E; Sun, 2 Nov 2014 19:56:14 +0000 (UTC) Received: from [2001:470:9174:1:1da0:4ef1:3fbf:d630] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xl1G0-000H4V-L8; Sun, 02 Nov 2014 19:56:13 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=utf-8 From: Mark R V Murray In-Reply-To: <20141102194625.GC53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 19:56:11 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 19:56:14 -0000 > On 2 Nov 2014, at 19:46, Konstantin Belousov = wrote: >=20 >> I don???t quite follow what you mean, but it sounds like you = understand >> the problem. Could you please explain with a bit more detail? >=20 > Which problem ? There are two. >=20 > One is the Adrian' complain. tsleep(9) catches signals, and return > EINTR/ERESTART when catched. Typical driver code checks for the > errors from {t,m}sleep(9) and aborts the operation if error is > returned. I.e. you should do > error =3D tsleep(...); > if (error !=3D 0) { > abort the loop; > return to caller; > } > The fine detail is that for the case when read has already partially > progressed, i.e. something was copied out to uio, the error must > not be returned, but short read performed instead. OK, I think I follow this. In another mail you say: > Yes, this is because error from tsleep() in random_adaptor_read() > does not abort the loop. But next loop iteration calls tsleep() > which returns immediately since there is still pending signal. > The process continues indefinitely. .. which supports this what you say further above. Thanks. > This leads to another question about the code in = random_adapter_read(): > if ra_read method sleeps, it must handle the signals as well, return > error, and the second loop which perorms ra_read/uiomove should be > aborted as well. Again, error from either ra_read or uiomove(9) > must result in short read if something was already copied to uio. > Currently, there is no error returned by ra_read (or it is ignored), > and error from uiomove always returned, even if something was already > copied. Are you saying the same thing again, or something else? If you are = saying something else, then I am struggling to follow you. > Second problem is that random_adaptor_lock is owned while tsleep() > is called (or whatever sleep primitive is used inside ra_read). If > platform could only provide randomness through some hw, and module > is loaded while thread is blocked, module cannot register, while > reading thread cannot make progress. I=E2=80=99m sorry, I don=E2=80=99t understand this. M --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:04:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C46382C6; Sun, 2 Nov 2014 20:04:18 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A1FE7D69; Sun, 2 Nov 2014 20:04:18 +0000 (UTC) Received: from zeta.ixsystems.com (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id C01D914896; Sun, 2 Nov 2014 12:04:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1414958658; x=1414973058; bh=IIQi26bIZFGhWR+xw8S02mvbKUJrJkFsrxY0cCeNJ/4=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=UQjP483eP+lGGtNdChzVZB0RZEiHIvtclebLQnjfBZQZi2J7OdORkzpCNxAMpNpNN efuXpogjOYA8nHwQJfFedPhqsSVlZuvPw0wB+j4x4X5oVXSdlLlL42u2cCKbU83l6A wak/vuVVCMXwFy9LHQinx8cZk3Y3JGMy7L7hlZKM= Message-ID: <54568E41.8030305@delphij.net> Date: Sun, 02 Nov 2014 12:04:17 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Mark R V Murray , Konstantin Belousov Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> In-Reply-To: <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:04:18 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/02/14 11:56, Mark R V Murray wrote: > >> On 2 Nov 2014, at 19:46, Konstantin Belousov >> wrote: >> >>> I don???t quite follow what you mean, but it sounds like you >>> understand the problem. Could you please explain with a bit >>> more detail? >> >> Which problem ? There are two. >> >> One is the Adrian' complain. tsleep(9) catches signals, and >> return EINTR/ERESTART when catched. Typical driver code checks >> for the errors from {t,m}sleep(9) and aborts the operation if >> error is returned. I.e. you should do error = tsleep(...); if >> (error != 0) { abort the loop; return to caller; } The fine >> detail is that for the case when read has already partially >> progressed, i.e. something was copied out to uio, the error must >> not be returned, but short read performed instead. > > OK, I think I follow this. > > In another mail you say: >> Yes, this is because error from tsleep() in >> random_adaptor_read() does not abort the loop. But next loop >> iteration calls tsleep() which returns immediately since there is >> still pending signal. The process continues indefinitely. > > .. which supports this what you say further above. Thanks. > >> This leads to another question about the code in >> random_adapter_read(): if ra_read method sleeps, it must handle >> the signals as well, return error, and the second loop which >> perorms ra_read/uiomove should be aborted as well. Again, error >> from either ra_read or uiomove(9) must result in short read if >> something was already copied to uio. Currently, there is no error >> returned by ra_read (or it is ignored), and error from uiomove >> always returned, even if something was already copied. > > Are you saying the same thing again, or something else? If you are > saying something else, then I am struggling to follow you. These are essentially the same issue. Since we do tsleep() with PCATCH, the result should be checked and handled. >> Second problem is that random_adaptor_lock is owned while >> tsleep() is called (or whatever sleep primitive is used inside >> ra_read). If platform could only provide randomness through some >> hw, and module is loaded while thread is blocked, module cannot >> register, while reading thread cannot make progress. > > I’m sorry, I don’t understand this. There is a race condition here (practically I don't think it's a real world problem right now, but we'd better fix it before it become one). Consider this: dummy adapter registered A process requests a read(), now with &random_adaptors_lock held (shared) Another thread calls in and attempted to register yarrow. Now, the third thread can not succeed until the second thread hits an Ctrl+C. I think that we should probably release the lock briefly and reacquire it after the sleep to allow a different thread to acquire it. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUVo5BAAoJEJW2GBstM+ns6SIP/2hhmB4//+Dc6drDF54+Yh7d 8pI16CcC58WPUrf4a3xWQFTErpwLBdaRJ0c/G6r2FNv5ZWMomlNnMEvdsj88Bn1y 8cj6NxZTfAEK4YvxvYqSFEPLIlD4hnDwLyQ8ZN78uS9gOJLmZ0uaOwAulU09zTyg OC7rIsirUG70PKe2tC4/qYjWMWg89Pdj2XYs7+aWoKDJWNNLUetllA+NTwUI2/I1 RBgRM2rTPkNVh9jd5ZZb87BtK+r4i+kaykKTYssZFXZpn6ii7NiNN1C9s6yE8eBd GBus2b4vCi/5g4Pdlm7geKuoi1l/UgjRiAhVPiDcdb4tuE5qmcuGuohFXM8ibrwn AT7RVV5jcZhxOvSJlsk1yXVbrDThIfnm/rg9pbsq6+/IF96CfWTFKSSeugBKodiK QFx9gdqi6U3AA2aQ0ydQm5zG0TUR6pQVcdiDL8FKUj/Tq2zHlKilHhYFskFL1XX4 KL83e1m8CXGjkuLSX1MpG27l30mwbESfFApaNppQjFXJHF/jHh9aS0JHKIgvCvRh BVJFr4D8Iiioj7gtduVtX362YUIFdQxPfv2ekHmlPwN9+NaEVCAAd4PvLcuxmr9R 4aRN+JHYOlPZibmwDnlldlM2DIj5wBSB2h61+Sb6hq6USEo/IaveOnVDN8unXNnE AXYRn8M1aNAmMG8Kb/Y3 =D/my -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:13:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BC4BAA3; Sun, 2 Nov 2014 20:13:45 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58F3F0F; Sun, 2 Nov 2014 20:13:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2KDWBD026323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 22:13:32 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2KDWBD026323 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2KDV1b026322; Sun, 2 Nov 2014 22:13:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 22:13:31 +0200 From: Konstantin Belousov To: d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141102201331.GE53947@kib.kiev.ua> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54568E41.8030305@delphij.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:13:45 -0000 On Sun, Nov 02, 2014 at 12:04:17PM -0800, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 11/02/14 11:56, Mark R V Murray wrote: > > > >> On 2 Nov 2014, at 19:46, Konstantin Belousov > >> wrote: > >> > >>> I don???t quite follow what you mean, but it sounds like you > >>> understand the problem. Could you please explain with a bit > >>> more detail? > >> > >> Which problem ? There are two. > >> > >> One is the Adrian' complain. tsleep(9) catches signals, and > >> return EINTR/ERESTART when catched. Typical driver code checks > >> for the errors from {t,m}sleep(9) and aborts the operation if > >> error is returned. I.e. you should do error = tsleep(...); if > >> (error != 0) { abort the loop; return to caller; } The fine > >> detail is that for the case when read has already partially > >> progressed, i.e. something was copied out to uio, the error must > >> not be returned, but short read performed instead. > > > > OK, I think I follow this. > > > > In another mail you say: > >> Yes, this is because error from tsleep() in > >> random_adaptor_read() does not abort the loop. But next loop > >> iteration calls tsleep() which returns immediately since there is > >> still pending signal. The process continues indefinitely. > > > > .. which supports this what you say further above. Thanks. > > > >> This leads to another question about the code in > >> random_adapter_read(): if ra_read method sleeps, it must handle > >> the signals as well, return error, and the second loop which > >> perorms ra_read/uiomove should be aborted as well. Again, error > >> from either ra_read or uiomove(9) must result in short read if > >> something was already copied to uio. Currently, there is no error > >> returned by ra_read (or it is ignored), and error from uiomove > >> always returned, even if something was already copied. > > > > Are you saying the same thing again, or something else? If you are > > saying something else, then I am struggling to follow you. > > These are essentially the same issue. Since we do tsleep() with > PCATCH, the result should be checked and handled. Essentially same, but not quite. I am saying that ra_read() methods must block by sleep when they cannot provide randomness immediately. They should do this with some sleeping primitive, and the same issue as with tsleep() above, but in random adaptor code, appears. > > >> Second problem is that random_adaptor_lock is owned while > >> tsleep() is called (or whatever sleep primitive is used inside > >> ra_read). If platform could only provide randomness through some > >> hw, and module is loaded while thread is blocked, module cannot > >> register, while reading thread cannot make progress. > > > > I???m sorry, I don???t understand this. > > There is a race condition here (practically I don't think it's a real > world problem right now, but we'd better fix it before it become one). > Consider this: > > dummy adapter registered > > A process requests a read(), now with > &random_adaptors_lock held (shared) > > Another thread calls in and attempted > to register yarrow. > > Now, the third thread can not succeed until the second thread hits an > Ctrl+C. Assume that there is no random adaptors which are able to provide any randomness loaded at all. Some thread is blocked in read. Now, you cannot load any module which would unblock the thread. > > I think that we should probably release the lock briefly and reacquire > it after the sleep to allow a different thread to acquire it. No. Lock must be dropped around the sleep. State should be checked and loop restarted from the beginning if state changed. Some form of the generation counter seems to be useful there. But this is definitely of low priority. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:27:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6EB3CD2; Sun, 2 Nov 2014 20:27:41 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F25212; Sun, 2 Nov 2014 20:27:41 +0000 (UTC) Received: from zeta.ixsystems.com (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 9849614A02; Sun, 2 Nov 2014 12:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1414960055; x=1414974455; bh=5Mo1FGWqrDfq8NmyvWHzGkTfDoYpHqPFqtCeExJ5NLo=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=Wy0f6T57ly4Bm1LDY8uVyWMV3HVARudpjpvAIHubFEUmZWkoS+FetBCJNGklir/aU dOYBrf8Chb9Lvv4TL85chH6efu4RTSHb5/+xJbbw2BBtJO2pG7W24qWwDuBVYi4/OK AvslbT6FLt89Q98f5MhvR+z6bGM3Y2lPyBzeo12M= Message-ID: <545693B4.8030602@delphij.net> Date: Sun, 02 Nov 2014 12:27:32 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Konstantin Belousov , d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> In-Reply-To: <20141102201331.GE53947@kib.kiev.ua> Content-Type: multipart/mixed; boundary="------------070609020704050205090900" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:27:41 -0000 This is a multi-part message in MIME format. --------------070609020704050205090900 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, Mark, I'd like to propose the attached patch for review. It replaces tsleep's with sx_sleep's, then checks the return value and quit the loop. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUVpO0AAoJEJW2GBstM+nsTcoQAKQglUQUKCh4h+flynK+of1J I8pyCJTqkJHsvQu7Lj8Nh4gd6OQM3+XdpEGymA/wB1Q906cNI8ieLwuXCOmCxYhw xs2XJL5cyp1myDqCp3BRrNta8PPSF8gxfnCeU/0LuItrvcNaE3axNb/eu4g3u5s7 NZObx84C03uRoHMz+9qG0qkZbutY/qN8YP3DQ1WvkYom/i4UT2NGa1EgHLYa9Ofu REQ/lADumxqn5Cw6viKym1wI1HrCu00X602jGjivEzn1L7DSfKFJjckyLC2IbbdY Ydy4ejsILJRPFDt6PrcSWkaSBIy585wP90YsFvSK4riyy1i3HUF4pE5wQPPG/ogV ATm4S9GZgr4mM3SHZrcaTDyrm9BEsEizqBs/F3yyuKBqZt0xtTjv+tupCN5AG1LX DnfgLj7pNAW2SIF7lul34/CzisoKB7b5oEpL9YWOh8DvZiEgHMex4nRqTNAt9T8F 7f5bGvcMHfkIOQIUanxlganUW2ZgVaDPYQADjrEsfqD2pTwwK7glN0jXKJ9YStGW kzbjAQil9X/fliVSzPubbO0XTqAtjnPwONBbjw06vlrwZlkHbLOTz0VVZ3cAJcei 4CkCiEQtuFWbD9QVCUe6snztRRTI542dIlWSDPhSxYV3+hrkCgCeJ3fMvTutf7YZ ejIPZ/NOkhddVmvjMHKw =XrYs -----END PGP SIGNATURE----- --------------070609020704050205090900 Content-Type: text/plain; charset=UTF-8; name="random-tsleep.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="random-tsleep.diff" Index: sys/dev/random/random_adaptors.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 --- sys/dev/random/random_adaptors.c (revision 273982) +++ sys/dev/random/random_adaptors.c (working copy) @@ -217,7 +217,7 @@ random_adaptor_read(struct cdev *dev __unused, str =20 /* (Un)Blocking logic */ error =3D 0; - while (!random_adaptor->ra_seeded()) { + while (!random_adaptor->ra_seeded() && error =3D=3D 0) { if (flags & O_NONBLOCK) { error =3D EWOULDBLOCK; break; @@ -224,7 +224,8 @@ random_adaptor_read(struct cdev *dev __unused, str } =20 /* Sleep instead of going into a spin-frenzy */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error =3D sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "block", hz/10); =20 /* keep tapping away at the pre-read until we seed/unblock. */ (random_adaptor->ra_read)(NULL, 0); @@ -298,7 +299,7 @@ random_adaptor_write(struct cdev *dev __unused, st =20 random_buf =3D malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); =20 - while (uio->uio_resid > 0) { + while (uio->uio_resid > 0 && error =3D=3D 0) { c =3D MIN(uio->uio_resid, PAGE_SIZE); error =3D uiomove(random_buf, c, uio); if (error) @@ -306,7 +307,8 @@ random_adaptor_write(struct cdev *dev __unused, st (random_adaptor->ra_write)(random_buf, c); =20 /* Introduce an annoying delay to stop swamping */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error =3D sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "block", hz/10); } =20 free(random_buf, M_ENTROPY); --------------070609020704050205090900 Content-Type: application/octet-stream; name="random-tsleep.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="random-tsleep.diff.sig" iQIcBAABCgAGBQJUVpO0AAoJEJW2GBstM+nsokkP/R/K43IDwibhgHgp342TFWgeXs1mvcgq Ao17kPtMb5oC5De7+LwQ6iqbK8Mhk3KhPUbO7tK0WaHIcAr8SG9itLKZDB408TIvrVq1e6Oa NpHdYsCZDZAP7KkWQJKnzw0BXuFjIKjJVWBhcXLrlXD+iO4wxwzPCrPDVWqlT3PamROGaoKK K1kS55rIJLNG5dzfMo3nKWBhw7SHo6SsHk6KRAAfUa2Z10LNF0KJZRyhFkjJNY5SdG/Hr7JG GDQHZoLldH+HnYHu3WIgfyNntGYaOv+OhIXHKjTf8bPHJD3LPASFBnculpCQdirXng1iIihZ 1Pzpzg6qGYbxf1G3pB3+5awemz1cEuCP9Jjg2HDgzj2GNWigRlvKztqfuaMuAvlVfrbd6WAJ +nBGkoTIHmGcPFWkz0Jc9vZc8+oxdMdh7L6ltYmEuqI+T7Q+fvpcneSa7q0UQMF5NyEQNW9p 1PW6lXgwjxXZjEACUjS6Vavtdx2G++HWOZ4r9/21Qh4QIoN5khpSz6jbRFPE6jhgauK5RgdT RrbuOXP0IsTNJSnRWrAB5aly30hnyUDLAmO5WZ6ZvzrLggijUYJiy8UHp/4qpsFYTgCity0v mWdK1iajNjfm22ao0hgRdM3npA2pMAUTXgRh8gl9NyG3zdNS/gu1IdbwJ5mD4srFC7rWlV5Y 8tq6 --------------070609020704050205090900-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:38:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFD72E71; Sun, 2 Nov 2014 20:38:03 +0000 (UTC) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B273E155; Sun, 2 Nov 2014 20:38:03 +0000 (UTC) Received: from [2001:470:9174:1:1da0:4ef1:3fbf:d630] by gromit.grondar.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.84 (FreeBSD)) (envelope-from ) id 1Xl1uT-000Hdc-QT; Sun, 02 Nov 2014 20:38:02 +0000 Subject: Re: svn commit: r273958 - head/sys/dev/random Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: text/plain; charset=windows-1252 From: Mark R V Murray In-Reply-To: <545693B4.8030602@delphij.net> Date: Sun, 2 Nov 2014 20:38:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> To: d@delphij.net X-Mailer: Apple Mail (2.1990.1) X-SA-Score: -1.0 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:38:04 -0000 This look visually OK to me. I=92ll run it locally, but it needs So permission to commit. I guess you can self-certify, right? :-) M =20 > On 2 Nov 2014, at 20:27, Xin Li wrote: >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 >=20 > Hi, Mark, >=20 > I'd like to propose the attached patch for review. It replaces > tsleep's with sx_sleep's, then checks the return value and quit the = loop. >=20 > Cheers, > - --=20 > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0 >=20 > iQIcBAEBCgAGBQJUVpO0AAoJEJW2GBstM+nsTcoQAKQglUQUKCh4h+flynK+of1J > I8pyCJTqkJHsvQu7Lj8Nh4gd6OQM3+XdpEGymA/wB1Q906cNI8ieLwuXCOmCxYhw > xs2XJL5cyp1myDqCp3BRrNta8PPSF8gxfnCeU/0LuItrvcNaE3axNb/eu4g3u5s7 > NZObx84C03uRoHMz+9qG0qkZbutY/qN8YP3DQ1WvkYom/i4UT2NGa1EgHLYa9Ofu > REQ/lADumxqn5Cw6viKym1wI1HrCu00X602jGjivEzn1L7DSfKFJjckyLC2IbbdY > Ydy4ejsILJRPFDt6PrcSWkaSBIy585wP90YsFvSK4riyy1i3HUF4pE5wQPPG/ogV > ATm4S9GZgr4mM3SHZrcaTDyrm9BEsEizqBs/F3yyuKBqZt0xtTjv+tupCN5AG1LX > DnfgLj7pNAW2SIF7lul34/CzisoKB7b5oEpL9YWOh8DvZiEgHMex4nRqTNAt9T8F > 7f5bGvcMHfkIOQIUanxlganUW2ZgVaDPYQADjrEsfqD2pTwwK7glN0jXKJ9YStGW > kzbjAQil9X/fliVSzPubbO0XTqAtjnPwONBbjw06vlrwZlkHbLOTz0VVZ3cAJcei > 4CkCiEQtuFWbD9QVCUe6snztRRTI542dIlWSDPhSxYV3+hrkCgCeJ3fMvTutf7YZ > ejIPZ/NOkhddVmvjMHKw > =3DXrYs > -----END PGP SIGNATURE----- > --=20 Mark R V Murray From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:53:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF91D2D0; Sun, 2 Nov 2014 20:53:06 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A0FE2E7; Sun, 2 Nov 2014 20:53:06 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xl293-0000En-08; Sun, 02 Nov 2014 20:53:05 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA2Kr30D090221; Sun, 2 Nov 2014 13:53:03 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18udthTPT6dGD0849r+Ol+N X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r273958 - head/sys/dev/random From: Ian Lepore To: d@delphij.net In-Reply-To: <545693B4.8030602@delphij.net> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> Content-Type: text/plain; charset="us-ascii" Date: Sun, 02 Nov 2014 13:53:03 -0700 Message-ID: <1414961583.1200.27.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:53:06 -0000 On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Hi, Mark, > > I'd like to propose the attached patch for review. It replaces > tsleep's with sx_sleep's, then checks the return value and quit the loop. > > Cheers, > - -- It still doesn't handle the partial read/write case Kostik mentioned, but there are plenty of other drivers that don't get that right. Given that the ra_read/ra_write functions can't return error, it would only be errors from uiomove() in play. I guess it would be something like this: nbytes = uio->uio_resid; while (uio->uio_resid && !error) { c = MIN(uio->uio_resid, PAGE_SIZE); (random_adaptor->ra_read)(random_buf, c); error = uiomove(random_buf, c, uio); } if (uio->uio_resid != nbytes) error = 0; /* Return partial read, not error. */ Also, there's now a mix of if (error == 0) and if (!error) near each other (I tend to prefer using ! only on boolean_t, but I even more prefer local consistancy. :) -- Ian From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:57:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95FB6463; Sun, 2 Nov 2014 20:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 820A530F; Sun, 2 Nov 2014 20:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2KvKv8030592; Sun, 2 Nov 2014 20:57:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2KvKKU030590; Sun, 2 Nov 2014 20:57:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022057.sA2KvKKU030590@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 20:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273988 - in head/sys/i386: i386 include 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:57:20 -0000 Author: jhb Date: Sun Nov 2 20:57:19 2014 New Revision: 273988 URL: https://svnweb.freebsd.org/changeset/base/273988 Log: Remove the FP_SOFTFP flag. It wasn't used but was leftover from the software x86 math emulator. Modified: head/sys/i386/i386/machdep.c head/sys/i386/include/pcb.h Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Nov 2 19:54:10 2014 (r273987) +++ head/sys/i386/i386/machdep.c Sun Nov 2 20:57:19 2014 (r273988) @@ -1602,14 +1602,6 @@ exec_setregs(struct thread *td, struct i pcb->pcb_flags &= ~PCB_DBREGS; } - /* - * Initialize the math emulator (if any) for the current process. - * Actually, just clear the bit that says that the emulator has - * been initialized. Initialization is delayed until the process - * traps to the emulator (if it is done at all) mainly because - * emulators don't provide an entry point for initialization. - */ - td->td_pcb->pcb_flags &= ~FP_SOFTFP; pcb->pcb_initial_npxcw = __INITIAL_NPXCW__; /* Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Sun Nov 2 19:54:10 2014 (r273987) +++ head/sys/i386/include/pcb.h Sun Nov 2 20:57:19 2014 (r273988) @@ -66,7 +66,6 @@ struct pcb { union savefpu pcb_user_save; uint16_t pcb_initial_npxcw; u_int pcb_flags; -#define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */ #define PCB_DBREGS 0x02 /* process using debug registers */ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ #define PCB_VM86CALL 0x10 /* in vm86 call */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 20:59:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69F7E639; Sun, 2 Nov 2014 20:59:58 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2691031E; Sun, 2 Nov 2014 20:59:58 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 1D871B8069; Sun, 2 Nov 2014 21:59:55 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 09FD428494; Sun, 2 Nov 2014 21:59:55 +0100 (CET) Date: Sun, 2 Nov 2014 21:59:54 +0100 From: Jilles Tjoelker To: d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141102205954.GB89765@stack.nl> References: <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <545693B4.8030602@delphij.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 20:59:58 -0000 On Sun, Nov 02, 2014 at 12:27:32PM -0800, Xin Li wrote: > I'd like to propose the attached patch for review. It replaces > tsleep's with sx_sleep's, then checks the return value and quit the > loop. While you're there, please adjust the wait messages from "block" to something like "randrd" and "randwr". This change also stops it from retrying after 100ms. Although such polling is generally poor design, just giving up after 100ms may not be the right thing to do here. If the write delay is supposed to be annoying and to stop "swamping", perhaps it should not allow signals to cut it short. > Index: sys/dev/random/random_adaptors.c > =================================================================== > --- sys/dev/random/random_adaptors.c (revision 273982) > +++ sys/dev/random/random_adaptors.c (working copy) > @@ -217,7 +217,7 @@ random_adaptor_read(struct cdev *dev __unused, str > > /* (Un)Blocking logic */ > error = 0; > - while (!random_adaptor->ra_seeded()) { > + while (!random_adaptor->ra_seeded() && error == 0) { > if (flags & O_NONBLOCK) { > error = EWOULDBLOCK; > break; > @@ -224,7 +224,8 @@ random_adaptor_read(struct cdev *dev __unused, str > } > > /* Sleep instead of going into a spin-frenzy */ > - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); > + error = sx_sleep(&random_adaptor, &random_adaptors_lock, > + PUSER | PCATCH, "block", hz/10); > > /* keep tapping away at the pre-read until we seed/unblock. */ > (random_adaptor->ra_read)(NULL, 0); > @@ -298,7 +299,7 @@ random_adaptor_write(struct cdev *dev __unused, st > > random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); > > - while (uio->uio_resid > 0) { > + while (uio->uio_resid > 0 && error == 0) { > c = MIN(uio->uio_resid, PAGE_SIZE); > error = uiomove(random_buf, c, uio); > if (error) > @@ -306,7 +307,8 @@ random_adaptor_write(struct cdev *dev __unused, st > (random_adaptor->ra_write)(random_buf, c); > > /* Introduce an annoying delay to stop swamping */ > - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); > + error = sx_sleep(&random_adaptor, &random_adaptors_lock, > + PUSER | PCATCH, "block", hz/10); > } > > free(random_buf, M_ENTROPY); -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:17:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2B1BD96; Sun, 2 Nov 2014 21:17:28 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB1477D; Sun, 2 Nov 2014 21:17:27 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id q5so4952583wiv.17 for ; Sun, 02 Nov 2014 13:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ETeiA1zWEkBJl5juEf+j8jjODR4lBheLsHUQSgaAHKo=; b=pJfX8taKXqMhX49a595PsPOK7voqqT1dDx0AVUAqqEfnv4y5v6wl4YljQZJ5MtRvAW 5RCjQujQ0Uj+x+81OUCPCC7dKcMvmQhFVMiteF3HbeMtkaphwBoR904obe2KK0MNPnaS YIXYr9s/RGH3TazM2XCOPDxVw1ow02pEvFqk0misdo5r/ggelOm6fqTJGE87Lo3ndpLN ssxUE1NOMbVKmivbJYOT1vvWMq0Bqto3/1LBB86I3oZKV7aoIj0+Y+gwir+84/1AuGcs bgxEeuH4vVyRzmJFSYSrdTlek+aiUyII8wyaq6X/iFZzJiStJcMi7EI52Req8ScWIfHv tW2g== MIME-Version: 1.0 X-Received: by 10.180.98.169 with SMTP id ej9mr2251005wib.1.1414963046416; Sun, 02 Nov 2014 13:17:26 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 13:17:26 -0800 (PST) In-Reply-To: <20141102191029.GA53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 22:17:26 +0100 X-Google-Sender-Auth: o_MoqWxjz3_6JNU7a7Xw8HUuE1A Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:17:29 -0000 On Sun, Nov 2, 2014 at 8:10 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 06:53:44PM +0100, Attilio Rao wrote: >> > I did not proposed to verify owner chain. I said that it is easy to >> > record the locks owned by current thread, only for current thread >> > consumption. Below is the prototype. >> >> I think it is too expensive, think that this must happen for every shared lock. >> I know we may not be using too many shared locks on lockmgr right now, >> but it is not a good reason to make shared lock bloated and more >> expensive on lockmgr. > > It can be significantly simplified, if the array of lock pointers is > kept dense. Then the only non-trivial operation is unlock out of order, > when the array have to be compacted. > > The code adds one write and n reads on shared lock, where n is the > number of shared-locked locks already owned by thread. Typical n is 0 > or 1. On unlock, if done in order, the code adds one read; unordered > unlock shuffles array elements. Again, for typical lock nesting of 2, > this means one read and one write, and even this is rare. All reads and > writes are for thread-local memory. > > I am not going to spend any more time on this if people do not consider > the lock tracking worth it. Otherwise, I will benchmark the patch. I think that your initial patch (what is in head now) is a better approach. I would just make it a lockinit() flag to make it less alien to the KPI. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:34:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A862127; Sun, 2 Nov 2014 21:34:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66CC08E6; Sun, 2 Nov 2014 21:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2LYPoZ049588; Sun, 2 Nov 2014 21:34:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2LYPxd049587; Sun, 2 Nov 2014 21:34:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022134.sA2LYPxd049587@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 21:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273989 - head/sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:34:25 -0000 Author: jhb Date: Sun Nov 2 21:34:24 2014 New Revision: 273989 URL: https://svnweb.freebsd.org/changeset/base/273989 Log: MFamd64: Explicitly initialize the mxcsr during npxinit(). Modified: head/sys/i386/isa/npx.c Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sun Nov 2 20:57:19 2014 (r273988) +++ head/sys/i386/isa/npx.c Sun Nov 2 21:34:24 2014 (r273989) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include @@ -99,6 +100,7 @@ __FBSDID("$FreeBSD$"); #ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm __volatile("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) +#define ldmxcsr(csr) __asm __volatile("ldmxcsr %0" : : "m" (csr)) #define stmxcsr(addr) __asm __volatile("stmxcsr %0" : : "m" (*(addr))) #endif #else /* !(__GNUCLIKE_ASM && !lint) */ @@ -114,6 +116,7 @@ void frstor(caddr_t addr); #ifdef CPU_ENABLE_SSE void fxsave(caddr_t addr); void fxrstor(caddr_t addr); +void ldmxcsr(u_int csr); void stmxcsr(u_int *csr); #endif @@ -364,6 +367,12 @@ npxinit(void) #endif control = __INITIAL_NPXCW__; fldcw(control); +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) { + mxcsr = __INITIAL_MXCSR__; + ldmxcsr(mxcsr); + } +#endif start_emulating(); intr_restore(saveintr); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:38:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 590F23DF; Sun, 2 Nov 2014 21:38:25 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09BB92F; Sun, 2 Nov 2014 21:38:24 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2LcJX7045261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Nov 2014 23:38:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2LcJX7045261 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2LcJXG045260; Sun, 2 Nov 2014 23:38:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Nov 2014 23:38:19 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102213819.GF53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:38:25 -0000 On Sun, Nov 02, 2014 at 10:17:26PM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 8:10 PM, Konstantin Belousov wrote: > > On Sun, Nov 02, 2014 at 06:53:44PM +0100, Attilio Rao wrote: > >> > I did not proposed to verify owner chain. I said that it is easy to > >> > record the locks owned by current thread, only for current thread > >> > consumption. Below is the prototype. > >> > >> I think it is too expensive, think that this must happen for every shared lock. > >> I know we may not be using too many shared locks on lockmgr right now, > >> but it is not a good reason to make shared lock bloated and more > >> expensive on lockmgr. > > > > It can be significantly simplified, if the array of lock pointers is > > kept dense. Then the only non-trivial operation is unlock out of order, > > when the array have to be compacted. > > > > The code adds one write and n reads on shared lock, where n is the > > number of shared-locked locks already owned by thread. Typical n is 0 > > or 1. On unlock, if done in order, the code adds one read; unordered > > unlock shuffles array elements. Again, for typical lock nesting of 2, > > this means one read and one write, and even this is rare. All reads and > > writes are for thread-local memory. > > > > I am not going to spend any more time on this if people do not consider > > the lock tracking worth it. Otherwise, I will benchmark the patch. > > I think that your initial patch (what is in head now) is a better approach. > I would just make it a lockinit() flag to make it less alien to the KPI. > Ok. Can you explain what would the proposed lockinit() flag do ? What should it change comparing with the current code ? From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:39:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4754521; Sun, 2 Nov 2014 21:39:13 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BAAD893A; Sun, 2 Nov 2014 21:39:13 +0000 (UTC) Received: from zeta.ixsystems.com (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 8CFA514DDE; Sun, 2 Nov 2014 13:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1414964353; x=1414978753; bh=/cyntB4lnWXQ9sD5mO1P9G3BsIK/mHBQcLGuriUtMYw=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=U8Tgwd9S6YLWZ1z7I9YgACy7g33Hxq5B8Fudd0LfB8jQANNyVM1SQkloO/luwpd7r Ak4hQPFNHbCR1F3OsXaYoeDVsshzKb6wXHZfN8gUzLlxz0ZMZdMYyGXtMhb5WRprII NM4yMzKjK2kEanyqkMTXNIplJFSr7/f4YQiFX1B0= Message-ID: <5456A47E.2030405@delphij.net> Date: Sun, 02 Nov 2014 13:39:10 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore , d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> In-Reply-To: <1414961583.1200.27.camel@revolution.hippie.lan> Content-Type: multipart/mixed; boundary="------------090504050004050003030801" Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:39:14 -0000 This is a multi-part message in MIME format. --------------090504050004050003030801 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/02/14 12:53, Ian Lepore wrote: > On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 >> >> Hi, Mark, >> >> I'd like to propose the attached patch for review. It replaces >> tsleep's with sx_sleep's, then checks the return value and quit >> the loop. >> >> Cheers, - -- > > It still doesn't handle the partial read/write case Kostik > mentioned, but there are plenty of other drivers that don't get > that right. Given that the ra_read/ra_write functions can't return > error, it would only be errors from uiomove() in play. I guess it > would be something like this: > > nbytes = uio->uio_resid; while (uio->uio_resid && !error) { c = > MIN(uio->uio_resid, PAGE_SIZE); > (random_adaptor->ra_read)(random_buf, c); error = > uiomove(random_buf, c, uio); } if (uio->uio_resid != nbytes) error > = 0; /* Return partial read, not error. */ > > Also, there's now a mix of if (error == 0) and if (!error) near > each other (I tend to prefer using ! only on boolean_t, but I even > more prefer local consistancy. :) Thanks for pointing this out. I've added some checks at: http://pastebin.com/ZGsqpUHR Also attached. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUVqR+AAoJEJW2GBstM+nsLl8QAIFQQZCGwwkeTlVkG/i9YzAl pK4uox2dXouN1Zfwi9Q3ymB0DsUbnXt9IEP9JCD4Z8ZeFKUIC2mNI/V+t3etV5Kr kVdvayizwbJ0jLBYu6rUIoeZeqWFnLB25PitJFCPOAqJ+H1h/hV56Zx9SvkAWEIe spGpvq+eeHRYl/AzVMQFHjax0V7bo3yd+3klDlU3DT77WFvSRngNKUxHgVPMsoBY xm4YRPy6MLAHXlEoHtoERc5Qyhj00Km4ZRHtXn3tFh6LSAdtXmbBiVXlHWZ0eVEn 5vH0d3MKRCnKtQg2ydEA5SWoCTMHIVCfoB/yQ4B0N0FupgdEUXMlag0iBV8DZcmb nv1sd68V3GgDjiiAwevhbSLQ0cHr5FABtTdXwExClR2sOh3rN1PONsfbzfs3FgkO TWts6znUcblmpCFyQyz49/r+SQ35S1YXCKIZB5Z43yysPgR20uuSKbD0XKAne28u acntrXXgrfERSue1T5qz2xwH+dBWGuJtGDq1wSeP1kw8aWoX+ApAbUColCY2pEhm OawGlJ6qnr4VgEIl4vQ/S9gaxMX33K/KCHJERaCA/8h1WQQklmRTky4URZ6bAaHJ NMEd6GYD25GmfIY7kHB/tuPfjiWDwGnNh8mvSSAZBJM81gW+/9xqKwKn3OZ3kMFY eM+SpnlDm4skN3geKGse =yQhY -----END PGP SIGNATURE----- --------------090504050004050003030801 Content-Type: text/plain; charset=UTF-8; name="random-tsleep.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="random-tsleep.diff" Index: sys/dev/random/random_adaptors.c =================================================================== --- sys/dev/random/random_adaptors.c (revision 273982) +++ sys/dev/random/random_adaptors.c (working copy) @@ -171,9 +171,8 @@ random_adaptor_register(const char *name, struct r sx_xlock(&random_adaptors_lock); LIST_INSERT_HEAD(&random_adaptors_list, rra, rra_entries); random_adaptor_choose(); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); sx_xunlock(&random_adaptors_lock); - - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); } void @@ -182,9 +181,9 @@ random_adaptor_deregister(const char *name) struct random_adaptors *rra; KASSERT(name != NULL, ("invalid input to %s", __func__)); - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); sx_xlock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); LIST_FOREACH(rra, &random_adaptors_list, rra_entries) if (strcmp(rra->rra_name, name) == 0) { LIST_REMOVE(rra, rra_entries); @@ -208,16 +207,18 @@ random_adaptor_read(struct cdev *dev __unused, str printf("random: %s %ld\n", __func__, uio->uio_resid); #endif - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); sx_slock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + /* Let the entropy source do any pre-read setup. */ (random_adaptor->ra_read)(NULL, 0); /* (Un)Blocking logic */ error = 0; - while (!random_adaptor->ra_seeded()) { + while (!random_adaptor->ra_seeded() && error == 0) { if (flags & O_NONBLOCK) { error = EWOULDBLOCK; break; @@ -224,7 +225,10 @@ random_adaptor_read(struct cdev *dev __unused, str } /* Sleep instead of going into a spin-frenzy */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error = sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "block", hz/10); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", + __func__)); /* keep tapping away at the pre-read until we seed/unblock. */ (random_adaptor->ra_read)(NULL, 0); @@ -241,12 +245,10 @@ random_adaptor_read(struct cdev *dev __unused, str mtx_unlock(&random_read_rate_mtx); - if (!error) { + if (error == 0) { + nbytes = uio->uio_resid; /* The actual read */ - - random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); - while (uio->uio_resid && !error) { c = MIN(uio->uio_resid, PAGE_SIZE); (random_adaptor->ra_read)(random_buf, c); @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev __unused, str /* Let the entropy source do any post-read cleanup. */ (random_adaptor->ra_read)(NULL, 1); - free(random_buf, M_ENTROPY); + if (nbytes != uio->uio_resid && (error == ERESTART || + error == EINTR) ) + error = 0; /* Return partial read, not error. */ + } - sx_sunlock(&random_adaptors_lock); + free(random_buf, M_ENTROPY); + return (error); } @@ -269,6 +275,8 @@ random_adaptor_read_rate(void) { int ret; + sx_assert(&random_adaptors_lock, SA_LOCKED); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); mtx_lock(&random_read_rate_mtx); @@ -287,18 +295,20 @@ random_adaptor_write(struct cdev *dev __unused, st { int c, error = 0; void *random_buf; + ssize_t nbytes; #ifdef RANDOM_DEBUG printf("random: %s %zd\n", __func__, uio->uio_resid); #endif - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); sx_slock(&random_adaptors_lock); - random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - while (uio->uio_resid > 0) { + nbytes = uio->uio_resid; + while (uio->uio_resid > 0 && error == 0) { c = MIN(uio->uio_resid, PAGE_SIZE); error = uiomove(random_buf, c, uio); if (error) @@ -306,13 +316,20 @@ random_adaptor_write(struct cdev *dev __unused, st (random_adaptor->ra_write)(random_buf, c); /* Introduce an annoying delay to stop swamping */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error = sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "block", hz/10); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", + __func__)); } + sx_sunlock(&random_adaptors_lock); + + if (nbytes != uio->uio_resid && (error == ERESTART || + error == EINTR) ) + error = 0; /* Partial write, not error. */ + free(random_buf, M_ENTROPY); - sx_sunlock(&random_adaptors_lock); - return (error); } @@ -325,10 +342,10 @@ random_adaptor_poll(struct cdev *dev __unused, int printf("random: %s\n", __func__); #endif + sx_slock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); - if (events & (POLLIN | POLLRDNORM)) { if (random_adaptor->ra_seeded()) events &= (POLLIN | POLLRDNORM); @@ -382,9 +399,9 @@ random_sysctl_active_adaptor_handler(SYSCTL_HANDLE struct sbuf sbuf; int error; + sx_slock(&random_adaptors_lock); KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); sbuf_new_for_sysctl(&sbuf, NULL, 16, req); LIST_FOREACH(rra, &random_adaptors_list, rra_entries) if (rra->rra_ra == random_adaptor) { @@ -454,9 +471,9 @@ static void random_adaptors_seed(void *unused __unused) { + sx_slock(&random_adaptors_lock); KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); random_adaptor->ra_reseed(); sx_sunlock(&random_adaptors_lock); --------------090504050004050003030801 Content-Type: application/octet-stream; name="random-tsleep.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="random-tsleep.diff.sig" iQIcBAABCgAGBQJUVqR+AAoJEJW2GBstM+ns37wP/iTTXi8vOQwX3a/Rbs74kml917+RlNMI sTzCEiymLTw1eCF458oGAbKx/F03Te964FvaAaL5gvyme39fSon35AnBPwjbgv8gABWjoElQ 1KshqtjLsvrSGyF7ev15dXTugw/J1zRW6d9E6qxE2qU6kLXh8KO3Al8AyRSmOEArB/tvhkyW yu96o9f8pDQjFsrv4uaMg4bMxkbvBg5F0Yo5jNFmihWZDngWykcybTs4+mxP4fKBX8fCfVRJ 0MNXDP6BO/nbzTagMMQaIh3ADwIeccsQDsAbGsfYtuH36cY7FzMIsVske0VvXkAPTUPHi8sc WwlzwsI1jn/zZZHHn8IMR5QqahGmE/wt0lLUNqMRD0le2pZ24xoR6W2DxCBKrwsJOq0p9gkI rjXOyUj1fb5v43+s/+TnrShP0ja+B2MSvYGZigOnO9ykMmxWME4VYBnA5NYPtNlcioJDSAU+ 9JhXvptxW1BGhASsHgaSYk6KbnINHjd3G0z6E3qrSfBsA0bm7j928gQnnlYKTMch4gq3PIYi lGAYnTY/7V6b49ArZHlihPaywxTGhg1b9SLnzUgozhsiYf2WvMta+ORFs1fcqd1hrESqzoJ0 rQjQcbcfZqe/R8kcv7u4cSOFq0SD0r/a+/QG2XVhWiFz1Bg+UT4drX3TbQJe6BJe7ht2CJ5Q VOAP --------------090504050004050003030801-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:40:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B1A466B; Sun, 2 Nov 2014 21:40:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC76944; Sun, 2 Nov 2014 21:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2LeYiN053402; Sun, 2 Nov 2014 21:40:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2LeX2a053396; Sun, 2 Nov 2014 21:40:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022140.sA2LeX2a053396@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 21:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273991 - in head/sys/i386: i386 include linux svr4 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:40:34 -0000 Author: jhb Date: Sun Nov 2 21:40:32 2014 New Revision: 273991 URL: https://svnweb.freebsd.org/changeset/base/273991 Log: MFamd64: Move extern declaration of _ucodesel and _udatasel to Modified: head/sys/i386/i386/vm_machdep.c head/sys/i386/include/md_var.h head/sys/i386/linux/linux_sysvec.c head/sys/i386/svr4/svr4_machdep.c Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sun Nov 2 21:36:40 2014 (r273990) +++ head/sys/i386/i386/vm_machdep.c Sun Nov 2 21:40:32 2014 (r273991) @@ -118,7 +118,6 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif -extern int _ucodesel, _udatasel; /* * Finish a fork operation, with process p2 nearly set up. Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Sun Nov 2 21:36:40 2014 (r273990) +++ head/sys/i386/include/md_var.h Sun Nov 2 21:40:32 2014 (r273991) @@ -78,6 +78,8 @@ extern int szosigcode; extern uint32_t *vm_page_dump; extern int vm_page_dump_size; extern int workaround_erratum383; +extern int _udatasel; +extern int _ucodesel; typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); struct thread; Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Nov 2 21:36:40 2014 (r273990) +++ head/sys/i386/linux/linux_sysvec.c Sun Nov 2 21:40:32 2014 (r273991) @@ -400,7 +400,6 @@ linux_copyout_strings(struct image_param -extern int _ucodesel, _udatasel; extern unsigned long linux_sznonrtsigcode; static void Modified: head/sys/i386/svr4/svr4_machdep.c ============================================================================== --- head/sys/i386/svr4/svr4_machdep.c Sun Nov 2 21:36:40 2014 (r273990) +++ head/sys/i386/svr4/svr4_machdep.c Sun Nov 2 21:40:32 2014 (r273991) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); extern int svr4_szsigcode; extern char svr4_sigcode[]; -extern int _udatasel, _ucodesel; static void svr4_getsiginfo(union svr4_siginfo *, int, u_long, caddr_t); From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:48:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F49687F; Sun, 2 Nov 2014 21:48:15 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0596FA05; Sun, 2 Nov 2014 21:48:15 +0000 (UTC) Received: from zeta.ixsystems.com (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 1EB2714EA1; Sun, 2 Nov 2014 13:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1414964894; x=1414979294; bh=a0zJBfou3CWGMFjsurV3RogtdSyJvn7zUlVejW+qhK0=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=yXIxlIToKv7IbbPJFTHi/yI6dhoDSna/m8gwxWQLKEfDIUMURIV+XMOhWZFInlBMJ Mc24iOMD+okgSW+bXv3xwLoRkvGfX9s7PORMfjlSiONRj/1WBXaFSbdLw2pMsi7lXF ArE7eym1dC1czsL7hhX7mb7H0scT2DvS8M4H01Ho= Message-ID: <5456A69C.6040902@delphij.net> Date: Sun, 02 Nov 2014 13:48:12 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore , d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <5456A47E.2030405@delphij.net> In-Reply-To: <5456A47E.2030405@delphij.net> Content-Type: multipart/mixed; boundary="------------010700040707080307060704" Cc: Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Mark R V Murray X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:48:15 -0000 This is a multi-part message in MIME format. --------------010700040707080307060704 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Another revision to make Jilles happy -- changed 'block' to 'randrd' and 'randwr', I saw his email but forgot to make the change. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJUVqacAAoJEJW2GBstM+nsi2cQAKGiKs+VvTNyTnG3HEYOql3s H08TEloDczU7QyX2UMR/4MtgGTBOjLZ4xCLqvaFqJkHsxjWevW0V4XMryqrwn4B8 zLA68CJb5WsUWtUlVgrMiJnZCYI5SMYzxiUwLQdOc1aBrsEJKKvVxd0DqlF5NoEC K4BhYvACh7tPRi5zDuCa2fjZYV5/Dgw5E46AehuD42JH+dsh4yP5tx6EZhISfig5 maT0rkgDsk8ZAHuf2pESiOvHHudxiiDrRmlNEz24lcgj/JkX4WvtAG+GaAJDwRRp BUgkEWM8FnODFEn2ei4nYzaMqQ62XKzjU6nrzXBBY4/Y2BCAoKsDgYn9vALpwlPq YJxrvMKqeCZiJ9iEHY+4e48FXsj7juaky4QhoJxKA1D3iOvZ7Krkh2cKywfF5Ei4 UNtFgTS/y1m7ATD7GWIXjCyZI8eb9LWPh3hYp7DTh826uR2UWGtucbkZX1rMvD3w lCZcI5PRTSy4B+1jDXEZURkd2JZxDkOlNBQSyTZSiCLLNCVGNFjrMaFuPOLfygiM CRnZptgOsfZO7q4lYj0eafB6VVBeJKVE7ZUodkGNxtSYS5p06a4TIFalWiM6FH4D cwi8lnB11LipDDeNxRz7CtX+tFxugStQadZIdxKBam4edwM5ddoCnT7JjKtdgSU8 7B1Hr3lnLAtz525XLsed =POhM -----END PGP SIGNATURE----- --------------010700040707080307060704 Content-Type: text/plain; charset=UTF-8; name="random-tsleep.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="random-tsleep.diff" SW5kZXg6IHN5cy9kZXYvcmFuZG9tL3JhbmRvbV9hZGFwdG9ycy5jCj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K LS0tIHN5cy9kZXYvcmFuZG9tL3JhbmRvbV9hZGFwdG9ycy5jCShyZXZpc2lvbiAyNzM5ODIp CisrKyBzeXMvZGV2L3JhbmRvbS9yYW5kb21fYWRhcHRvcnMuYwkod29ya2luZyBjb3B5KQpA QCAtMTcxLDkgKzE3MSw4IEBAIHJhbmRvbV9hZGFwdG9yX3JlZ2lzdGVyKGNvbnN0IGNoYXIg Km5hbWUsIHN0cnVjdCByCiAJc3hfeGxvY2soJnJhbmRvbV9hZGFwdG9yc19sb2NrKTsKIAlM SVNUX0lOU0VSVF9IRUFEKCZyYW5kb21fYWRhcHRvcnNfbGlzdCwgcnJhLCBycmFfZW50cmll cyk7CiAJcmFuZG9tX2FkYXB0b3JfY2hvb3NlKCk7CisJS0FTU0VSVChyYW5kb21fYWRhcHRv ciAhPSBOVUxMLCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAlcyIsIF9fZnVuY19f KSk7CiAJc3hfeHVubG9jaygmcmFuZG9tX2FkYXB0b3JzX2xvY2spOwotCi0JS0FTU0VSVChy YW5kb21fYWRhcHRvciAhPSBOVUxMLCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAl cyIsIF9fZnVuY19fKSk7CiB9CiAKIHZvaWQKQEAgLTE4Miw5ICsxODEsOSBAQCByYW5kb21f YWRhcHRvcl9kZXJlZ2lzdGVyKGNvbnN0IGNoYXIgKm5hbWUpCiAJc3RydWN0IHJhbmRvbV9h ZGFwdG9ycyAqcnJhOwogCiAJS0FTU0VSVChuYW1lICE9IE5VTEwsICgiaW52YWxpZCBpbnB1 dCB0byAlcyIsIF9fZnVuY19fKSk7Ci0JS0FTU0VSVChyYW5kb21fYWRhcHRvciAhPSBOVUxM LCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAlcyIsIF9fZnVuY19fKSk7CiAKIAlz eF94bG9jaygmcmFuZG9tX2FkYXB0b3JzX2xvY2spOworCUtBU1NFUlQocmFuZG9tX2FkYXB0 b3IgIT0gTlVMTCwgKCJObyBhY3RpdmUgcmFuZG9tIGFkYXB0b3IgaW4gJXMiLCBfX2Z1bmNf XykpOwogCUxJU1RfRk9SRUFDSChycmEsICZyYW5kb21fYWRhcHRvcnNfbGlzdCwgcnJhX2Vu dHJpZXMpCiAJCWlmIChzdHJjbXAocnJhLT5ycmFfbmFtZSwgbmFtZSkgPT0gMCkgewogCQkJ TElTVF9SRU1PVkUocnJhLCBycmFfZW50cmllcyk7CkBAIC0yMDgsMTYgKzIwNywxOCBAQCBy YW5kb21fYWRhcHRvcl9yZWFkKHN0cnVjdCBjZGV2ICpkZXYgX191bnVzZWQsIHN0cgogCXBy aW50ZigicmFuZG9tOiAlcyAlbGRcbiIsIF9fZnVuY19fLCB1aW8tPnVpb19yZXNpZCk7CiAj ZW5kaWYKIAotCUtBU1NFUlQocmFuZG9tX2FkYXB0b3IgIT0gTlVMTCwgKCJObyBhY3RpdmUg cmFuZG9tIGFkYXB0b3IgaW4gJXMiLCBfX2Z1bmNfXykpOworCXJhbmRvbV9idWYgPSBtYWxs b2MoUEFHRV9TSVpFLCBNX0VOVFJPUFksIE1fV0FJVE9LKTsKIAogCXN4X3Nsb2NrKCZyYW5k b21fYWRhcHRvcnNfbG9jayk7CiAKKwlLQVNTRVJUKHJhbmRvbV9hZGFwdG9yICE9IE5VTEws ICgiTm8gYWN0aXZlIHJhbmRvbSBhZGFwdG9yIGluICVzIiwgX19mdW5jX18pKTsKKwogCS8q IExldCB0aGUgZW50cm9weSBzb3VyY2UgZG8gYW55IHByZS1yZWFkIHNldHVwLiAqLwogCShy YW5kb21fYWRhcHRvci0+cmFfcmVhZCkoTlVMTCwgMCk7CiAKIAkvKiAoVW4pQmxvY2tpbmcg bG9naWMgKi8KIAllcnJvciA9IDA7Ci0Jd2hpbGUgKCFyYW5kb21fYWRhcHRvci0+cmFfc2Vl ZGVkKCkpIHsKKwl3aGlsZSAoIXJhbmRvbV9hZGFwdG9yLT5yYV9zZWVkZWQoKSAmJiBlcnJv ciA9PSAwKSB7CiAJCWlmIChmbGFncyAmIE9fTk9OQkxPQ0spCXsKIAkJCWVycm9yID0gRVdP VUxEQkxPQ0s7CiAJCQlicmVhazsKQEAgLTIyNCw3ICsyMjUsMTAgQEAgcmFuZG9tX2FkYXB0 b3JfcmVhZChzdHJ1Y3QgY2RldiAqZGV2IF9fdW51c2VkLCBzdHIKIAkJfQogCiAJCS8qIFNs ZWVwIGluc3RlYWQgb2YgZ29pbmcgaW50byBhIHNwaW4tZnJlbnp5ICovCi0JCXRzbGVlcCgm cmFuZG9tX2FkYXB0b3IsIFBVU0VSIHwgUENBVENILCAiYmxvY2siLCBoei8xMCk7CisJCWVy cm9yID0gc3hfc2xlZXAoJnJhbmRvbV9hZGFwdG9yLCAmcmFuZG9tX2FkYXB0b3JzX2xvY2ss CisJCSAgICBQVVNFUiB8IFBDQVRDSCwgInJhbmRyZCIsIGh6LzEwKTsKKwkJS0FTU0VSVChy YW5kb21fYWRhcHRvciAhPSBOVUxMLCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAl cyIsCisJCSAgICBfX2Z1bmNfXykpOwogCiAJCS8qIGtlZXAgdGFwcGluZyBhd2F5IGF0IHRo ZSBwcmUtcmVhZCB1bnRpbCB3ZSBzZWVkL3VuYmxvY2suICovCiAJCShyYW5kb21fYWRhcHRv ci0+cmFfcmVhZCkoTlVMTCwgMCk7CkBAIC0yNDEsMTIgKzI0NSwxMCBAQCByYW5kb21fYWRh cHRvcl9yZWFkKHN0cnVjdCBjZGV2ICpkZXYgX191bnVzZWQsIHN0cgogCiAJbXR4X3VubG9j aygmcmFuZG9tX3JlYWRfcmF0ZV9tdHgpOwogCi0JaWYgKCFlcnJvcikgeworCWlmIChlcnJv ciA9PSAwKSB7CisJCW5ieXRlcyA9IHVpby0+dWlvX3Jlc2lkOwogCiAJCS8qIFRoZSBhY3R1 YWwgcmVhZCAqLwotCi0JCXJhbmRvbV9idWYgPSBtYWxsb2MoUEFHRV9TSVpFLCBNX0VOVFJP UFksIE1fV0FJVE9LKTsKLQogCQl3aGlsZSAodWlvLT51aW9fcmVzaWQgJiYgIWVycm9yKSB7 CiAJCQljID0gTUlOKHVpby0+dWlvX3Jlc2lkLCBQQUdFX1NJWkUpOwogCQkJKHJhbmRvbV9h ZGFwdG9yLT5yYV9yZWFkKShyYW5kb21fYnVmLCBjKTsKQEAgLTI1NiwxMSArMjU4LDE1IEBA IHJhbmRvbV9hZGFwdG9yX3JlYWQoc3RydWN0IGNkZXYgKmRldiBfX3VudXNlZCwgc3RyCiAJ CS8qIExldCB0aGUgZW50cm9weSBzb3VyY2UgZG8gYW55IHBvc3QtcmVhZCBjbGVhbnVwLiAq LwogCQkocmFuZG9tX2FkYXB0b3ItPnJhX3JlYWQpKE5VTEwsIDEpOwogCi0JCWZyZWUocmFu ZG9tX2J1ZiwgTV9FTlRST1BZKTsKKwkJaWYgKG5ieXRlcyAhPSB1aW8tPnVpb19yZXNpZCAm JiAoZXJyb3IgPT0gRVJFU1RBUlQgfHwKKwkJICAgIGVycm9yID09IEVJTlRSKSApCisJCQll cnJvciA9IDA7CS8qIFJldHVybiBwYXJ0aWFsIHJlYWQsIG5vdCBlcnJvci4gKi8KKwogCX0K LQogCXN4X3N1bmxvY2soJnJhbmRvbV9hZGFwdG9yc19sb2NrKTsKIAorCWZyZWUocmFuZG9t X2J1ZiwgTV9FTlRST1BZKTsKKwogCXJldHVybiAoZXJyb3IpOwogfQogCkBAIC0yNjksNiAr Mjc1LDggQEAgcmFuZG9tX2FkYXB0b3JfcmVhZF9yYXRlKHZvaWQpCiB7CiAJaW50IHJldDsK IAorCXN4X2Fzc2VydCgmcmFuZG9tX2FkYXB0b3JzX2xvY2ssIFNBX0xPQ0tFRCk7CisKIAlL QVNTRVJUKHJhbmRvbV9hZGFwdG9yICE9IE5VTEwsICgiTm8gYWN0aXZlIHJhbmRvbSBhZGFw dG9yIGluICVzIiwgX19mdW5jX18pKTsKIAogCW10eF9sb2NrKCZyYW5kb21fcmVhZF9yYXRl X210eCk7CkBAIC0yODcsMTggKzI5NSwyMCBAQCByYW5kb21fYWRhcHRvcl93cml0ZShzdHJ1 Y3QgY2RldiAqZGV2IF9fdW51c2VkLCBzdAogewogCWludCBjLCBlcnJvciA9IDA7CiAJdm9p ZCAqcmFuZG9tX2J1ZjsKKwlzc2l6ZV90IG5ieXRlczsKIAogI2lmZGVmIFJBTkRPTV9ERUJV RwogCXByaW50ZigicmFuZG9tOiAlcyAlemRcbiIsIF9fZnVuY19fLCB1aW8tPnVpb19yZXNp ZCk7CiAjZW5kaWYKIAotCUtBU1NFUlQocmFuZG9tX2FkYXB0b3IgIT0gTlVMTCwgKCJObyBh Y3RpdmUgcmFuZG9tIGFkYXB0b3IgaW4gJXMiLCBfX2Z1bmNfXykpOworCXJhbmRvbV9idWYg PSBtYWxsb2MoUEFHRV9TSVpFLCBNX0VOVFJPUFksIE1fV0FJVE9LKTsKIAogCXN4X3Nsb2Nr KCZyYW5kb21fYWRhcHRvcnNfbG9jayk7CiAKLQlyYW5kb21fYnVmID0gbWFsbG9jKFBBR0Vf U0laRSwgTV9FTlRST1BZLCBNX1dBSVRPSyk7CisJS0FTU0VSVChyYW5kb21fYWRhcHRvciAh PSBOVUxMLCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAlcyIsIF9fZnVuY19fKSk7 CiAKLQl3aGlsZSAodWlvLT51aW9fcmVzaWQgPiAwKSB7CisJbmJ5dGVzID0gdWlvLT51aW9f cmVzaWQ7CisJd2hpbGUgKHVpby0+dWlvX3Jlc2lkID4gMCAmJiBlcnJvciA9PSAwKSB7CiAJ CWMgPSBNSU4odWlvLT51aW9fcmVzaWQsIFBBR0VfU0laRSk7CiAJCWVycm9yID0gdWlvbW92 ZShyYW5kb21fYnVmLCBjLCB1aW8pOwogCQlpZiAoZXJyb3IpCkBAIC0zMDYsMTMgKzMxNiwy MCBAQCByYW5kb21fYWRhcHRvcl93cml0ZShzdHJ1Y3QgY2RldiAqZGV2IF9fdW51c2VkLCBz dAogCQkocmFuZG9tX2FkYXB0b3ItPnJhX3dyaXRlKShyYW5kb21fYnVmLCBjKTsKIAogCQkv KiBJbnRyb2R1Y2UgYW4gYW5ub3lpbmcgZGVsYXkgdG8gc3RvcCBzd2FtcGluZyAqLwotCQl0 c2xlZXAoJnJhbmRvbV9hZGFwdG9yLCBQVVNFUiB8IFBDQVRDSCwgImJsb2NrIiwgaHovMTAp OworCQllcnJvciA9IHN4X3NsZWVwKCZyYW5kb21fYWRhcHRvciwgJnJhbmRvbV9hZGFwdG9y c19sb2NrLAorCQkgICAgUFVTRVIgfCBQQ0FUQ0gsICJyYW5kd3IiLCBoei8xMCk7CisJCUtB U1NFUlQocmFuZG9tX2FkYXB0b3IgIT0gTlVMTCwgKCJObyBhY3RpdmUgcmFuZG9tIGFkYXB0 b3IgaW4gJXMiLAorCQkgICAgX19mdW5jX18pKTsKIAl9CiAKKwlzeF9zdW5sb2NrKCZyYW5k b21fYWRhcHRvcnNfbG9jayk7CisKKwlpZiAobmJ5dGVzICE9IHVpby0+dWlvX3Jlc2lkICYm IChlcnJvciA9PSBFUkVTVEFSVCB8fAorCSAgICBlcnJvciA9PSBFSU5UUikgKQorCQllcnJv ciA9IDA7CS8qIFBhcnRpYWwgd3JpdGUsIG5vdCBlcnJvci4gKi8KKwogCWZyZWUocmFuZG9t X2J1ZiwgTV9FTlRST1BZKTsKIAotCXN4X3N1bmxvY2soJnJhbmRvbV9hZGFwdG9yc19sb2Nr KTsKLQogCXJldHVybiAoZXJyb3IpOwogfQogCkBAIC0zMjUsMTAgKzM0MiwxMCBAQCByYW5k b21fYWRhcHRvcl9wb2xsKHN0cnVjdCBjZGV2ICpkZXYgX191bnVzZWQsIGludAogCXByaW50 ZigicmFuZG9tOiAlc1xuIiwgX19mdW5jX18pOwogI2VuZGlmCiAKKwlzeF9zbG9jaygmcmFu ZG9tX2FkYXB0b3JzX2xvY2spOworCiAJS0FTU0VSVChyYW5kb21fYWRhcHRvciAhPSBOVUxM LCAoIk5vIGFjdGl2ZSByYW5kb20gYWRhcHRvciBpbiAlcyIsIF9fZnVuY19fKSk7CiAKLQlz eF9zbG9jaygmcmFuZG9tX2FkYXB0b3JzX2xvY2spOwotCiAJaWYgKGV2ZW50cyAmIChQT0xM SU4gfCBQT0xMUkROT1JNKSkgewogCQlpZiAocmFuZG9tX2FkYXB0b3ItPnJhX3NlZWRlZCgp KQogCQkJZXZlbnRzICY9IChQT0xMSU4gfCBQT0xMUkROT1JNKTsKQEAgLTM4Miw5ICszOTks OSBAQCByYW5kb21fc3lzY3RsX2FjdGl2ZV9hZGFwdG9yX2hhbmRsZXIoU1lTQ1RMX0hBTkRM RQogCXN0cnVjdCBzYnVmIHNidWY7CiAJaW50IGVycm9yOwogCisJc3hfc2xvY2soJnJhbmRv bV9hZGFwdG9yc19sb2NrKTsKIAlLQVNTRVJUKHJhbmRvbV9hZGFwdG9yICE9IE5VTEwsICgi Tm8gYWN0aXZlIHJhbmRvbSBhZGFwdG9yIGluICVzIiwgX19mdW5jX18pKTsKIAotCXN4X3Ns b2NrKCZyYW5kb21fYWRhcHRvcnNfbG9jayk7CiAJc2J1Zl9uZXdfZm9yX3N5c2N0bCgmc2J1 ZiwgTlVMTCwgMTYsIHJlcSk7CiAJTElTVF9GT1JFQUNIKHJyYSwgJnJhbmRvbV9hZGFwdG9y c19saXN0LCBycmFfZW50cmllcykKIAkJaWYgKHJyYS0+cnJhX3JhID09IHJhbmRvbV9hZGFw dG9yKSB7CkBAIC00NTQsOSArNDcxLDkgQEAgc3RhdGljIHZvaWQKIHJhbmRvbV9hZGFwdG9y c19zZWVkKHZvaWQgKnVudXNlZCBfX3VudXNlZCkKIHsKICAKKwlzeF9zbG9jaygmcmFuZG9t X2FkYXB0b3JzX2xvY2spOwogCUtBU1NFUlQocmFuZG9tX2FkYXB0b3IgIT0gTlVMTCwgKCJO byBhY3RpdmUgcmFuZG9tIGFkYXB0b3IgaW4gJXMiLCBfX2Z1bmNfXykpOwogCi0Jc3hfc2xv Y2soJnJhbmRvbV9hZGFwdG9yc19sb2NrKTsKIAlyYW5kb21fYWRhcHRvci0+cmFfcmVzZWVk KCk7CiAJc3hfc3VubG9jaygmcmFuZG9tX2FkYXB0b3JzX2xvY2spOwogCg== --------------010700040707080307060704 Content-Type: application/octet-stream; name="random-tsleep.diff.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="random-tsleep.diff.sig" iQIcBAABCgAGBQJUVqacAAoJEJW2GBstM+nsn/QP+wQGlivJ5VW+x0jtuPimFu+QTsVkQE15 N2l+c7BW8EF55iqE7s7zHmo824+LUdF2U2sY5lj/PRG9Rrb6ATt1jNCJhYH6wFdKRwWgXACo bB011nSytp+vLT4aPZXdvbWwPzbD0zGrswQgjyYQdTQDnevCo4Fm9W1citI4auxEurhzcU++ E5xLSncJWxRv0dQUMCFOt2tH1rCpXaC21ocCCq+BJZ8nS7SCNuOjGvgUqJOQ/WHpVcWMShmn 7ommD9YTGQ9I1axoExtFT58Kr63Fiy3Q1MlzRPqUQ+NOitI1O5+CZvLUCY9tDOuM4AAIjO7j dArEUEhtfbDVzXSwjxquJWXFFT8K/jcEaylRjAWEnv27aWXPjL4GFRDdC/Xavs5XBlvvNaMQ QKPHyZHCWnQ5u3msBKCJfq5JFL0IRKJcPsB3gJ010LmSmKa2SyEx16ReQY6EGZIDGox5oDl5 rnRaJzDK/Z+4hB4c021qyDv9tzJwDoiHw+QzCBG5gtHrJAPneN0lLbn6RkNciKKbf98nmjgy KxPHZ4eCnRGcb1d9yxyrHMEeuRSNWB2aRovbXq5Ct8teRvhSyhZgsBuMG5GkA74RNHKixd8T 5l8p/wbPnPcdLvUIu4IQ2CFEhcF7XDRv+BeijWQo2Of3LIuK43+F+80pOsDJld192ALZNY57 hzO2 --------------010700040707080307060704-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 21:58:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7EE6DA07; Sun, 2 Nov 2014 21:58:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 518DBAC3; Sun, 2 Nov 2014 21:58:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2LwWcw059452; Sun, 2 Nov 2014 21:58:32 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2LwWGc059451; Sun, 2 Nov 2014 21:58:32 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201411022158.sA2LwWGc059451@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 2 Nov 2014 21:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273992 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 21:58:32 -0000 Author: hrs Date: Sun Nov 2 21:58:31 2014 New Revision: 273992 URL: https://svnweb.freebsd.org/changeset/base/273992 Log: Fix a bug which prevented ND6_IFF_IFDISABLED flag from clearing when the newly-added IPv6 address was /128. PR: 188032 Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Sun Nov 2 21:40:32 2014 (r273991) +++ head/sys/netinet6/in6.c Sun Nov 2 21:58:31 2014 (r273992) @@ -638,7 +638,8 @@ in6_control(struct socket *so, u_long cm pr0.ndpr_plen = in6_mask2len(&ifra->ifra_prefixmask.sin6_addr, NULL); if (pr0.ndpr_plen == 128) { - break; /* we don't need to install a host route. */ + /* we don't need to install a host route. */ + goto aifaddr_out; } pr0.ndpr_prefix = ifra->ifra_addr; /* apply the mask for safety. */ @@ -705,32 +706,29 @@ in6_control(struct socket *so, u_long cm * that is, this address might make other addresses detached. */ pfxlist_onlink_check(); - if (error == 0 && ia) { - if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { - /* - * Try to clear the flag when a new - * IPv6 address is added onto an - * IFDISABLED interface and it - * succeeds. - */ - struct in6_ndireq nd; - - memset(&nd, 0, sizeof(nd)); - nd.ndi.flags = ND_IFINFO(ifp)->flags; - nd.ndi.flags &= ~ND6_IFF_IFDISABLED; - if (nd6_ioctl(SIOCSIFINFO_FLAGS, - (caddr_t)&nd, ifp) < 0) - log(LOG_NOTICE, "SIOCAIFADDR_IN6: " - "SIOCSIFINFO_FLAGS for -ifdisabled " - "failed."); - /* - * Ignore failure of clearing the flag - * intentionally. The failure means - * address duplication was detected. - */ - } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); +aifaddr_out: + if (error != 0 || ia == NULL) + break; + /* + * Try to clear the flag when a new IPv6 address is added + * onto an IFDISABLED interface and it succeeds. + */ + if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) { + struct in6_ndireq nd; + + memset(&nd, 0, sizeof(nd)); + nd.ndi.flags = ND_IFINFO(ifp)->flags; + nd.ndi.flags &= ~ND6_IFF_IFDISABLED; + if (nd6_ioctl(SIOCSIFINFO_FLAGS, (caddr_t)&nd, ifp) < 0) + log(LOG_NOTICE, "SIOCAIFADDR_IN6: " + "SIOCSIFINFO_FLAGS for -ifdisabled " + "failed."); + /* + * Ignore failure of clearing the flag intentionally. + * The failure means address duplication was detected. + */ } + EVENTHANDLER_INVOKE(ifaddr_event, ifp); break; } From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 22:38:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7190EFE9; Sun, 2 Nov 2014 22:38:00 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEE12E01; Sun, 2 Nov 2014 22:37:59 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so11203348wgg.8 for ; Sun, 02 Nov 2014 14:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=1O17jyQP5qtgv8tlaVGEQfml/hfWhBlTuSn65pgxLjw=; b=NsIsLND0kmNbeRUUdIqd7G2oz3itDKcUBD6PvQE+UO/+HrH1b/8SsAO7yAthpuE6rH OIrXUNNarvH4tYcQ2d9IqoqzZSsHQJYhpNSKeO91thkViGA1thLYSvymaegHwP+IXcef IYNaWmIpQ+24q+NOCJyFeomwTO6z0rYvsewVewzGes2h9MpqQcy04gyKKBgE+X+UAG66 wMln9zbRkxr912kDV6ti8DlBXBCxT81CM6ZUhN74k9O/yL8/2lkEUCFBAtKLfeZP9Icz b2aCN/8az1ggqwPw0ZUD4hsT9OeWVGA3cGleJaQiMOx/l4F6nCvpxmNGVTbW0rL0+hec sWfw== MIME-Version: 1.0 X-Received: by 10.180.19.234 with SMTP id i10mr12470034wie.28.1414967878070; Sun, 02 Nov 2014 14:37:58 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Sun, 2 Nov 2014 14:37:57 -0800 (PST) In-Reply-To: <20141102213819.GF53947@kib.kiev.ua> References: <201411021310.sA2DAWmD003298@svn.freebsd.org> <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> <20141102213819.GF53947@kib.kiev.ua> Date: Sun, 2 Nov 2014 23:37:57 +0100 X-Google-Sender-Auth: GwaoGpbj76ZJUJhV4ISIQi8gYJk Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 22:38:00 -0000 On Sun, Nov 2, 2014 at 10:38 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 10:17:26PM +0100, Attilio Rao wrote: >> On Sun, Nov 2, 2014 at 8:10 PM, Konstantin Belousov wrote: >> > On Sun, Nov 02, 2014 at 06:53:44PM +0100, Attilio Rao wrote: >> >> > I did not proposed to verify owner chain. I said that it is easy to >> >> > record the locks owned by current thread, only for current thread >> >> > consumption. Below is the prototype. >> >> >> >> I think it is too expensive, think that this must happen for every shared lock. >> >> I know we may not be using too many shared locks on lockmgr right now, >> >> but it is not a good reason to make shared lock bloated and more >> >> expensive on lockmgr. >> > >> > It can be significantly simplified, if the array of lock pointers is >> > kept dense. Then the only non-trivial operation is unlock out of order, >> > when the array have to be compacted. >> > >> > The code adds one write and n reads on shared lock, where n is the >> > number of shared-locked locks already owned by thread. Typical n is 0 >> > or 1. On unlock, if done in order, the code adds one read; unordered >> > unlock shuffles array elements. Again, for typical lock nesting of 2, >> > this means one read and one write, and even this is rare. All reads and >> > writes are for thread-local memory. >> > >> > I am not going to spend any more time on this if people do not consider >> > the lock tracking worth it. Otherwise, I will benchmark the patch. >> >> I think that your initial patch (what is in head now) is a better approach. >> I would just make it a lockinit() flag to make it less alien to the KPI. >> > > Ok. > > Can you explain what would the proposed lockinit() flag do ? What should > it change comparing with the current code ? You now provide LK_NODDLKTREAT on a call basis. The lockinit() flag would embed this into the lock attribute and make it always real, without the need for the callers to provide LK_NODDLKTREAT on a call basis. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 22:41:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DA5D1CD; Sun, 2 Nov 2014 22:41:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18EA3EA6; Sun, 2 Nov 2014 22:41:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2Mftq6082175; Sun, 2 Nov 2014 22:41:55 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2MftVO082173; Sun, 2 Nov 2014 22:41:55 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201411022241.sA2MftVO082173@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Sun, 2 Nov 2014 22:41: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: r273993 - in stable/10: etc share/man/man8 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 22:41:56 -0000 Author: hrs Date: Sun Nov 2 22:41:55 2014 New Revision: 273993 URL: https://svnweb.freebsd.org/changeset/base/273993 Log: MFC r272974,272976: Add ${name}_env and ${name}_prepend. ${name}_env is an argument list which will be passed to env(1). ${name}_prepend is simply prepended to the command line for $command. Modified: stable/10/etc/rc.subr stable/10/share/man/man8/rc.subr.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.subr ============================================================================== --- stable/10/etc/rc.subr Sun Nov 2 21:58:31 2014 (r273992) +++ stable/10/etc/rc.subr Sun Nov 2 22:41:55 2014 (r273993) @@ -749,6 +749,8 @@ check_startmsgs() # NOTE: $flags from the parent environment # can be used to override this. # +# ${name}_env n Environment variables to run ${command} with. +# # ${name}_fib n Routing table number to run ${command} with. # # ${name}_nice n Nice level to run ${command} at. @@ -764,6 +766,8 @@ check_startmsgs() # to run the chrooted ${command} with. # Requires /usr to be mounted. # +# ${name}_prepend n Command added before ${command}. +# # ${rc_arg}_cmd n If set, use this as the method when invoked; # Otherwise, use default command (see below) # @@ -937,7 +941,8 @@ run_rc_command() eval _chdir=\$${name}_chdir _chroot=\$${name}_chroot \ _nice=\$${name}_nice _user=\$${name}_user \ _group=\$${name}_group _groups=\$${name}_groups \ - _fib=\$${name}_fib + _fib=\$${name}_fib _env=\$${name}_env \ + _prepend=\$${name}_prepend if [ -n "$_user" ]; then # unset $_user if running as that user if [ "$_user" = "$(eval $IDCMD)" ]; then @@ -1022,12 +1027,14 @@ run_rc_command() _doit="\ ${_nice:+nice -n $_nice }\ ${_fib:+setfib -F $_fib }\ +${_env:+env $_env }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else _doit="\ ${_chdir:+cd $_chdir && }\ ${_fib:+setfib -F $_fib }\ +${_env:+env $_env }\ $command $rc_flags $command_args" if [ -n "$_user" ]; then _doit="su -m $_user -c 'sh -c \"$_doit\"'" @@ -1038,6 +1045,9 @@ $command $rc_flags $command_args" fi _doit="nice -n $_nice $_doit" fi + if [ -n "$_prepend" ]; then + _doit="$_prepend $_doit" + fi fi # run the full command @@ -2040,7 +2050,7 @@ check_kern_features() # check_namevarlist var # Return "0" if ${name}_var is reserved in rc.subr. -_rc_namevarlist="program chroot chdir flags fib nice user group groups" +_rc_namevarlist="program chroot chdir env flags fib nice user group groups prepend" check_namevarlist() { local _v Modified: stable/10/share/man/man8/rc.subr.8 ============================================================================== --- stable/10/share/man/man8/rc.subr.8 Sun Nov 2 21:58:31 2014 (r273992) +++ stable/10/share/man/man8/rc.subr.8 Sun Nov 2 22:41:55 2014 (r273993) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2012 +.Dd October 12, 2014 .Dt RC.SUBR 8 .Os .Sh NAME @@ -568,6 +568,22 @@ to before running Only supported after .Pa /usr is mounted. +.It Va ${name}_env +A list of environment variables to run +.Va command +with. +This will be passed as arguments to +.Xr env 1 +utility. +.It Va ${name}_fib +FIB +.Pa Routing Table +number to run +.Va command +with. +See +.Xr setfib 1 +for more details. .It Va ${name}_flags Arguments to call .Va command @@ -622,6 +638,14 @@ as. Comma separated list of supplementary groups to run the chrooted .Va command with. +.It Va ${name}_prepend +Commands to be prepended to +.Va command . +This is a generic version of +.Va ${name}_env , +.Va ${name}_fib , +or +.Va ${name}_nice . .It Ar argument Ns Va _cmd Shell commands which override the default method for .Ar argument . From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 22:49:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E89E3558; Sun, 2 Nov 2014 22:49:39 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51834EE0; Sun, 2 Nov 2014 22:49:39 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA2MnY5X060444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 00:49:34 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA2MnY5X060444 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA2MnYm5060443; Mon, 3 Nov 2014 00:49:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Nov 2014 00:49:34 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141102224934.GG53947@kib.kiev.ua> References: <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> <20141102213819.GF53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 22:49:40 -0000 On Sun, Nov 02, 2014 at 11:37:57PM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 10:38 PM, Konstantin Belousov > wrote: > > On Sun, Nov 02, 2014 at 10:17:26PM +0100, Attilio Rao wrote: > >> I think that your initial patch (what is in head now) is a better approach. > >> I would just make it a lockinit() flag to make it less alien to the KPI. > >> > > > > Ok. > > > > Can you explain what would the proposed lockinit() flag do ? What should > > it change comparing with the current code ? > > You now provide LK_NODDLKTREAT on a call basis. > The lockinit() flag would embed this into the lock attribute and make > it always real, without the need for the callers to provide > LK_NODDLKTREAT on a call basis. Am I reading your proposal right ? Do you mean, that for all vnodes, I should disable exclusive starvation avoidance at all ? I completely disagree with this. From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 22:58:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0CB78C4; Sun, 2 Nov 2014 22:58:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAD6AFA9; Sun, 2 Nov 2014 22:58:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2MwYbV087817; Sun, 2 Nov 2014 22:58:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2MwUSp087794; Sun, 2 Nov 2014 22:58:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022258.sA2MwUSp087794@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 22:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273995 - in head/sys: amd64/amd64 i386/i386 i386/include i386/isa i386/linux 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 22:58:35 -0000 Author: jhb Date: Sun Nov 2 22:58:30 2014 New Revision: 273995 URL: https://svnweb.freebsd.org/changeset/base/273995 Log: MFamd64: Add support for extended FPU states on i386. This includes support for AVX on i386. - Similar to amd64, move the FPU save area out of the PCB and instead store saved FPU state in a variable-sized buffer after the PCB on the stack. - To support the variable PCB location, alter the locore code to only use the bottom-most page of proc0stack for init386(). init386() returns the correct stack pointer to locore which adjusts the stack for thread0 before calling mi_startup(). - Don't bother setting cr3 in thread0's pcb in locore before calling init386(). It wasn't used (init386() overwrote it at the end) and it doesn't work with the variable-sized FPU save area. - Remove the new-bus attachment from npx. This was only ever useful for external co-processors using IRQ13, but those have not been supported for several years. npxinit() is now called much earlier during boot (init386()) similar to amd64. - Implement PT_{GET,SET}XSTATE and I386_GET_XFPUSTATE. - npxsave() is now only called from context switch contexts so it can use XSAVEOPT. Differential Revision: https://reviews.freebsd.org/D1058 Reviewed by: kib Tested on: FreeBSD/i386 VM under bhyve on Intel i5-2520 Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/genassym.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/locore.s head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/ptrace_machdep.c head/sys/i386/i386/sys_machdep.c head/sys/i386/i386/trap.c head/sys/i386/i386/vm_machdep.c head/sys/i386/include/cpufunc.h head/sys/i386/include/md_var.h head/sys/i386/include/npx.h head/sys/i386/include/pcb.h head/sys/i386/isa/npx.c head/sys/i386/linux/linux_ptrace.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/amd64/amd64/genassym.c Sun Nov 2 22:58:30 2014 (r273995) @@ -156,8 +156,6 @@ ASSYM(PCB_ONFAULT, offsetof(struct pcb, ASSYM(PCB_GS32SD, offsetof(struct pcb, pcb_gs32sd)); ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp)); ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); -ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu)); -ASSYM(PCB_USERFPU, sizeof(struct pcb)); ASSYM(PCB_EFER, offsetof(struct pcb, pcb_efer)); ASSYM(PCB_STAR, offsetof(struct pcb, pcb_star)); ASSYM(PCB_LSTAR, offsetof(struct pcb, pcb_lstar)); Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/amd64/amd64/sys_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -319,7 +319,7 @@ sysarch(td, uap) fpugetregs(td); error = copyout((char *)(get_pcb_user_save_td(td) + 1), a64xfpu.addr, a64xfpu.len); - return (error); + break; default: error = EINVAL; Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/amd64/amd64/vm_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -127,7 +127,7 @@ get_pcb_td(struct thread *td) void * alloc_fpusave(int flags) { - struct pcb *res; + void *res; struct savefpu_ymm *sf; res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags); Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/genassym.c Sun Nov 2 22:58:30 2014 (r273995) @@ -144,7 +144,6 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_ ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); -ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save)); ASSYM(PCB_PSL, offsetof(struct pcb, pcb_psl)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_EXT, offsetof(struct pcb, pcb_ext)); @@ -154,7 +153,6 @@ ASSYM(PCB_GSD, offsetof(struct pcb, pcb_ ASSYM(PCB_VM86, offsetof(struct pcb, pcb_vm86)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save)); -ASSYM(PCB_SAVEFPU_SIZE, sizeof(union savefpu)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_SIZE, sizeof(struct pcb)); Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/initcpu.c Sun Nov 2 22:58:30 2014 (r273995) @@ -102,6 +102,7 @@ u_int cpu_mxcsr_mask; /* Valid bits in #endif u_int cpu_clflush_line_size = 32; u_int cpu_stdext_feature; +u_int cpu_max_ext_state_size; u_int cpu_mon_mwait_flags; /* MONITOR/MWAIT flags (CPUID.05H.ECX) */ u_int cpu_mon_min_size; /* MONITOR minimum range size, bytes */ u_int cpu_mon_max_size; /* MONITOR minimum range size, bytes */ Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/locore.s Sun Nov 2 22:58:30 2014 (r273995) @@ -302,17 +302,14 @@ NON_GPROF_ENTRY(btext) begin: /* set up bootstrap stack */ movl proc0kstack,%eax /* location of in-kernel stack */ - /* bootstrap stack end location */ - leal (KSTACK_PAGES*PAGE_SIZE-PCB_SIZE)(%eax),%esp - xorl %ebp,%ebp /* mark end of frames */ + /* + * Only use bottom page for init386(). init386() calculates the + * PCB + FPU save area size and returns the true top of stack. + */ + leal PAGE_SIZE(%eax),%esp -#ifdef PAE - movl IdlePDPT,%esi -#else - movl IdlePTD,%esi -#endif - movl %esi,(KSTACK_PAGES*PAGE_SIZE-PCB_SIZE+PCB_CR3)(%eax) + xorl %ebp,%ebp /* mark end of frames */ pushl physfree /* value of first for init386(first) */ call init386 /* wire 386 chip for unix operation */ @@ -324,6 +321,9 @@ begin: */ addl $4,%esp + /* Switch to true top of stack. */ + movl %eax,%esp + call mi_startup /* autoconfiguration, mountroot etc */ /* NOTREACHED */ addl $0,%esp /* for db_numargs() again */ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -181,7 +181,7 @@ extern unsigned long physfree; /* Sanity check for __curthread() */ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); -extern void init386(int first); +extern register_t init386(int first); extern void dblfault_handler(void); #define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) @@ -193,8 +193,10 @@ extern void dblfault_handler(void); static void cpu_startup(void *); static void fpstate_drop(struct thread *td); -static void get_fpcontext(struct thread *td, mcontext_t *mcp); -static int set_fpcontext(struct thread *td, const mcontext_t *mcp); +static void get_fpcontext(struct thread *td, mcontext_t *mcp, + char *xfpusave, size_t xfpusave_len); +static int set_fpcontext(struct thread *td, const mcontext_t *mcp, + char *xfpustate, size_t xfpustate_len); #ifdef CPU_ENABLE_SSE static void set_fpregs_xmm(struct save87 *, struct savexmm *); static void fill_fpregs_xmm(struct savexmm *, struct save87 *); @@ -363,7 +365,7 @@ cpu_startup(dummy) * Send an interrupt to process. * * Stack is set up to allow sigcode stored - * at top to call routine, followed by kcall + * at top to call routine, followed by call * to sigreturn routine below. After sigreturn * resets the signal mask, the stack, and the * frame pointer, it returns to the user @@ -642,6 +644,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, char *sp; struct trapframe *regs; struct segment_descriptor *sdp; + char *xfpusave; + size_t xfpusave_len; int sig; int oonstack; @@ -666,6 +670,14 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs = td->td_frame; oonstack = sigonstack(regs->tf_esp); + if (cpu_max_ext_state_size > sizeof(union savefpu) && use_xsave) { + xfpusave_len = cpu_max_ext_state_size - sizeof(union savefpu); + xfpusave = __builtin_alloca(xfpusave_len); + } else { + xfpusave_len = 0; + xfpusave = NULL; + } + /* Save user context. */ bzero(&sf, sizeof(sf)); sf.sf_uc.uc_sigmask = *mask; @@ -676,7 +688,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_gs = rgs(); bcopy(regs, &sf.sf_uc.uc_mcontext.mc_fs, sizeof(*regs)); sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ - get_fpcontext(td, &sf.sf_uc.uc_mcontext); + get_fpcontext(td, &sf.sf_uc.uc_mcontext, xfpusave, xfpusave_len); fpstate_drop(td); /* * Unconditionally fill the fsbase and gsbase into the mcontext. @@ -687,7 +699,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sdp = &td->td_pcb->pcb_gsd; sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; - sf.sf_uc.uc_mcontext.mc_flags = 0; bzero(sf.sf_uc.uc_mcontext.mc_spare2, sizeof(sf.sf_uc.uc_mcontext.mc_spare2)); bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__)); @@ -695,13 +706,19 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = td->td_sigstk.ss_sp + - td->td_sigstk.ss_size - sizeof(struct sigframe); + sp = td->td_sigstk.ss_sp + td->td_sigstk.ss_size; #if defined(COMPAT_43) td->td_sigstk.ss_flags |= SS_ONSTACK; #endif } else - sp = (char *)regs->tf_esp - sizeof(struct sigframe); + sp = (char *)regs->tf_esp - 128; + if (xfpusave != NULL) { + sp -= xfpusave_len; + sp = (char *)((unsigned int)sp & ~0x3F); + sf.sf_uc.uc_mcontext.mc_xfpustate = (register_t)sp; + } + sp -= sizeof(struct sigframe); + /* Align to 16 bytes. */ sfp = (struct sigframe *)((unsigned int)sp & ~0xF); @@ -762,7 +779,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* * Copy the sigframe out to the user's stack. */ - if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { + if (copyout(&sf, sfp, sizeof(*sfp)) != 0 || + (xfpusave != NULL && copyout(xfpusave, + (void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len) + != 0)) { #ifdef DEBUG printf("process %ld has trashed its stack\n", (long)p->p_pid); #endif @@ -1022,11 +1042,16 @@ sys_sigreturn(td, uap) } */ *uap; { ucontext_t uc; + struct proc *p; struct trapframe *regs; ucontext_t *ucp; + char *xfpustate; + size_t xfpustate_len; int cs, eflags, error, ret; ksiginfo_t ksi; + p = td->td_proc; + error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) return (error); @@ -1101,7 +1126,30 @@ sys_sigreturn(td, uap) return (EINVAL); } - ret = set_fpcontext(td, &ucp->uc_mcontext); + if ((uc.uc_mcontext.mc_flags & _MC_HASFPXSTATE) != 0) { + xfpustate_len = uc.uc_mcontext.mc_xfpustate_len; + if (xfpustate_len > cpu_max_ext_state_size - + sizeof(union savefpu)) { + uprintf( + "pid %d (%s): sigreturn xfpusave_len = 0x%zx\n", + p->p_pid, td->td_name, xfpustate_len); + return (EINVAL); + } + xfpustate = __builtin_alloca(xfpustate_len); + error = copyin((const void *)uc.uc_mcontext.mc_xfpustate, + xfpustate, xfpustate_len); + if (error != 0) { + uprintf( + "pid %d (%s): sigreturn copying xfpustate failed\n", + p->p_pid, td->td_name); + return (error); + } + } else { + xfpustate = NULL; + xfpustate_len = 0; + } + ret = set_fpcontext(td, &ucp->uc_mcontext, xfpustate, + xfpustate_len); if (ret != 0) return (ret); bcopy(&ucp->uc_mcontext.mc_fs, regs, sizeof(*regs)); @@ -1599,7 +1647,7 @@ exec_setregs(struct thread *td, struct i */ reset_dbregs(); } - pcb->pcb_flags &= ~PCB_DBREGS; + pcb->pcb_flags &= ~PCB_DBREGS; } pcb->pcb_initial_npxcw = __INITIAL_NPXCW__; @@ -2853,14 +2901,14 @@ do_next: #ifdef XEN #define MTOPSIZE (1<<(14 + PAGE_SHIFT)) -void +register_t init386(first) int first; { unsigned long gdtmachpfn; int error, gsel_tss, metadata_missing, x, pa; - size_t kstack0_sz; struct pcpu *pc; + struct xstate_hdr *xhdr; struct callback_register event = { .type = CALLBACKTYPE_event, .address = {GSEL(GCODE_SEL, SEL_KPL), (unsigned long)Xhypervisor_callback }, @@ -2872,8 +2920,6 @@ init386(first) thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = KSTACK_PAGES; - kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -2953,7 +2999,6 @@ init386(first) PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); - PCPU_SET(curpcb, thread0.td_pcb); /* * Initialize mutexes. @@ -3035,15 +3080,6 @@ init386(first) initializecpu(); /* Initialize CPU registers */ initializecpucache(); - /* make an initial tss so cpu can get interrupt stack on syscall! */ - /* Note: -16 is so we can grow the trapframe if we came from vm86 */ - PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - kstack0_sz - sizeof(struct pcb) - 16); - PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); - gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), - PCPU_GET(common_tss.tss_esp0)); - /* pointer to selector slot for %fs/%gs */ PCPU_SET(fsgs_gdt, &gdt[GUFS_SEL].sd); @@ -3071,6 +3107,30 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ msgbufinit(msgbufp, msgbufsize); +#ifdef DEV_NPX + npxinit(true); +#endif + /* + * Set up thread0 pcb after npxinit calculated pcb + fpu save + * area size. Zero out the extended state header in fpu save + * area. + */ + thread0.td_pcb = get_pcb_td(&thread0); + bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); + if (use_xsave) { + xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + + 1); + xhdr->xstate_bv = xsave_mask; + } + PCPU_SET(curpcb, thread0.td_pcb); + /* make an initial tss so cpu can get interrupt stack on syscall! */ + /* Note: -16 is so we can grow the trapframe if we came from vm86 */ + PCPU_SET(common_tss.tss_esp0, (vm_offset_t)thread0.td_pcb - 16); + PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); + gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), + PCPU_GET(common_tss.tss_esp0)); + /* transfer to user mode */ _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); @@ -3089,22 +3149,23 @@ init386(first) thread0.td_pcb->pcb_gsd = PCPU_GET(fsgs_gdt)[1]; cpu_probe_amdc1e(); + + /* Location of kernel stack for locore */ + return ((register_t)thread0.td_pcb); } #else -void +register_t init386(first) int first; { struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; - size_t kstack0_sz; struct pcpu *pc; + struct xstate_hdr *xhdr; thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = KSTACK_PAGES; - kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; - thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -3165,7 +3226,6 @@ init386(first) first += DPCPU_SIZE; PCPU_SET(prvspace, pc); PCPU_SET(curthread, &thread0); - PCPU_SET(curpcb, thread0.td_pcb); /* * Initialize mutexes. @@ -3320,17 +3380,6 @@ init386(first) initializecpu(); /* Initialize CPU registers */ initializecpucache(); - /* make an initial tss so cpu can get interrupt stack on syscall! */ - /* Note: -16 is so we can grow the trapframe if we came from vm86 */ - PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - kstack0_sz - sizeof(struct pcb) - 16); - PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); - gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); - PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); - PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); - PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); - ltr(gsel_tss); - /* pointer to selector slot for %fs/%gs */ PCPU_SET(fsgs_gdt, &gdt[GUFS_SEL].sd); @@ -3358,6 +3407,31 @@ init386(first) /* now running on new page tables, configured,and u/iom is accessible */ msgbufinit(msgbufp, msgbufsize); +#ifdef DEV_NPX + npxinit(true); +#endif + /* + * Set up thread0 pcb after npxinit calculated pcb + fpu save + * area size. Zero out the extended state header in fpu save + * area. + */ + thread0.td_pcb = get_pcb_td(&thread0); + bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); + if (use_xsave) { + xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + + 1); + xhdr->xstate_bv = xsave_mask; + } + PCPU_SET(curpcb, thread0.td_pcb); + /* make an initial tss so cpu can get interrupt stack on syscall! */ + /* Note: -16 is so we can grow the trapframe if we came from vm86 */ + PCPU_SET(common_tss.tss_esp0, (vm_offset_t)thread0.td_pcb - 16); + PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); + gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); + PCPU_SET(common_tssd, *PCPU_GET(tss_gdt)); + PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16); + ltr(gsel_tss); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; @@ -3396,6 +3470,9 @@ init386(first) #ifdef FDT x86_init_fdt(); #endif + + /* Location of kernel stack for locore */ + return ((register_t)thread0.td_pcb); } #endif @@ -3678,11 +3755,11 @@ fill_fpregs(struct thread *td, struct fp #endif #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - fill_fpregs_xmm(&td->td_pcb->pcb_user_save.sv_xmm, + fill_fpregs_xmm(&get_pcb_user_save_td(td)->sv_xmm, (struct save87 *)fpregs); else #endif /* CPU_ENABLE_SSE */ - bcopy(&td->td_pcb->pcb_user_save.sv_87, fpregs, + bcopy(&get_pcb_user_save_td(td)->sv_87, fpregs, sizeof(*fpregs)); return (0); } @@ -3694,10 +3771,10 @@ set_fpregs(struct thread *td, struct fpr #ifdef CPU_ENABLE_SSE if (cpu_fxsr) set_fpregs_xmm((struct save87 *)fpregs, - &td->td_pcb->pcb_user_save.sv_xmm); + &get_pcb_user_save_td(td)->sv_xmm); else #endif /* CPU_ENABLE_SSE */ - bcopy(fpregs, &td->td_pcb->pcb_user_save.sv_87, + bcopy(fpregs, &get_pcb_user_save_td(td)->sv_87, sizeof(*fpregs)); #ifdef DEV_NPX npxuserinited(td); @@ -3743,12 +3820,14 @@ get_mcontext(struct thread *td, mcontext mcp->mc_esp = tp->tf_esp; mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); - get_fpcontext(td, mcp); + get_fpcontext(td, mcp, NULL, 0); sdp = &td->td_pcb->pcb_fsd; mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; sdp = &td->td_pcb->pcb_gsd; mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; mcp->mc_flags = 0; + mcp->mc_xfpustate = 0; + mcp->mc_xfpustate_len = 0; bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2)); return (0); } @@ -3763,6 +3842,7 @@ int set_mcontext(struct thread *td, const mcontext_t *mcp) { struct trapframe *tp; + char *xfpustate; int eflags, ret; tp = td->td_frame; @@ -3770,30 +3850,43 @@ set_mcontext(struct thread *td, const mc return (EINVAL); eflags = (mcp->mc_eflags & PSL_USERCHANGE) | (tp->tf_eflags & ~PSL_USERCHANGE); - if ((ret = set_fpcontext(td, mcp)) == 0) { - tp->tf_fs = mcp->mc_fs; - tp->tf_es = mcp->mc_es; - tp->tf_ds = mcp->mc_ds; - tp->tf_edi = mcp->mc_edi; - tp->tf_esi = mcp->mc_esi; - tp->tf_ebp = mcp->mc_ebp; - tp->tf_ebx = mcp->mc_ebx; - tp->tf_edx = mcp->mc_edx; - tp->tf_ecx = mcp->mc_ecx; - tp->tf_eax = mcp->mc_eax; - tp->tf_eip = mcp->mc_eip; - tp->tf_eflags = eflags; - tp->tf_esp = mcp->mc_esp; - tp->tf_ss = mcp->mc_ss; - td->td_pcb->pcb_gs = mcp->mc_gs; - ret = 0; - } - return (ret); + if (mcp->mc_flags & _MC_HASFPXSTATE) { + if (mcp->mc_xfpustate_len > cpu_max_ext_state_size - + sizeof(union savefpu)) + return (EINVAL); + xfpustate = __builtin_alloca(mcp->mc_xfpustate_len); + ret = copyin((void *)mcp->mc_xfpustate, xfpustate, + mcp->mc_xfpustate_len); + if (ret != 0) + return (ret); + } else + xfpustate = NULL; + ret = set_fpcontext(td, mcp, xfpustate, mcp->mc_xfpustate_len); + if (ret != 0) + return (ret); + tp->tf_fs = mcp->mc_fs; + tp->tf_es = mcp->mc_es; + tp->tf_ds = mcp->mc_ds; + tp->tf_edi = mcp->mc_edi; + tp->tf_esi = mcp->mc_esi; + tp->tf_ebp = mcp->mc_ebp; + tp->tf_ebx = mcp->mc_ebx; + tp->tf_edx = mcp->mc_edx; + tp->tf_ecx = mcp->mc_ecx; + tp->tf_eax = mcp->mc_eax; + tp->tf_eip = mcp->mc_eip; + tp->tf_eflags = eflags; + tp->tf_esp = mcp->mc_esp; + tp->tf_ss = mcp->mc_ss; + td->td_pcb->pcb_gs = mcp->mc_gs; + return (0); } static void -get_fpcontext(struct thread *td, mcontext_t *mcp) +get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave, + size_t xfpusave_len) { + size_t max_len, len; #ifndef DEV_NPX mcp->mc_fpformat = _MC_FPFMT_NODEV; @@ -3801,37 +3894,54 @@ get_fpcontext(struct thread *td, mcontex bzero(mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); #else mcp->mc_ownedfp = npxgetregs(td); - bcopy(&td->td_pcb->pcb_user_save, &mcp->mc_fpstate[0], + bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); + if (!use_xsave || xfpusave_len == 0) + return; + max_len = cpu_max_ext_state_size - sizeof(union savefpu); + len = xfpusave_len; + if (len > max_len) { + len = max_len; + bzero(xfpusave + max_len, len - max_len); + } + mcp->mc_flags |= _MC_HASFPXSTATE; + mcp->mc_xfpustate_len = len; + bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); #endif } static int -set_fpcontext(struct thread *td, const mcontext_t *mcp) +set_fpcontext(struct thread *td, const mcontext_t *mcp, char *xfpustate, + size_t xfpustate_len) { + union savefpu *fpstate; + int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) return (0); else if (mcp->mc_fpformat != _MC_FPFMT_387 && mcp->mc_fpformat != _MC_FPFMT_XMM) return (EINVAL); - else if (mcp->mc_ownedfp == _MC_FPOWNED_NONE) + else if (mcp->mc_ownedfp == _MC_FPOWNED_NONE) { /* We don't care what state is left in the FPU or PCB. */ fpstate_drop(td); - else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || + error = 0; + } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { #ifdef DEV_NPX + fpstate = (union savefpu *)&mcp->mc_fpstate; #ifdef CPU_ENABLE_SSE if (cpu_fxsr) - ((union savefpu *)&mcp->mc_fpstate)->sv_xmm.sv_env. - en_mxcsr &= cpu_mxcsr_mask; + fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; #endif - npxsetregs(td, (union savefpu *)&mcp->mc_fpstate); + error = npxsetregs(td, fpstate, xfpustate, xfpustate_len); +#else + error = EINVAL; #endif } else return (EINVAL); - return (0); + return (error); } static void Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/mp_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -749,7 +749,7 @@ init_secondary(void) initializecpu(); /* set up FPU state on the AP */ - npxinit(); + npxinit(false); if (cpu_ops.cpu_init) cpu_ops.cpu_init(); @@ -1512,11 +1512,11 @@ cpususpend_handler(void) cpu = PCPU_GET(cpuid); if (savectx(&susppcbs[cpu]->sp_pcb)) { - npxsuspend(&susppcbs[cpu]->sp_fpususpend); + npxsuspend(susppcbs[cpu]->sp_fpususpend); wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); } else { - npxresume(&susppcbs[cpu]->sp_fpususpend); + npxresume(susppcbs[cpu]->sp_fpususpend); pmap_init_pat(); initializecpu(); PCPU_SET(switchtime, 0); Modified: head/sys/i386/i386/ptrace_machdep.c ============================================================================== --- head/sys/i386/i386/ptrace_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/ptrace_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -41,6 +42,47 @@ __FBSDID("$FreeBSD$"); #define CPU_ENABLE_SSE #endif +#ifdef CPU_ENABLE_SSE +static int +cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) +{ + char *savefpu; + int error; + + if (!use_xsave) + return (EOPNOTSUPP); + + switch (req) { + case PT_GETXSTATE: + npxgetregs(td); + savefpu = (char *)(get_pcb_user_save_td(td) + 1); + error = copyout(savefpu, addr, + cpu_max_ext_state_size - sizeof(union savefpu)); + break; + + case PT_SETXSTATE: + if (data > cpu_max_ext_state_size - sizeof(union savefpu)) { + error = EINVAL; + break; + } + savefpu = malloc(data, M_TEMP, M_WAITOK); + error = copyin(addr, savefpu, data); + if (error == 0) { + npxgetregs(td); + error = npxsetxstate(td, savefpu, data); + } + free(savefpu, M_TEMP); + break; + + default: + error = EINVAL; + break; + } + + return (error); +} +#endif + int cpu_ptrace(struct thread *td, int req, void *addr, int data) { @@ -51,7 +93,7 @@ cpu_ptrace(struct thread *td, int req, v if (!cpu_fxsr) return (EINVAL); - fpstate = &td->td_pcb->pcb_user_save.sv_xmm; + fpstate = &get_pcb_user_save_td(td)->sv_xmm; switch (req) { case PT_GETXMMREGS: npxgetregs(td); @@ -64,6 +106,11 @@ cpu_ptrace(struct thread *td, int req, v fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; break; + case PT_GETXSTATE: + case PT_SETXSTATE: + error = cpu_ptrace_xstate(td, req, addr, data); + break; + default: return (EINVAL); } Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/sys_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -105,6 +105,7 @@ sysarch(td, uap) union { struct i386_ldt_args largs; struct i386_ioperm_args iargs; + struct i386_get_xfpustate xfpu; } kargs; uint32_t base; struct segment_descriptor sd, *sdp; @@ -126,6 +127,7 @@ sysarch(td, uap) case I386_SET_FSBASE: case I386_GET_GSBASE: case I386_SET_GSBASE: + case I386_GET_XFPUSTATE: break; case I386_SET_IOPERM: @@ -154,6 +156,11 @@ sysarch(td, uap) if (kargs.largs.num > MAX_LD || kargs.largs.num <= 0) return (EINVAL); break; + case I386_GET_XFPUSTATE: + if ((error = copyin(uap->parms, &kargs.xfpu, + sizeof(struct i386_get_xfpustate))) != 0) + return (error); + break; default: break; } @@ -270,6 +277,14 @@ sysarch(td, uap) load_gs(GSEL(GUGS_SEL, SEL_UPL)); } break; + case I386_GET_XFPUSTATE: + if (kargs.xfpu.len > cpu_max_ext_state_size - + sizeof(union savefpu)) + return (EINVAL); + npxgetregs(td); + error = copyout((char *)(get_pcb_user_save_td(td) + 1), + kargs.xfpu.addr, kargs.xfpu.len); + break; default: error = EINVAL; break; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/trap.c Sun Nov 2 22:58:30 2014 (r273995) @@ -1157,7 +1157,7 @@ syscall(struct trapframe *frame) KASSERT(PCB_USER_FPU(td->td_pcb), ("System call %s returning with kernel FPU ctx leaked", syscallname(td->td_proc, sa.code))); - KASSERT(td->td_pcb->pcb_save == &td->td_pcb->pcb_user_save, + KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", syscallname(td->td_proc, sa.code))); Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/i386/vm_machdep.c Sun Nov 2 22:58:30 2014 (r273995) @@ -118,7 +118,50 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +union savefpu * +get_pcb_user_save_td(struct thread *td) +{ + vm_offset_t p; + + p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + cpu_max_ext_state_size; + KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + return ((union savefpu *)p); +} + +union savefpu * +get_pcb_user_save_pcb(struct pcb *pcb) +{ + vm_offset_t p; + + p = (vm_offset_t)(pcb + 1); + return ((union savefpu *)p); +} + +struct pcb * +get_pcb_td(struct thread *td) +{ + vm_offset_t p; + p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + cpu_max_ext_state_size - sizeof(struct pcb); + return ((struct pcb *)p); +} + +void * +alloc_fpusave(int flags) +{ + void *res; + struct savefpu_ymm *sf; + + res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags); + if (use_xsave) { + sf = (struct savefpu_ymm *)res; + bzero(&sf->sv_xstate.sx_hd, sizeof(sf->sv_xstate.sx_hd)); + sf->sv_xstate.sx_hd.xstate_bv = xsave_mask; + } + return (res); +} /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child @@ -168,15 +211,16 @@ cpu_fork(td1, p2, td2, flags) #endif /* Point the pcb to the top of the stack */ - pcb2 = (struct pcb *)(td2->td_kstack + - td2->td_kstack_pages * PAGE_SIZE) - 1; + pcb2 = get_pcb_td(td2); td2->td_pcb = pcb2; /* Copy td1's pcb */ bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); /* Properly initialize pcb_save */ - pcb2->pcb_save = &pcb2->pcb_user_save; + pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); + bcopy(get_pcb_user_save_td(td1), get_pcb_user_save_pcb(pcb2), + cpu_max_ext_state_size); /* Point mdproc and then copy over td1's contents */ mdp2 = &p2->p_md; @@ -353,12 +397,18 @@ cpu_thread_swapout(struct thread *td) void cpu_thread_alloc(struct thread *td) { + struct pcb *pcb; + struct xstate_hdr *xhdr; - td->td_pcb = (struct pcb *)(td->td_kstack + - td->td_kstack_pages * PAGE_SIZE) - 1; - td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb - 16) - 1; - td->td_pcb->pcb_ext = NULL; - td->td_pcb->pcb_save = &td->td_pcb->pcb_user_save; + td->td_pcb = pcb = get_pcb_td(td); + td->td_frame = (struct trapframe *)((caddr_t)pcb - 16) - 1; + pcb->pcb_ext = NULL; + pcb->pcb_save = get_pcb_user_save_pcb(pcb); + if (use_xsave) { + xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1); + bzero(xhdr, sizeof(*xhdr)); + xhdr->xstate_bv = xsave_mask; + } } void @@ -426,7 +476,9 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE | PCB_KERNNPX); - pcb2->pcb_save = &pcb2->pcb_user_save; + pcb2->pcb_save = get_pcb_user_save_pcb(pcb2); + bcopy(get_pcb_user_save_td(td0), pcb2->pcb_save, + cpu_max_ext_state_size); /* * Create a new fresh stack for the new thread. Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/include/cpufunc.h Sun Nov 2 22:58:30 2014 (r273995) @@ -457,6 +457,25 @@ rcr4(void) return (data); } +static __inline uint64_t +rxcr(u_int reg) +{ + u_int low, high; + + __asm __volatile("xgetbv" : "=a" (low), "=d" (high) : "c" (reg)); + return (low | ((uint64_t)high << 32)); +} + +static __inline void +load_xcr(u_int reg, uint64_t val) +{ + u_int low, high; + + low = val; + high = val >> 32; + __asm __volatile("xsetbv" : : "c" (reg), "a" (low), "d" (high)); +} + /* * Global TLB flush (except for thise for pages marked PG_G) */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/include/md_var.h Sun Nov 2 22:58:30 2014 (r273995) @@ -52,6 +52,7 @@ extern u_int cpu_stdext_feature; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; +extern u_int cpu_max_ext_state_size; extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; @@ -80,14 +81,19 @@ extern int vm_page_dump_size; extern int workaround_erratum383; extern int _udatasel; extern int _ucodesel; +extern int use_xsave; +extern uint64_t xsave_mask; typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); +struct pcb; +union savefpu; struct thread; struct reg; struct fpreg; struct dbreg; struct dumperinfo; +void *alloc_fpusave(int flags); void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); void cpu_setregs(void); @@ -118,5 +124,8 @@ void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); int user_dbreg_trap(void); int minidumpsys(struct dumperinfo *); +union savefpu *get_pcb_user_save_td(struct thread *td); +union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); +struct pcb *get_pcb_td(struct thread *td); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/include/npx.h Sun Nov 2 22:58:30 2014 (r273995) @@ -45,17 +45,24 @@ #ifdef _KERNEL +struct fpu_kern_ctx; + #define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNNPX) == 0) +#define XSAVE_AREA_ALIGN 64 + int npxdna(void); void npxdrop(void); void npxexit(struct thread *td); int npxformat(void); int npxgetregs(struct thread *td); -void npxinit(void); +void npxinit(bool bsp); void npxresume(union savefpu *addr); void npxsave(union savefpu *addr); -void npxsetregs(struct thread *td, union savefpu *addr); +int npxsetregs(struct thread *td, union savefpu *addr, + char *xfpustate, size_t xfpustate_size); +int npxsetxstate(struct thread *td, char *xfpustate, + size_t xfpustate_size); void npxsuspend(union savefpu *addr); int npxtrap_x87(void); int npxtrap_sse(void); @@ -68,8 +75,12 @@ int fpu_kern_leave(struct thread *td, st int fpu_kern_thread(u_int flags); int is_fpu_kern_thread(u_int flags); +union savefpu *fpu_save_area_alloc(void); +void fpu_save_area_free(union savefpu *fsa); +void fpu_save_area_reset(union savefpu *fsa); + /* - * Flags for fpu_kern_enter() and fpu_kern_thread(). + * Flags for fpu_kern_alloc_ctx(), fpu_kern_enter() and fpu_kern_thread(). */ #define FPU_KERN_NORMAL 0x0000 #define FPU_KERN_NOWAIT 0x0001 Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Sun Nov 2 22:42:19 2014 (r273994) +++ head/sys/i386/include/pcb.h Sun Nov 2 22:58:30 2014 (r273995) @@ -45,17 +45,23 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:22:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 211E7F3C; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E71842A6; Sun, 2 Nov 2014 23:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMNAg001477; Sun, 2 Nov 2014 23:22:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMNZe001475; Sun, 2 Nov 2014 23:22:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMNZe001475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22:23 +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: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 23:22:24 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/8/share/man/man3/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/10/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/10/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/10/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/10/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/10/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:22:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B13D6F3E; Sun, 2 Nov 2014 23:22:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 827C12AA; Sun, 2 Nov 2014 23:22:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMPVk001495; Sun, 2 Nov 2014 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMPJQ001492; Sun, 2 Nov 2014 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMPJQ001492@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22:25 +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: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 23:22:25 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/9/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/9/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/9/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/9/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/9/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:22:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D250CF3D; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3C6E2A9; Sun, 2 Nov 2014 23:22:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NMO1s001487; Sun, 2 Nov 2014 23:22:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NMO0D001484; Sun, 2 Nov 2014 23:22:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411022322.sA2NMO0D001484@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 2 Nov 2014 23:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r273996 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 23:22:24 -0000 Author: jhb Date: Sun Nov 2 23:22:22 2014 New Revision: 273996 URL: https://svnweb.freebsd.org/changeset/base/273996 Log: MFC 273644,273738: Clarify that pthread_cleanup_push()/pop() are implemented as macros that create a new code block and thus must be balanced at the same lexical scope. (This is also a requirement in POSIX.) PR: 194280 Submitted by: dr2867.business@pacbell.net Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 stable/8/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/8/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/pthread_cleanup_pop.3 stable/10/share/man/man3/pthread_cleanup_push.3 stable/9/share/man/man3/pthread_cleanup_pop.3 stable/9/share/man/man3/pthread_cleanup_push.3 Directory Properties: stable/10/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/pthread_cleanup_pop.3 ============================================================================== --- stable/8/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/8/share/man/man3/pthread_cleanup_pop.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_POP 3 .Os .Sh NAME @@ -50,6 +50,14 @@ If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. +.Pp +The +.Fn pthread_cleanup_pop +function is implemented as a macro that closes a block. +Invocations of this function must appear as standalone statements that are +paired with an earlier call of +.Xr pthread_cleanup_push 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_pop Modified: stable/8/share/man/man3/pthread_cleanup_push.3 ============================================================================== --- stable/8/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 22:58:30 2014 (r273995) +++ stable/8/share/man/man3/pthread_cleanup_push.3 Sun Nov 2 23:22:22 2014 (r273996) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 1998 +.Dd October 25, 2014 .Dt PTHREAD_CLEANUP_PUSH 3 .Os .Sh NAME @@ -52,6 +52,14 @@ When is called, it is passed .Fa arg as its only argument. +.Pp +The +.Fn pthread_cleanup_push +function is implemented as a macro that opens a new block. +Invocations of this function must appear as standalone statements that are +paired with a later call of +.Xr pthread_cleanup_pop 3 +in the same lexical scope. .Sh RETURN VALUES The .Fn pthread_cleanup_push From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 23:30:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65BDB4B0; Sun, 2 Nov 2014 23:30:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5196731C; Sun, 2 Nov 2014 23:30:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2NUp8q004714; Sun, 2 Nov 2014 23:30:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2NUpr8004713; Sun, 2 Nov 2014 23:30:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411022330.sA2NUpr8004713@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 2 Nov 2014 23:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273997 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 23:30:51 -0000 Author: delphij Date: Sun Nov 2 23:30:50 2014 New Revision: 273997 URL: https://svnweb.freebsd.org/changeset/base/273997 Log: - Make sure random_adaptor accesses happen only when random_adaptors_lock is held. - Use sx_sleep instead of tsleep in read and write path to allow another thread that registers a new random adapter when waiting. Assert that random_adaptor is not NULL after reacquiring the lock. - Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be stopped when user requests so, while there also make short read/write's return 0. - Move M_WAITOK allocations out of lock scope. In collobration with: kib, markm, ian, jilles Reviewed by: kib, markm Approved by: so Modified: head/sys/dev/random/random_adaptors.c Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Sun Nov 2 23:22:22 2014 (r273996) +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 23:30:50 2014 (r273997) @@ -171,9 +171,8 @@ random_adaptor_register(const char *name sx_xlock(&random_adaptors_lock); LIST_INSERT_HEAD(&random_adaptors_list, rra, rra_entries); random_adaptor_choose(); - sx_xunlock(&random_adaptors_lock); - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + sx_xunlock(&random_adaptors_lock); } void @@ -182,9 +181,9 @@ random_adaptor_deregister(const char *na struct random_adaptors *rra; KASSERT(name != NULL, ("invalid input to %s", __func__)); - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); sx_xlock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); LIST_FOREACH(rra, &random_adaptors_list, rra_entries) if (strcmp(rra->rra_name, name) == 0) { LIST_REMOVE(rra, rra_entries); @@ -208,23 +207,28 @@ random_adaptor_read(struct cdev *dev __u printf("random: %s %ld\n", __func__, uio->uio_resid); #endif - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); sx_slock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + /* Let the entropy source do any pre-read setup. */ (random_adaptor->ra_read)(NULL, 0); /* (Un)Blocking logic */ error = 0; - while (!random_adaptor->ra_seeded()) { + while (!random_adaptor->ra_seeded() && error == 0) { if (flags & O_NONBLOCK) { error = EWOULDBLOCK; break; } /* Sleep instead of going into a spin-frenzy */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error = sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "randrd", hz/10); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", + __func__)); /* keep tapping away at the pre-read until we seed/unblock. */ (random_adaptor->ra_read)(NULL, 0); @@ -241,12 +245,10 @@ random_adaptor_read(struct cdev *dev __u mtx_unlock(&random_read_rate_mtx); - if (!error) { + if (error == 0) { + nbytes = uio->uio_resid; /* The actual read */ - - random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); - while (uio->uio_resid && !error) { c = MIN(uio->uio_resid, PAGE_SIZE); (random_adaptor->ra_read)(random_buf, c); @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev __u /* Let the entropy source do any post-read cleanup. */ (random_adaptor->ra_read)(NULL, 1); - free(random_buf, M_ENTROPY); - } + if (nbytes != uio->uio_resid && (error == ERESTART || + error == EINTR) ) + error = 0; /* Return partial read, not error. */ + } sx_sunlock(&random_adaptors_lock); + free(random_buf, M_ENTROPY); + return (error); } @@ -269,6 +275,8 @@ random_adaptor_read_rate(void) { int ret; + sx_assert(&random_adaptors_lock, SA_LOCKED); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); mtx_lock(&random_read_rate_mtx); @@ -287,18 +295,20 @@ random_adaptor_write(struct cdev *dev __ { int c, error = 0; void *random_buf; + ssize_t nbytes; #ifdef RANDOM_DEBUG printf("random: %s %zd\n", __func__, uio->uio_resid); #endif - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); sx_slock(&random_adaptors_lock); - random_buf = malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - while (uio->uio_resid > 0) { + nbytes = uio->uio_resid; + while (uio->uio_resid > 0 && error == 0) { c = MIN(uio->uio_resid, PAGE_SIZE); error = uiomove(random_buf, c, uio); if (error) @@ -306,13 +316,20 @@ random_adaptor_write(struct cdev *dev __ (random_adaptor->ra_write)(random_buf, c); /* Introduce an annoying delay to stop swamping */ - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); + error = sx_sleep(&random_adaptor, &random_adaptors_lock, + PUSER | PCATCH, "randwr", hz/10); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", + __func__)); } - free(random_buf, M_ENTROPY); - sx_sunlock(&random_adaptors_lock); + if (nbytes != uio->uio_resid && (error == ERESTART || + error == EINTR) ) + error = 0; /* Partial write, not error. */ + + free(random_buf, M_ENTROPY); + return (error); } @@ -325,10 +342,10 @@ random_adaptor_poll(struct cdev *dev __u printf("random: %s\n", __func__); #endif - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); + if (events & (POLLIN | POLLRDNORM)) { if (random_adaptor->ra_seeded()) events &= (POLLIN | POLLRDNORM); @@ -382,9 +399,9 @@ random_sysctl_active_adaptor_handler(SYS struct sbuf sbuf; int error; + sx_slock(&random_adaptors_lock); KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); sbuf_new_for_sysctl(&sbuf, NULL, 16, req); LIST_FOREACH(rra, &random_adaptors_list, rra_entries) if (rra->rra_ra == random_adaptor) { @@ -454,9 +471,9 @@ static void random_adaptors_seed(void *unused __unused) { + sx_slock(&random_adaptors_lock); KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - sx_slock(&random_adaptors_lock); random_adaptor->ra_reseed(); sx_sunlock(&random_adaptors_lock); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:13:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1756DB16; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02246933; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DKFB026331; Mon, 3 Nov 2014 00:13:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DKlD026330; Mon, 3 Nov 2014 00:13:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DKlD026330@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13: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: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 00:13:21 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/8/usr.sbin/etcupdate/ (props changed) stable/9/usr.sbin/etcupdate/ (props changed) Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/10/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/10/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:13:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 609E8B18; Mon, 3 Nov 2014 00:13:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD06935; Mon, 3 Nov 2014 00:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DMIQ026345; Mon, 3 Nov 2014 00:13:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DMpf026344; Mon, 3 Nov 2014 00:13:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DMpf026344@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13:22 +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: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 00:13:22 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/9/usr.sbin/etcupdate/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 stable/8/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) stable/8/usr.sbin/etcupdate/ (props changed) Modified: stable/9/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/9/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/9/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:13:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A91CEB17; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93EF0934; Mon, 3 Nov 2014 00:13:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30DLAd026339; Mon, 3 Nov 2014 00:13:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30DLKL026338; Mon, 3 Nov 2014 00:13:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411030013.sA30DLKL026338@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 00:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r273998 - in stable: 10/usr.sbin/etcupdate 8/usr.sbin/etcupdate 9/usr.sbin/etcupdate X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 00:13:21 -0000 Author: jhb Date: Mon Nov 3 00:13:20 2014 New Revision: 273998 URL: https://svnweb.freebsd.org/changeset/base/273998 Log: MFC 273834: Rework the EXAMPLES section to be a bit clearer. - Add an example of using etcupdate diff. - Create a subsection on bootstrapping that is below the simple examples. This should make it clearer that 'etcupdate extract' is a one-time operation and not part of the common workflow. It also adds more suggestions on when bootstrapping is needed and additional steps to make future merges simpler. Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/8/usr.sbin/etcupdate/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/etcupdate/etcupdate.8 stable/9/usr.sbin/etcupdate/etcupdate.8 Directory Properties: stable/10/ (props changed) stable/9/usr.sbin/etcupdate/ (props changed) Modified: stable/8/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- stable/8/usr.sbin/etcupdate/etcupdate.8 Sun Nov 2 23:30:50 2014 (r273997) +++ stable/8/usr.sbin/etcupdate/etcupdate.8 Mon Nov 3 00:13:20 2014 (r273998) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 9, 2013 +.Dd October 29, 2014 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -608,12 +608,11 @@ Default log file. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -If the source tree matches the currently installed world, -then the following can be used to bootstrap -.Nm -so that it can be used for future upgrades: +To compare the files in +.Pa /etc +with the stock versions: .Pp -.Dl "etcupdate extract" +.Dl "etcupdate diff" .Pp To merge changes after an upgrade via the buildworld and installworld process: .Pp @@ -622,6 +621,59 @@ To merge changes after an upgrade via th To resolve any conflicts generated during a merge: .Pp .Dl "etcupdate resolve" +.Ss Bootstrapping +The +.Nm +utility may need to be bootstrapped before it can be used. +The +.Cm diff +command will fail with an error about a missing reference tree if +bootstrapping is needed. +.Pp +Bootstrapping +.Nm +requires a source tree that matches the currently installed world. +The easiest way to ensure this is to bootstrap +.Nm +before updating the source tree to start the next world upgrade cycle. +First, +generate a reference tree: +.Pp +.Dl "etcupdate extract" +.Pp +Second, +use the +.Cm diff +command to compare the reference tree to your current files in +.Pa /etc . +Undesired differences should be removed using an editor, +.Xr patch 1 , +or by copying files from the reference tree +.Po +located at +.Pa /var/db/etcupdate/current +by default +.Pc +. +.Pp +If the tree at +.Pa /usr/src +is already newer than the currently installed world, +a new tree matching the currently installed world can be checked out to +a temporary location. +The reference tree for +.Nm +can then be generated via: +.Pp +.Dl "etcupdate extract -s /path/to/tree" +.Pp +The +.Cm diff +command can be used as above to remove undesired differences. +Afterwards, +the changes in the tree at +.Pa /usr/src +can be merged via a regular merge. .Sh DIAGNOSTICS The following warning messages may be generated during a merge. Note that several of these warnings cover obscure cases that should occur From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:37:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1376A27B; Mon, 3 Nov 2014 00:37:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0016BAD7; Mon, 3 Nov 2014 00:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA30bdOO036261; Mon, 3 Nov 2014 00:37:39 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA30bdK0036259; Mon, 3 Nov 2014 00:37:39 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201411030037.sA30bdK0036259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 3 Nov 2014 00:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273999 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 00:37:40 -0000 Author: hrs Date: Mon Nov 3 00:37:39 2014 New Revision: 273999 URL: https://svnweb.freebsd.org/changeset/base/273999 Log: Do not try to create a /dev/log symlink in a jail. PR: 179828 Modified: head/etc/rc.d/syslogd Modified: head/etc/rc.d/syslogd ============================================================================== --- head/etc/rc.d/syslogd Mon Nov 3 00:13:20 2014 (r273998) +++ head/etc/rc.d/syslogd Mon Nov 3 00:37:39 2014 (r273999) @@ -28,7 +28,7 @@ syslogd_precmd() # Transitional symlink for old binaries # - if [ ! -L /dev/log ]; then + if [ ! -L /dev/log ] && ! check_jail jailed; then ln -sf /var/run/log /dev/log fi rm -f /var/run/log From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 00:53:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10ED0513; Mon, 3 Nov 2014 00:53:37 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id BF679C6E; Mon, 3 Nov 2014 00:53:35 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1D2DB1046A42; Mon, 3 Nov 2014 11:53:27 +1100 (AEDT) Date: Mon, 3 Nov 2014 11:53:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r273958 - head/sys/dev/random In-Reply-To: <1414961583.1200.27.camel@revolution.hippie.lan> Message-ID: <20141103113629.I3149@besplex.bde.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=dqrdoiUPIJBHaAnRjlAA:9 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , d@delphij.net, "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 00:53:37 -0000 On Sun, 2 Nov 2014, Ian Lepore wrote: > On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA512 >> >> Hi, Mark, >> >> I'd like to propose the attached patch for review. It replaces >> tsleep's with sx_sleep's, then checks the return value and quit the loop. > > It still doesn't handle the partial read/write case Kostik mentioned, > but there are plenty of other drivers that don't get that right. Returning an error for a partial read is good enough for random devices, since there is no problem with discarding the input. Upper layers are still broken, so this (discarding the input is what happens automatically except for ERESTART, EINTR and EWOULDBLOCK. > Given > that the ra_read/ra_write functions can't return error, it would only be > errors from uiomove() in play. I guess it would be something like this: > > nbytes = uio->uio_resid; > while (uio->uio_resid && !error) { > c = MIN(uio->uio_resid, PAGE_SIZE); > (random_adaptor->ra_read)(random_buf, c); > error = uiomove(random_buf, c, uio); > } > if (uio->uio_resid != nbytes) > error = 0; /* Return partial read, not error. */ This is unnecessary except for upper layer bugs. Upper layers already convert error to 0 under the condition (uio->uio_resid != original_resid), except they only do this if 'error' was EINTR, ERESTART and EWOULDBLOCK -- other cases are broken. Thus all drivers have the burden of doing the conversion if they want to be correct. Some file systems generally back out of failing writes so that returning an error is correct. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 01:14:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A982B78A; Mon, 3 Nov 2014 01:14:02 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 61B03DD3; Mon, 3 Nov 2014 01:14:01 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 6B3CAD67413; Mon, 3 Nov 2014 12:13:52 +1100 (AEDT) Date: Mon, 3 Nov 2014 12:13:52 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random In-Reply-To: <5456A69C.6040902@delphij.net> Message-ID: <20141103115402.H3149@besplex.bde.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <5456A47E.2030405@delphij.net> <5456A69C.6040902@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=rChhECSGKj_4nB7HX6kA:9 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 01:14:02 -0000 On Sun, 2 Nov 2014, Xin Li wrote: > Another revision to make Jilles happy -- changed 'block' to 'randrd' and 'randwr', I saw his email but forgot to make the change. % Index: sys/dev/random/random_adaptors.c % =================================================================== % --- sys/dev/random/random_adaptors.c (revision 273982) % +++ sys/dev/random/random_adaptors.c (working copy) % @@ -171,9 +171,8 @@ random_adaptor_register(const char *name, struct r % sx_xlock(&random_adaptors_lock); % LIST_INSERT_HEAD(&random_adaptors_list, rra, rra_entries); % random_adaptor_choose(); % + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); % sx_xunlock(&random_adaptors_lock); % - % - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); % } % % void Lots of style bugs (long lines, use of the __func__ obfuscation, and general verboseness). % ... % @@ -224,7 +225,10 @@ random_adaptor_read(struct cdev *dev __unused, str % } % % /* Sleep instead of going into a spin-frenzy */ % - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); % + error = sx_sleep(&random_adaptor, &random_adaptors_lock, % + PUSER | PCATCH, "randrd", hz/10); % + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", % + __func__)); % % /* keep tapping away at the pre-read until we seed/unblock. */ % (random_adaptor->ra_read)(NULL, 0); More style bugs (long lines). Worse than above since line splitting is not avoided, giving 1 line 2-3 characters too long and 1 short line. % @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev __unused, str % /* Let the entropy source do any post-read cleanup. */ % (random_adaptor->ra_read)(NULL, 1); % % - free(random_buf, M_ENTROPY); % + if (nbytes != uio->uio_resid && (error == ERESTART || % + error == EINTR) ) % + error = 0; /* Return partial read, not error. */ This adjustment has no effect. Upper layers already do it for these 2 errors and one more. Other cases remain broken. It is simpler to do nothing. Let upper layers get it right or wrong. Doesn't matter much either way. % + More style bugs. Extra blank line here. Space bereofe parentheses above. % } % - % sx_sunlock(&random_adaptors_lock); % % + free(random_buf, M_ENTROPY); % + Extra blank lines are sprinkled randomly. Mostly added, but one was removed. There is an extra blank line after the sx_slock() that separates it from the blocks(s) of code that it locks; the removed one used the same style. % return (error); % } % % ... % @@ -306,13 +316,20 @@ random_adaptor_write(struct cdev *dev __unused, st % (random_adaptor->ra_write)(random_buf, c); % % /* Introduce an annoying delay to stop swamping */ % - tsleep(&random_adaptor, PUSER | PCATCH, "block", hz/10); % + error = sx_sleep(&random_adaptor, &random_adaptors_lock, % + PUSER | PCATCH, "randwr", hz/10); % + KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", % + __func__)); % } % % + sx_sunlock(&random_adaptors_lock); % + % + if (nbytes != uio->uio_resid && (error == ERESTART || % + error == EINTR) ) % + error = 0; /* Partial write, not error. */ This adjustment has no effect, as above. It has 1 more style bug than above (line splitting was needed above, but not here). Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:08:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 959993A4; Mon, 3 Nov 2014 03:08:47 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3460A52; Mon, 3 Nov 2014 03:08:46 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id q5so5029527wiv.5 for ; Sun, 02 Nov 2014 19:08:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=o2N1Ox4emNjnNtT5SDlc6+WrNeQE+mG9VLGkxyCnsFY=; b=fp0ZMclC5/DicqLdsp5eYwblQsQp92znAKyYa6BhWudssf4ZWn0QjXj5y9IY+7LHqJ IoybzJm7Mf3eBkRYl2qPXQ6qnS39lzW2aC/P/Y6HL1Cthcsa1L/0sx7nkj/KAGGOGZtF 1/9BM8OuWAZDcaYiz16xKY/5K6m+wzqYOlBNEWy0V8R4gHHOidHE1iVaSNg9FczAnoJh T1D5oe3p4w9GGK2AYkgSQE21SuqAyqtE7/95Oh05hd1ZMVpxY4C2ED8OkMsez3i7Rals Z1nChYoVNXCI6m3beXs4pvFkmhrVm49zutK1llymqTkDmtjLtpZ7tPclt44ltwUVWyjn jBPQ== X-Received: by 10.180.78.36 with SMTP id y4mr12994266wiw.52.1414984124951; Sun, 02 Nov 2014 19:08:44 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id q3sm7730179wjr.44.2014.11.02.19.08.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 02 Nov 2014 19:08:44 -0800 (PST) Date: Mon, 3 Nov 2014 04:08:41 +0100 From: Mateusz Guzik To: Xin LI Subject: Re: svn commit: r273997 - head/sys/dev/random Message-ID: <20141103030841.GB29497@dft-labs.eu> References: <201411022330.sA2NUpr8004713@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201411022330.sA2NUpr8004713@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:08:47 -0000 On Sun, Nov 02, 2014 at 11:30:51PM +0000, Xin LI wrote: > Author: delphij > Date: Sun Nov 2 23:30:50 2014 > New Revision: 273997 > URL: https://svnweb.freebsd.org/changeset/base/273997 > > Log: > - Make sure random_adaptor accesses happen only when > random_adaptors_lock is held. > - Use sx_sleep instead of tsleep in read and write path to allow > another thread that registers a new random adapter when waiting. > Assert that random_adaptor is not NULL after reacquiring the lock. > - Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be > stopped when user requests so, while there also make short > read/write's return 0. > - Move M_WAITOK allocations out of lock scope. > > In collobration with: kib, markm, ian, jilles > Reviewed by: kib, markm > Approved by: so > > Modified: > head/sys/dev/random/random_adaptors.c > > @@ -269,6 +275,8 @@ random_adaptor_read_rate(void) > { > int ret; > > + sx_assert(&random_adaptors_lock, SA_LOCKED); > + > KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); > > mtx_lock(&random_read_rate_mtx); This panics with: panic: Lock (sx) random_adaptors not locked @ /usr/src/sys/dev/random/random_adaptors.c:278. cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe02e7fe4940 kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe02e7fe49f0 vpanic() at vpanic+0x189/frame 0xfffffe02e7fe4a70 kassert_panic() at kassert_panic+0x139/frame 0xfffffe02e7fe4ae0 witness_assert() at witness_assert+0x32a/frame 0xfffffe02e7fe4b40 random_adaptor_read_rate() at random_adaptor_read_rate+0x23/frame 0xfffffe02e7fe4b60 live_entropy_sources_feed() at live_entropy_sources_feed+0x2a/frame 0xfffffe02e7fe4b90 Quick look suggests these asserts can be removed since random_read_rate_mtx protects stuff. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:12:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FA4C542; Mon, 3 Nov 2014 03:12:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0AC8B0D; Mon, 3 Nov 2014 03:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33CFKK010077; Mon, 3 Nov 2014 03:12:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33CFc4010076; Mon, 3 Nov 2014 03:12:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411030312.sA33CFc4010076@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 03:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274000 - head/sys/fs/devfs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:12:16 -0000 Author: mjg Date: Mon Nov 3 03:12:15 2014 New Revision: 274000 URL: https://svnweb.freebsd.org/changeset/base/274000 Log: Fix up some session-related races in devfs. One was introduced with r272596, the rest was there to begin with. Noted by: jhb Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Nov 3 00:37:39 2014 (r273999) +++ head/sys/fs/devfs/devfs_vnops.c Mon Nov 3 03:12:15 2014 (r274000) @@ -499,6 +499,7 @@ devfs_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; struct devfs_dirent *de; + struct proc *p; int error; de = vp->v_data; @@ -511,11 +512,16 @@ devfs_access(struct vop_access_args *ap) return (0); if (error != EACCES) return (error); + p = ap->a_td->td_proc; /* We do, however, allow access to the controlling terminal */ - if (!(ap->a_td->td_proc->p_flag & P_CONTROLT)) + PROC_LOCK(p); + if (!(p->p_flag & P_CONTROLT)) { + PROC_UNLOCK(p); return (error); - if (ap->a_td->td_proc->p_session->s_ttydp == de->de_cdp) - return (0); + } + if (p->p_session->s_ttydp == de->de_cdp) + error = 0; + PROC_UNLOCK(p); return (error); } @@ -525,6 +531,7 @@ devfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp, *oldvp; struct thread *td = ap->a_td; + struct proc *p; struct cdev *dev = vp->v_rdev; struct cdevsw *dsw; int vp_locked, error, ref; @@ -545,24 +552,30 @@ devfs_close(struct vop_close_args *ap) * if the reference count is 2 (this last descriptor * plus the session), release the reference from the session. */ - if (td && vp == td->td_proc->p_session->s_ttyvp) { - oldvp = NULL; - sx_xlock(&proctree_lock); - if (vp == td->td_proc->p_session->s_ttyvp) { - SESS_LOCK(td->td_proc->p_session); - VI_LOCK(vp); - if (count_dev(dev) == 2 && - (vp->v_iflag & VI_DOOMED) == 0) { - td->td_proc->p_session->s_ttyvp = NULL; - td->td_proc->p_session->s_ttydp = NULL; - oldvp = vp; + if (td != NULL) { + p = td->td_proc; + PROC_LOCK(p); + if (vp == p->p_session->s_ttyvp) { + PROC_UNLOCK(p); + oldvp = NULL; + sx_xlock(&proctree_lock); + if (vp == p->p_session->s_ttyvp) { + SESS_LOCK(p->p_session); + VI_LOCK(vp); + if (count_dev(dev) == 2 && + (vp->v_iflag & VI_DOOMED) == 0) { + p->p_session->s_ttyvp = NULL; + p->p_session->s_ttydp = NULL; + oldvp = vp; + } + VI_UNLOCK(vp); + SESS_UNLOCK(p->p_session); } - VI_UNLOCK(vp); - SESS_UNLOCK(td->td_proc->p_session); - } - sx_xunlock(&proctree_lock); - if (oldvp != NULL) - vrele(oldvp); + sx_xunlock(&proctree_lock); + if (oldvp != NULL) + vrele(oldvp); + } else + PROC_UNLOCK(p); } /* * We do not want to really close the device if it @@ -816,6 +829,7 @@ devfs_prison_check(struct devfs_dirent * { struct cdev_priv *cdp; struct ucred *dcr; + struct proc *p; int error; cdp = de->de_cdp; @@ -829,10 +843,15 @@ devfs_prison_check(struct devfs_dirent * if (error == 0) return (0); /* We do, however, allow access to the controlling terminal */ - if (!(td->td_proc->p_flag & P_CONTROLT)) + p = td->td_proc; + PROC_LOCK(p); + if (!(p->p_flag & P_CONTROLT)) { + PROC_UNLOCK(p); return (error); - if (td->td_proc->p_session->s_ttydp == cdp) - return (0); + } + if (p->p_session->s_ttydp == cdp) + error = 0; + PROC_UNLOCK(p); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:17:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAD0272B; Mon, 3 Nov 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC257B64; Mon, 3 Nov 2014 03:17:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33HxSQ010786; Mon, 3 Nov 2014 03:17:59 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33Hxrp010784; Mon, 3 Nov 2014 03:17:59 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201411030317.sA33Hxrp010784@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 3 Nov 2014 03:17: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: r274001 - in stable/10: include sys/dev/acpica 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:18:00 -0000 Author: rpaulo Date: Mon Nov 3 03:17:58 2014 New Revision: 274001 URL: https://svnweb.freebsd.org/changeset/base/274001 Log: MFC 273598 273602 273607 273613 273647: Userland HPET support. Modified: stable/10/include/Makefile stable/10/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/Makefile ============================================================================== --- stable/10/include/Makefile Mon Nov 3 03:12:15 2014 (r274000) +++ stable/10/include/Makefile Mon Nov 3 03:17:58 2014 (r274001) @@ -164,6 +164,8 @@ copies: .endfor cd ${.CURDIR}/../sys/dev/acpica; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ + ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica cd ${.CURDIR}/../sys/dev/agp; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \ @@ -246,7 +248,7 @@ symlinks: done .endfor cd ${.CURDIR}/../sys/dev/acpica; \ - for h in acpiio.h; do \ + for h in acpiio.h acpi_hpet.h; do \ ln -fs ../../../../sys/dev/acpica/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ done Modified: stable/10/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_hpet.c Mon Nov 3 03:12:15 2014 (r274000) +++ stable/10/sys/dev/acpica/acpi_hpet.c Mon Nov 3 03:17:58 2014 (r274001) @@ -35,11 +35,13 @@ __FBSDID("$FreeBSD$"); #include "opt_apic.h" #endif #include +#include #include #include #include #include #include +#include #include #include #include @@ -106,6 +108,19 @@ struct hpet_softc { char name[8]; } t[32]; int num_timers; + struct cdev *pdev; + int mmap_allow; + int mmap_allow_write; +}; + +static d_open_t hpet_open; +static d_mmap_t hpet_mmap; + +static struct cdevsw hpet_cdevsw = { + .d_version = D_VERSION, + .d_name = "hpet", + .d_open = hpet_open, + .d_mmap = hpet_mmap, }; static u_int hpet_get_timecount(struct timecounter *tc); @@ -314,8 +329,37 @@ hpet_find_irq_rid(device_t dev, u_long s } } +static int +hpet_open(struct cdev *cdev, int oflags, int devtype, struct thread *td) +{ + struct hpet_softc *sc; + + sc = cdev->si_drv1; + if (!sc->mmap_allow) + return (EPERM); + else + return (0); +} + +static int +hpet_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr, + int nprot, vm_memattr_t *memattr) +{ + struct hpet_softc *sc; + + sc = cdev->si_drv1; + if (offset > rman_get_size(sc->mem_res)) + return (EINVAL); + if (!sc->mmap_allow_write && (nprot & PROT_WRITE)) + return (EPERM); + *paddr = rman_get_start(sc->mem_res) + offset; + *memattr = VM_MEMATTR_UNCACHEABLE; + + return (0); +} + /* Discover the HPET via the ACPI table of the same name. */ -static void +static void hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; @@ -646,8 +690,8 @@ hpet_attach(device_t dev) #ifdef DEV_APIC if ((t->caps & HPET_TCAP_FSB_INT_DEL) && t->irq >= 0) { uint64_t addr; - uint32_t data; - + uint32_t data; + if (PCIB_MAP_MSI( device_get_parent(device_get_parent(dev)), dev, t->irq, &addr, &data) == 0) { @@ -697,6 +741,31 @@ hpet_attach(device_t dev) maxhpetet++; } } + + sc->pdev = make_dev(&hpet_cdevsw, 0, UID_ROOT, GID_WHEEL, + 0600, "hpet%d", device_get_unit(dev)); + if (sc->pdev) { + sc->pdev->si_drv1 = sc; + sc->mmap_allow = 1; + TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", + &sc->mmap_allow); + sc->mmap_allow_write = 1; + TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write", + &sc->mmap_allow_write); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mmap_allow", + CTLFLAG_RW, &sc->mmap_allow, 0, + "Allow userland to memory map HPET"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mmap_allow_write", + CTLFLAG_RW, &sc->mmap_allow_write, 0, + "Allow userland write to the HPET register space"); + } else + device_printf(dev, "could not create /dev/hpet%d\n", + device_get_unit(dev)); + return (0); } @@ -741,8 +810,8 @@ hpet_resume(device_t dev) #ifdef DEV_APIC if (t->irq >= 0 && (sc->legacy_route == 0 || i >= 2)) { uint64_t addr; - uint32_t data; - + uint32_t data; + if (PCIB_MAP_MSI( device_get_parent(device_get_parent(dev)), dev, t->irq, &addr, &data) == 0) { @@ -813,7 +882,7 @@ hpet_remap_intr(device_t dev, device_t c struct hpet_softc *sc = device_get_softc(dev); struct hpet_timer *t; uint64_t addr; - uint32_t data; + uint32_t data; int error, i; for (i = 0; i < sc->num_timers; i++) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:43:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BFE3B4B; Mon, 3 Nov 2014 03:43:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75BD6DCD; Mon, 3 Nov 2014 03:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33hh0E024015; Mon, 3 Nov 2014 03:43:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33hfNX024011; Mon, 3 Nov 2014 03:43:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030343.sA33hfNX024011@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:43:41 +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: r274002 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:43:43 -0000 Author: mav Date: Mon Nov 3 03:43:40 2014 New Revision: 274002 URL: https://svnweb.freebsd.org/changeset/base/274002 Log: MFC r273711: Allocate buffer for READ BUFFER/WRITE BUFFER commands on demand. These commands are rare, but consume additional 256KB RAM per LUN. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:17:58 2014 (r274001) +++ stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:43:40 2014 (r274002) @@ -4737,6 +4737,7 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5728,7 +5729,7 @@ ctl_read_buffer(struct ctl_scsiio *ctsio len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5741,14 +5742,19 @@ ctl_read_buffer(struct ctl_scsiio *ctsio if ((cdb->byte2 & RWB_MODE) == RWB_MODE_DESCR) { descr[0] = 0; - scsi_ulto3b(sizeof(lun->write_buffer), &descr[1]); + scsi_ulto3b(CTL_WRITE_BUFFER_SIZE, &descr[1]); ctsio->kern_data_ptr = descr; len = min(len, sizeof(descr)); } else if ((cdb->byte2 & RWB_MODE) == RWB_MODE_ECHO_DESCR) { ctsio->kern_data_ptr = echo_descr; len = min(len, sizeof(echo_descr)); - } else + } else { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; + } ctsio->kern_data_len = len; ctsio->kern_total_len = len; ctsio->kern_data_resid = 0; @@ -5786,7 +5792,7 @@ ctl_write_buffer(struct ctl_scsiio *ctsi len = scsi_3btoul(cdb->length); buffer_offset = scsi_3btoul(cdb->offset); - if (buffer_offset + len > sizeof(lun->write_buffer)) { + if (buffer_offset + len > CTL_WRITE_BUFFER_SIZE) { ctl_set_invalid_field(ctsio, /*sks_valid*/ 1, /*command*/ 1, @@ -5802,6 +5808,10 @@ ctl_write_buffer(struct ctl_scsiio *ctsi * malloc it and tell the caller the data buffer is here. */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { + if (lun->write_buffer == NULL) { + lun->write_buffer = malloc(CTL_WRITE_BUFFER_SIZE, + M_CTL, M_WAITOK); + } ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:17:58 2014 (r274001) +++ stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:43:40 2014 (r274002) @@ -384,6 +384,8 @@ struct ctl_devid { */ #define NUM_TARGET_PORT_GROUPS 2 +#define CTL_WRITE_BUFFER_SIZE 262144 + struct tpc_list; struct ctl_lun { struct mtx lun_lock; @@ -417,7 +419,7 @@ struct ctl_lun { int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; - uint8_t write_buffer[262144]; + uint8_t *write_buffer; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:45:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F0ABC89; Mon, 3 Nov 2014 03:45:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1B1DD8; Mon, 3 Nov 2014 03:45:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33j1HT024291; Mon, 3 Nov 2014 03:45:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33j0p3024271; Mon, 3 Nov 2014 03:45:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030345.sA33j0p3024271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:45: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: r274003 - stable/10/sys/cam/ctl 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:45:01 -0000 Author: mav Date: Mon Nov 3 03:44:59 2014 New Revision: 274003 URL: https://svnweb.freebsd.org/changeset/base/274003 Log: MFC r273730, r273731: Reduce code duplication around Write Exclusive persistent reservation. While there, allow some more commands to pass persistent reservation. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl.c Mon Nov 3 03:44:59 2014 (r274003) @@ -5343,8 +5343,7 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi mtx_lock(&lun->lun_lock); if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx != residx)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); goto bailout; } @@ -5695,24 +5694,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; cdb = (struct scsi_read_buffer *)ctsio->cdb; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - if ((cdb->byte2 & RWB_MODE) != RWB_MODE_DATA && (cdb->byte2 & RWB_MODE) != RWB_MODE_ECHO_DESCR && (cdb->byte2 & RWB_MODE) != RWB_MODE_DESCR) { @@ -6644,24 +6625,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) else control_dev = 0; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case MODE_SENSE_6: { struct scsi_mode_sense_6 *cdb; @@ -7198,23 +7161,6 @@ ctl_read_defect(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_read_defect\n")); lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - if (lun->flags & CTL_LUN_PR_RESERVED) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } if (ctsio->cdb[0] == READ_DEFECT_DATA_10) { ccb10 = (struct scsi_read_defect_data_10 *)&ctsio->cdb; @@ -8908,24 +8854,6 @@ ctl_read_write(struct ctl_scsiio *ctsio) isread = ctsio->cdb[0] == READ_6 || ctsio->cdb[0] == READ_10 || ctsio->cdb[0] == READ_12 || ctsio->cdb[0] == READ_16; - if (lun->flags & CTL_LUN_PR_RESERVED && isread) { - uint32_t residx; - - /* - * XXX KDM need a lock here. - */ - residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if ((lun->res_type == SPR_TYPE_EX_AC - && residx != lun->pr_res_idx) - || ((lun->res_type == SPR_TYPE_EX_AC_RO - || lun->res_type == SPR_TYPE_EX_AC_AR) - && lun->pr_keys[residx] == 0)) { - ctl_set_reservation_conflict(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - } - switch (ctsio->cdb[0]) { case READ_6: case WRITE_6: { @@ -11227,27 +11155,29 @@ ctl_scsiio_lun_check(struct ctl_softc *c if ((lun->flags & CTL_LUN_RESERVED) && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_RESV) == 0)) { if (lun->res_idx != residx) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } } - if ((lun->flags & CTL_LUN_PR_RESERVED) - && ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV) == 0)) { + if ((lun->flags & CTL_LUN_PR_RESERVED) == 0 || + (entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_RESV)) { + /* No reservation or command is allowed. */; + } else if ((entry->flags & CTL_CMD_FLAG_ALLOW_ON_PR_WRESV) && + (lun->res_type == SPR_TYPE_WR_EX || + lun->res_type == SPR_TYPE_WR_EX_RO || + lun->res_type == SPR_TYPE_WR_EX_AR)) { + /* The command is allowed for Write Exclusive resv. */; + } else { /* * if we aren't registered or it's a res holder type * reservation and this isn't the res holder then set a * conflict. - * NOTE: Commands which might be allowed on write exclusive - * type reservations are checked in the particular command - * for a conflict. Read and SSU are the only ones. */ if (lun->pr_keys[residx] == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { - ctsio->scsi_status = SCSI_STATUS_RESERV_CONFLICT; - ctsio->io_hdr.status = CTL_SCSI_ERROR; + ctl_set_reservation_conflict(ctsio); retval = 1; goto bailout; } Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Mon Nov 3 03:44:59 2014 (r274003) @@ -259,7 +259,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 10 POPULATE TOKEN */ {ctl_populate_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | - CTL_FLAG_DATA_OUT, + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 16, { 0x10, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -347,7 +348,8 @@ const struct ctl_cmd_entry ctl_cmd_table /* 05 RECEIVE COPY STATUS (LID4) */ {ctl_receive_copy_status_lid4, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x05, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -357,14 +359,16 @@ const struct ctl_cmd_entry ctl_cmd_table /* 07 RECEIVE ROD TOKEN INFORMATION */ {ctl_receive_rod_token_information, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x07, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, /* 08 REPORT ALL ROD TOKENS */ {ctl_report_all_rod_tokens, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 16, {0x08, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, }; @@ -472,7 +476,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0a, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -510,7 +515,8 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_INOPERABLE | CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | - CTL_FLAG_DATA_IN, + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, CTL_LUN_PAT_NONE, 12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -561,7 +567,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 08 READ(6) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}}, /* 09 */ @@ -653,7 +659,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}}, /* 1B START STOP UNIT */ @@ -710,7 +716,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 28 READ(10) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -739,7 +745,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 2F VERIFY(10) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 10, {0x16, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}}, @@ -770,7 +776,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 37 READ DEFECT DATA(10) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0, 0x1f, 0, 0, 0, 0, 0xff, 0xff, 0x07}}, @@ -792,7 +798,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, @@ -918,7 +924,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_CMD_FLAG_OK_ON_SECONDARY | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 5B CLOSE TRACK/SESSION */ @@ -1062,7 +1068,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 88 READ(16) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1097,7 +1103,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 8F VERIFY(16) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 16, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1199,7 +1205,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* A8 READ(12) */ {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1228,7 +1234,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* AF VERIFY(12) */ {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 12, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, @@ -1256,7 +1262,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* B7 READ DEFECT DATA(12) */ {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN | - CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, 12, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:43:40 2014 (r274002) +++ stable/10/sys/cam/ctl/ctl_private.h Mon Nov 3 03:44:59 2014 (r274003) @@ -144,6 +144,7 @@ typedef enum { CTL_CMD_FLAG_NO_SENSE = 0x0010, CTL_CMD_FLAG_OK_ON_ALL_LUNS = 0x0020, CTL_CMD_FLAG_ALLOW_ON_RESV = 0x0040, + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV = 0x0080, CTL_CMD_FLAG_OK_ON_PROC = 0x0100, CTL_CMD_FLAG_OK_ON_SLUN = 0x0200, CTL_CMD_FLAG_OK_ON_BOTH = 0x0300, From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 03:45:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 793A3DCB; Mon, 3 Nov 2014 03:45:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 64CB1DDE; Mon, 3 Nov 2014 03:45:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA33jg8J024446; Mon, 3 Nov 2014 03:45:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA33jf9k024441; Mon, 3 Nov 2014 03:45:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411030345.sA33jf9k024441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 03:45:41 +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: r274004 - in stable/10/sys/cam: ctl scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 03:45:43 -0000 Author: mav Date: Mon Nov 3 03:45:41 2014 New Revision: 274004 URL: https://svnweb.freebsd.org/changeset/base/274004 Log: MFC r273809: Implement better handling for ENOSPC error for both CTL and CAM. This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing the virtual machine, when backing storage (ZFS pool) is getting overflowed. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c stable/10/sys/cam/ctl/ctl_error.c stable/10/sys/cam/ctl/ctl_error.h stable/10/sys/cam/scsi/scsi_all.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Mon Nov 3 03:45:41 2014 (r274004) @@ -504,6 +504,8 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); + } else if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, @@ -714,14 +716,12 @@ ctl_be_block_dispatch_file(struct ctl_be char path_str[32]; ctl_scsi_path_string(io, path_str, sizeof(path_str)); - /* - * XXX KDM ZFS returns ENOSPC when the underlying - * filesystem fills up. What kind of SCSI error should we - * return for that? - */ printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } @@ -807,7 +807,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be * return the I/O to the user. */ if (error != 0) { - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } Modified: stable/10/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_error.c Mon Nov 3 03:45:41 2014 (r274004) @@ -806,6 +806,18 @@ ctl_set_task_aborted(struct ctl_scsiio * } void +ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio) +{ + /* "Space allocation failed write protect" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_DATA_PROTECT, + /*asc*/ 0x27, + /*ascq*/ 0x07, + SSD_ELEM_NONE); +} + +void ctl_set_success(struct ctl_scsiio *ctsio) { struct scsi_sense_data *sense; Modified: stable/10/sys/cam/ctl/ctl_error.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_error.h Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/ctl/ctl_error.h Mon Nov 3 03:45:41 2014 (r274004) @@ -81,6 +81,7 @@ void ctl_set_reservation_conflict(struct void ctl_set_queue_full(struct ctl_scsiio *ctsio); void ctl_set_busy(struct ctl_scsiio *ctsio); void ctl_set_task_aborted(struct ctl_scsiio *ctsio); +void ctl_set_space_alloc_fail(struct ctl_scsiio *ctsio); void ctl_set_success(struct ctl_scsiio *ctsio); #endif /* _CTL_ERROR_H_ */ Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Mon Nov 3 03:44:59 2014 (r274003) +++ stable/10/sys/cam/scsi/scsi_all.c Mon Nov 3 03:45:41 2014 (r274004) @@ -1733,7 +1733,7 @@ static struct asc_table_entry asc_table[ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, /* D B */ - { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + { SST(0x27, 0x07, SS_FATAL | ENOSPC, "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 04:16:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90665402; Mon, 3 Nov 2014 04:16:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D561E7; Mon, 3 Nov 2014 04:16:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA34G5ln038393; Mon, 3 Nov 2014 04:16:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA34G5Oe038392; Mon, 3 Nov 2014 04:16:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411030416.sA34G5Oe038392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 04:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274005 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 04:16:05 -0000 Author: mjg Date: Mon Nov 3 04:16:04 2014 New Revision: 274005 URL: https://svnweb.freebsd.org/changeset/base/274005 Log: filedesc: create a dedicated zone for struct filedesc0 Currently sizeof(struct filedesc0) is 1096 bytes, which means allocations from malloc use 2048 bytes. There is no easy way to shrink the structure <= 1024 an it is likely to grow in the future. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Nov 3 03:45:41 2014 (r274004) +++ head/sys/kern/kern_descrip.c Mon Nov 3 04:16:04 2014 (r274005) @@ -98,6 +98,7 @@ MALLOC_DEFINE(M_FILECAPS, "filecaps", "d MALLOC_DECLARE(M_FADVISE); static uma_zone_t file_zone; +static uma_zone_t filedesc0_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); @@ -1801,7 +1802,7 @@ fdinit(struct filedesc *fdp) struct filedesc0 *newfdp0; struct filedesc *newfdp; - newfdp0 = malloc(sizeof *newfdp0, M_FILEDESC, M_WAITOK | M_ZERO); + newfdp0 = uma_zalloc(filedesc0_zone, M_WAITOK | M_ZERO); newfdp = &newfdp0->fd_fd; /* Create the file descriptor table. */ @@ -1865,7 +1866,7 @@ fddrop(struct filedesc *fdp) return; FILEDESC_LOCK_DESTROY(fdp); - free(fdp, M_FILEDESC); + uma_zfree(filedesc0_zone, fdp); } /* @@ -3538,6 +3539,8 @@ filelistinit(void *dummy) file_zone = uma_zcreate("Files", sizeof(struct file), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + filedesc0_zone = uma_zcreate("filedesc0", sizeof(struct filedesc0), + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&sigio_lock, "sigio lock", NULL, MTX_DEF); mtx_init(&fdesc_mtx, "fdesc", NULL, MTX_DEF); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 04:41:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FD9A76E; Mon, 3 Nov 2014 04:41:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6D0351; Mon, 3 Nov 2014 04:41:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA34fUeh051562; Mon, 3 Nov 2014 04:41:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA34fUIu051561; Mon, 3 Nov 2014 04:41:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411030441.sA34fUIu051561@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 3 Nov 2014 04:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274006 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 04:41:30 -0000 Author: delphij Date: Mon Nov 3 04:41:29 2014 New Revision: 274006 URL: https://svnweb.freebsd.org/changeset/base/274006 Log: Don't assert random_adaptors_lock in random_adaptor_read_rate(). Reported by: many Pointy hat to: delphij (for not testing the commit with WITNESS) Approved by: so Modified: head/sys/dev/random/random_adaptors.c Modified: head/sys/dev/random/random_adaptors.c ============================================================================== --- head/sys/dev/random/random_adaptors.c Mon Nov 3 04:16:04 2014 (r274005) +++ head/sys/dev/random/random_adaptors.c Mon Nov 3 04:41:29 2014 (r274006) @@ -275,10 +275,6 @@ random_adaptor_read_rate(void) { int ret; - sx_assert(&random_adaptors_lock, SA_LOCKED); - - KASSERT(random_adaptor != NULL, ("No active random adaptor in %s", __func__)); - mtx_lock(&random_read_rate_mtx); ret = random_adaptor_read_rate_cache; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:12:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57A50B6C; Mon, 3 Nov 2014 05:12:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 448427FD; Mon, 3 Nov 2014 05:12:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35CIBd065745; Mon, 3 Nov 2014 05:12:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35CIpU065744; Mon, 3 Nov 2014 05:12:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411030512.sA35CIpU065744@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 05:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274007 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 05:12:18 -0000 Author: mjg Date: Mon Nov 3 05:12:17 2014 New Revision: 274007 URL: https://svnweb.freebsd.org/changeset/base/274007 Log: filedesc: plug unnecessary fdp NULL checks in fdescfreee and fdcopy Anything reaching these functions has fd table. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Nov 3 04:41:29 2014 (r274006) +++ head/sys/kern/kern_descrip.c Mon Nov 3 05:12:17 2014 (r274007) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef KTRACE #include #endif @@ -1910,9 +1911,7 @@ fdcopy(struct filedesc *fdp) struct filedescent *nfde, *ofde; int i; - /* Certain daemons might not have file descriptors. */ - if (fdp == NULL) - return (NULL); + MPASS(fdp != NULL); newfdp = fdinit(fdp); /* copy all passable descriptors (i.e. not kqueue) */ @@ -2034,10 +2033,8 @@ fdescfree(struct thread *td) struct vnode *cdir, *jdir, *rdir; int i; - /* Certain daemons might not have file descriptors. */ fdp = td->td_proc->p_fd; - if (fdp == NULL) - return; + MPASS(fdp != NULL); #ifdef RACCT PROC_LOCK(td->td_proc); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:35:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A08D6E91; Mon, 3 Nov 2014 05:35:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8F89A8; Mon, 3 Nov 2014 05:35:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35Zk8D075300; Mon, 3 Nov 2014 05:35:46 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35ZkbD075298; Mon, 3 Nov 2014 05:35:46 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030535.sA35ZkbD075298@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05:35: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: r274008 - stable/10/sbin/fdisk_pc98 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 05:35:46 -0000 Author: nyan Date: Mon Nov 3 05:35:45 2014 New Revision: 274008 URL: https://svnweb.freebsd.org/changeset/base/274008 Log: MFC: r272243 Add missing library dependencies. Modified: stable/10/sbin/fdisk_pc98/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/10/sbin/fdisk_pc98/Makefile Mon Nov 3 05:12:17 2014 (r274007) +++ stable/10/sbin/fdisk_pc98/Makefile Mon Nov 3 05:35:45 2014 (r274008) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:36:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D549FBF; Mon, 3 Nov 2014 05:36:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 892489AE; Mon, 3 Nov 2014 05:36:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35aDVI075427; Mon, 3 Nov 2014 05:36:13 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35aDvx075426; Mon, 3 Nov 2014 05:36:13 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030536.sA35aDvx075426@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05:36: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: r274009 - stable/9/sbin/fdisk_pc98 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 05:36:13 -0000 Author: nyan Date: Mon Nov 3 05:36:12 2014 New Revision: 274009 URL: https://svnweb.freebsd.org/changeset/base/274009 Log: MFC: r272243 Add missing library dependencies. Modified: stable/9/sbin/fdisk_pc98/Makefile Directory Properties: stable/9/sbin/fdisk_pc98/ (props changed) Modified: stable/9/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/9/sbin/fdisk_pc98/Makefile Mon Nov 3 05:35:45 2014 (r274008) +++ stable/9/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:12 2014 (r274009) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 05:36:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248E217E; Mon, 3 Nov 2014 05:36:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 106799B7; Mon, 3 Nov 2014 05:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA35aZ1n075517; Mon, 3 Nov 2014 05:36:35 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA35aZ7M075515; Mon, 3 Nov 2014 05:36:35 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030536.sA35aZ7M075515@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 05:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274010 - stable/8/sbin/fdisk_pc98 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 05:36:36 -0000 Author: nyan Date: Mon Nov 3 05:36:35 2014 New Revision: 274010 URL: https://svnweb.freebsd.org/changeset/base/274010 Log: MFC: r272243 Add missing library dependencies. Modified: stable/8/sbin/fdisk_pc98/Makefile Directory Properties: stable/8/sbin/fdisk_pc98/ (props changed) Modified: stable/8/sbin/fdisk_pc98/Makefile ============================================================================== --- stable/8/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:12 2014 (r274009) +++ stable/8/sbin/fdisk_pc98/Makefile Mon Nov 3 05:36:35 2014 (r274010) @@ -7,7 +7,7 @@ MAN= fdisk.8 .PATH: ${.CURDIR}/../../sys/geom -DPADD += ${LIBGEOM} -LDADD += -lgeom +DPADD+= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lgeom -lbsdxml -lsbuf .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:07:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 250BB647; Mon, 3 Nov 2014 06:07:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 115D3C45; Mon, 3 Nov 2014 06:07:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA367tcT089369; Mon, 3 Nov 2014 06:07:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA367tbj089368; Mon, 3 Nov 2014 06:07:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411030607.sA367tbj089368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 06:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274011 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 06:07:56 -0000 Author: ngie Date: Mon Nov 3 06:07:55 2014 New Revision: 274011 URL: https://svnweb.freebsd.org/changeset/base/274011 Log: Integrate usr.sbin/useradd/t_useradd.sh from NetBSD into FreeBSD as pw_test - Suffix useradd/userdel commands with pw - Remove the atf_expect_fail for bin/39546 Phabric: D921 Reviewed by: brd Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Mon Nov 3 05:36:35 2014 (r274010) +++ head/usr.sbin/pw/tests/Makefile Mon Nov 3 06:07:55 2014 (r274011) @@ -1,5 +1,8 @@ # $FreeBSD$ +TESTSRC= ${.CURDIR}/../../../contrib/netbsd-tests/usr.sbin/useradd +.PATH: ${TESTSRC} + TESTSDIR= ${TESTSBASE}/usr.sbin/pw ATF_TESTS_SH= pw_delete pw_modify @@ -7,4 +10,12 @@ ATF_TESTS_SH= pw_delete pw_modify FILES= group helper_functions.shin master.passwd FILESDIR= ${TESTSDIR} +ATF_TESTS_SH+= pw_test +# - user{add,del} does not exist on FreeBSD; use pw user{add,del} instead +# - The command passes on FreeBSD +ATF_TESTS_SH_SED_pw_test= -e 's/useradd /pw useradd /' +ATF_TESTS_SH_SED_pw_test+= -e 's/userdel /pw userdel /' +ATF_TESTS_SH_SED_pw_test+= -e '/atf_expect_fail "PR bin\/39546"/d' +ATF_TESTS_SH_SRC_pw_test= t_useradd.sh + .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:24:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75DD7A8E; Mon, 3 Nov 2014 06:24:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C3DCDC1; Mon, 3 Nov 2014 06:24:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36Oic8098406; Mon, 3 Nov 2014 06:24:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36OiqR098405; Mon, 3 Nov 2014 06:24:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411030624.sA36OiqR098405@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 06:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274012 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 06:24:44 -0000 Author: mjg Date: Mon Nov 3 06:24:43 2014 New Revision: 274012 URL: https://svnweb.freebsd.org/changeset/base/274012 Log: filedesc: plus sys/kdb.h include which crept in with r274007 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Nov 3 06:07:55 2014 (r274011) +++ head/sys/kern/kern_descrip.c Mon Nov 3 06:24:43 2014 (r274012) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef KTRACE #include #endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:33:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AB64CD3; Mon, 3 Nov 2014 06:33:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 068F2E8E; Mon, 3 Nov 2014 06:33:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36XqUZ003152; Mon, 3 Nov 2014 06:33:52 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36XqTv003151; Mon, 3 Nov 2014 06:33:52 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030633.sA36XqTv003151@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:33:52 +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: r274013 - stable/10/rescue/rescue 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 06:33:53 -0000 Author: nyan Date: Mon Nov 3 06:33:52 2014 New Revision: 274013 URL: https://svnweb.freebsd.org/changeset/base/274013 Log: MFC: r272245 Remove duplicate prog. Modified: stable/10/rescue/rescue/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/rescue/rescue/Makefile ============================================================================== --- stable/10/rescue/rescue/Makefile Mon Nov 3 06:24:43 2014 (r274012) +++ stable/10/rescue/rescue/Makefile Mon Nov 3 06:33:52 2014 (r274013) @@ -140,7 +140,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:34:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 173D3DFE; Mon, 3 Nov 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0322BE93; Mon, 3 Nov 2014 06:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36Y8iE003260; Mon, 3 Nov 2014 06:34:08 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36Y8p7003259; Mon, 3 Nov 2014 06:34:08 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030634.sA36Y8p7003259@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:34: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: r274014 - stable/9/rescue/rescue 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 06:34:09 -0000 Author: nyan Date: Mon Nov 3 06:34:08 2014 New Revision: 274014 URL: https://svnweb.freebsd.org/changeset/base/274014 Log: MFC: r272245 Remove duplicate prog. Modified: stable/9/rescue/rescue/Makefile Directory Properties: stable/9/rescue/ (props changed) stable/9/rescue/rescue/ (props changed) Modified: stable/9/rescue/rescue/Makefile ============================================================================== --- stable/9/rescue/rescue/Makefile Mon Nov 3 06:33:52 2014 (r274013) +++ stable/9/rescue/rescue/Makefile Mon Nov 3 06:34:08 2014 (r274014) @@ -139,7 +139,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 06:34:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B3CFF5F; Mon, 3 Nov 2014 06:34:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2720DE9B; Mon, 3 Nov 2014 06:34:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA36YTJl003352; Mon, 3 Nov 2014 06:34:29 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA36YTNY003351; Mon, 3 Nov 2014 06:34:29 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411030634.sA36YTNY003351@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 06:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274015 - stable/8/rescue/rescue X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 06:34:29 -0000 Author: nyan Date: Mon Nov 3 06:34:28 2014 New Revision: 274015 URL: https://svnweb.freebsd.org/changeset/base/274015 Log: MFC: r272245 Remove duplicate prog. Modified: stable/8/rescue/rescue/Makefile Directory Properties: stable/8/rescue/ (props changed) stable/8/rescue/rescue/ (props changed) Modified: stable/8/rescue/rescue/Makefile ============================================================================== --- stable/8/rescue/rescue/Makefile Mon Nov 3 06:34:08 2014 (r274014) +++ stable/8/rescue/rescue/Makefile Mon Nov 3 06:34:28 2014 (r274015) @@ -157,7 +157,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel .endif .if ${MACHINE} == "pc98" -CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 07:18:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D33D77B5; Mon, 3 Nov 2014 07:18:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC976286; Mon, 3 Nov 2014 07:18:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA37Intq022849; Mon, 3 Nov 2014 07:18:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA37Igm2022805; Mon, 3 Nov 2014 07:18:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411030718.sA37Igm2022805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 07:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274016 - in head: . etc/mtree share/doc share/doc/pjdfstest tests/sys tests/sys/pjdfstest tests/sys/pjdfstest/pjdfstest tests/sys/pjdfstest/tests tests/sys/pjdfstest/tests/chflags 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 07:18:49 -0000 Author: ngie Date: Mon Nov 3 07:18:42 2014 New Revision: 274016 URL: https://svnweb.freebsd.org/changeset/base/274016 Log: Integrate pjdfstest test suite execution into kyua pjdfstest execution is opt-in and must be done as root due to some of the assumptions made by the test suite and lack of error checking in the non-root case A description of how to execute pjdfstest with kyua is provided in share/pjdfstest/README Phabric: D824 (an earlier prototype patch) MFC after: 1 month Relnotes: yes Sponsored by: EMC / Isilon Storage Division Added: head/share/doc/pjdfstest/ head/share/doc/pjdfstest/Makefile (contents, props changed) head/share/doc/pjdfstest/README (contents, props changed) head/tests/sys/pjdfstest/ head/tests/sys/pjdfstest/Makefile (contents, props changed) head/tests/sys/pjdfstest/pjdfstest/ head/tests/sys/pjdfstest/pjdfstest/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/ head/tests/sys/pjdfstest/tests/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/chflags/ head/tests/sys/pjdfstest/tests/chflags/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/chmod/ head/tests/sys/pjdfstest/tests/chmod/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/chown/ head/tests/sys/pjdfstest/tests/chown/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/conf (contents, props changed) head/tests/sys/pjdfstest/tests/ftruncate/ head/tests/sys/pjdfstest/tests/ftruncate/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/granular/ head/tests/sys/pjdfstest/tests/granular/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/link/ head/tests/sys/pjdfstest/tests/link/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/mkdir/ head/tests/sys/pjdfstest/tests/mkdir/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/mkfifo/ head/tests/sys/pjdfstest/tests/mkfifo/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/mknod/ head/tests/sys/pjdfstest/tests/mknod/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/open/ head/tests/sys/pjdfstest/tests/open/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/pjdfstest.test.mk (contents, props changed) head/tests/sys/pjdfstest/tests/rename/ head/tests/sys/pjdfstest/tests/rename/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/rmdir/ head/tests/sys/pjdfstest/tests/rmdir/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/symlink/ head/tests/sys/pjdfstest/tests/symlink/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/truncate/ head/tests/sys/pjdfstest/tests/truncate/Makefile (contents, props changed) head/tests/sys/pjdfstest/tests/unlink/ head/tests/sys/pjdfstest/tests/unlink/Makefile (contents, props changed) Modified: head/UPDATING head/etc/mtree/BSD.tests.dist head/share/doc/Makefile head/tests/sys/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 3 06:34:28 2014 (r274015) +++ head/UPDATING Mon Nov 3 07:18:42 2014 (r274016) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20141102: + pjdfstest has been integrated into kyua as an opt-in test suite. + Please see share/doc/pjdfstest/README for a more details on how to + execute it. + 20141009: gperf has been removed from the base system for architectures that use clang. Ports that require gperf will obtain it from the Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 3 06:34:28 2014 (r274015) +++ head/etc/mtree/BSD.tests.dist Mon Nov 3 07:18:42 2014 (r274016) @@ -17,6 +17,8 @@ doc atf .. + pjdfstest + .. .. .. tests @@ -143,6 +145,38 @@ .. netinet .. + pjdfstest + chflags + .. + chmod + .. + chown + .. + ftruncate + .. + granular + .. + link + .. + mkdir + .. + mkfifo + .. + mknod + .. + open + .. + rename + .. + rmdir + .. + symlink + .. + truncate + .. + unlink + .. + .. .. usr.bin apply Modified: head/share/doc/Makefile ============================================================================== --- head/share/doc/Makefile Mon Nov 3 06:34:28 2014 (r274015) +++ head/share/doc/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -7,10 +7,12 @@ SUBDIR= ${_IPv6} \ ${_atf} \ legal \ ${_llvm} \ + ${_pjdfstest} \ ${_roffdocs} .if ${MK_TESTS} != "no" _atf= atf +_pjdfstest= pjdfstest .endif .if ${MK_CLANG} != "no" Added: head/share/doc/pjdfstest/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/pjdfstest/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/doc/pjdfstest +FILES= README + +.include Added: head/share/doc/pjdfstest/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/pjdfstest/README Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,36 @@ +pjdfstest test suite execution is integrated into kyua. This README describes +how to use pjdfstest in the default configuration (kyua work directory), and +with a specific filesystem path. + +Method 1. Executing with default configuration (kyua work directory) + + 1. Elevate privileges: + % su - + 2. cd to the tests directory: + % cd /usr/tests/sys/pjdfstest + 3. Run kyua: + % kyua test + + Executing the commands as shown above will run pjdfstest in the kyua work + directory. The kyua work directory defaults to a random generated path under + /tmp; please see TMPDIR in kyua(1) for more details on how the temporary path + is chosen with kyua. + +Method 2. Executing with a specific filesystem path (in this case /mnt) + + 1. Elevate privileges: + % su - + 2. cd to the tests directory: + % cd /usr/tests/sys/pjdfstest + 3. Run kyua: + % env PJDFSTEST_TEST_PATH=/mnt kyua test + + WARNING: the above method violates the test program isolation algorithm + described in kyua(1); as such, $PJDFSTEST_TEST_PATH must be cleaned up after + executing the testcases. + + It's highly recommended that $PJDFSTEST_TEST_PATH be pointed to a sandboxed + filesystem, e.g. a small UFS-formatted memory disk or ZFS dataset with + quotas enabled, so the filesystem can be easily destroyed after the test + execution is complete, and the testcases are properly bounded both in terms + of time and space. Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Nov 3 06:34:28 2014 (r274015) +++ head/tests/sys/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -4,9 +4,13 @@ .PATH: ${.CURDIR}/.. +TESTSDIR= ${TESTSBASE}/sys + TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= netinet -TESTSDIR= ${TESTSBASE}/sys + +# Items not integrated into kyua runs by default +SUBDIR+= pjdfstest KYUAFILE= yes Added: head/tests/sys/pjdfstest/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SUBDIR+= pjdfstest +SUBDIR+= tests + +.include Added: head/tests/sys/pjdfstest/pjdfstest/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/pjdfstest/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +TOP= ${.CURDIR:H:H:H:H} + +.PATH: ${TOP}/contrib/pjdfstest + +BINDIR= ${TESTSBASE}/sys/pjdfstest +PROG= pjdfstest +MAN= + +CFLAGS= -D__OS_FreeBSD__ -DHAS_LCHMOD -DHAS_CHFLAGS -DHAS_FCHFLAGS +CFLAGS+= -DHAS_CHFLAGSAT -DHAS_LCHFLAGS -DHAS_FREEBSD_ACL -DHAS_BINDAT +CFLAGS+= -DHAS_CONNECTAT + +# XXX: the upstream sources need some massaging with how it assigns ngroups in +# pjdfstest.c +NO_WERROR= +WARNS?= 6 + +.include Added: head/tests/sys/pjdfstest/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PJDFSTEST_SRCDIR= ${.CURDIR:H:H:H:H}/contrib/pjdfstest + +TESTSDIR= ${TESTSBASE}/sys/pjdfstest + +.PATH: ${.CURDIR} + +FILESDIR= ${TESTSDIR} +FILES= conf +FILES+= misc.sh +CLEANFILES+= misc.sh misc.sh.tmp + +misc.sh: ${PJDFSTEST_SRCDIR}/tests/misc.sh + sed -e '\,maindir=,s,maindir=.*,maindir=`dirname $$0`/../,' < ${.ALLSRC} > ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + +afterinstall: install-tests-symlink +install-tests-symlink: .PHONY + rm -f ${DESTDIR}${TESTSDIR}/tests + ${INSTALL_SYMLINK} . ${DESTDIR}${TESTSDIR}/tests + +TESTS_SUBDIRS= chflags +TESTS_SUBDIRS+= chmod +TESTS_SUBDIRS+= chown +TESTS_SUBDIRS+= ftruncate +TESTS_SUBDIRS+= granular +TESTS_SUBDIRS+= link +TESTS_SUBDIRS+= mkdir +TESTS_SUBDIRS+= mkfifo +TESTS_SUBDIRS+= mknod +TESTS_SUBDIRS+= open +TESTS_SUBDIRS+= rename +TESTS_SUBDIRS+= rmdir +TESTS_SUBDIRS+= symlink +TESTS_SUBDIRS+= truncate +TESTS_SUBDIRS+= unlink + +.include Added: head/tests/sys/pjdfstest/tests/chflags/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/chflags/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/chmod/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/chmod/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/chown/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/chown/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/conf Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,15 @@ +#!/bin/sh +# +# $FreeBSD$ + +: ${PJDFSTEST_TEST_PATH=.} +if ! cd ${PJDFSTEST_TEST_PATH}/; then + echo 'Please set PJDFSTEST_TEST_PATH to a valid filesystem path' + echo 'Bail out!' + exit 1 +fi + +GREP=grep +mountpoint=$(df . | tail -1 | awk '{print $6}') +fs=$(mount -p | awk '$2 == "'$mountpoint'" { print toupper($3) }') +os=FreeBSD Added: head/tests/sys/pjdfstest/tests/ftruncate/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/ftruncate/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/granular/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/granular/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/link/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/link/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 +TAP_TESTS_SH+= 15 +TAP_TESTS_SH+= 16 +TAP_TESTS_SH+= 17 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/mkdir/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/mkdir/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/mkfifo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/mkfifo/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/mknod/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/mknod/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/open/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/open/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 +TAP_TESTS_SH+= 15 +TAP_TESTS_SH+= 16 +TAP_TESTS_SH+= 17 +TAP_TESTS_SH+= 18 +TAP_TESTS_SH+= 19 +TAP_TESTS_SH+= 20 +TAP_TESTS_SH+= 21 +TAP_TESTS_SH+= 22 +TAP_TESTS_SH+= 23 +TAP_TESTS_SH+= 24 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/pjdfstest.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/pjdfstest.test.mk Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PJDFSTEST_SRCDIR= ${.CURDIR:H:H:H:H:H}/contrib/pjdfstest + +.PATH: ${PJDFSTEST_SRCDIR}/tests/${.CURDIR:T} + +TESTSDIR?= ${TESTSBASE}/sys/pjdfstest/${.CURDIR:T} + +.for s in ${TAP_TESTS_SH} +TAP_TESTS_SH_SRC_$s= $s.t +TEST_METADATA.$s+= required_user="root" +.endfor + +.include Added: head/tests/sys/pjdfstest/tests/rename/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/rename/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 +TAP_TESTS_SH+= 15 +TAP_TESTS_SH+= 16 +TAP_TESTS_SH+= 17 +TAP_TESTS_SH+= 18 +TAP_TESTS_SH+= 19 +TAP_TESTS_SH+= 20 +TAP_TESTS_SH+= 21 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/rmdir/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/rmdir/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 +TAP_TESTS_SH+= 15 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/symlink/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/symlink/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/truncate/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/truncate/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 +TAP_TESTS_SH+= 14 + +.include "../pjdfstest.test.mk" Added: head/tests/sys/pjdfstest/tests/unlink/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/pjdfstest/tests/unlink/Makefile Mon Nov 3 07:18:42 2014 (r274016) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +TAP_TESTS_SH= 00 +TAP_TESTS_SH+= 01 +TAP_TESTS_SH+= 02 +TAP_TESTS_SH+= 03 +TAP_TESTS_SH+= 04 +TAP_TESTS_SH+= 05 +TAP_TESTS_SH+= 06 +TAP_TESTS_SH+= 07 +TAP_TESTS_SH+= 08 +TAP_TESTS_SH+= 09 +TAP_TESTS_SH+= 10 +TAP_TESTS_SH+= 11 +TAP_TESTS_SH+= 12 +TAP_TESTS_SH+= 13 + +.include "../pjdfstest.test.mk" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 3 06:34:28 2014 (r274015) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Nov 3 07:18:42 2014 (r274016) @@ -4068,9 +4068,10 @@ OLD_DIRS+=usr/share/sendmail/cf OLD_DIRS+=usr/share/sendmail .endif -#.if ${MK_SHAREDOCS} == no -# to be filled in -#.endif +.if ${MK_SHAREDOCS} == no +OLD_FILES+=usr/share/doc/pjdfstest/README +OLD_DIRS+=usr/share/doc/pjdfstest +.endif #.if ${MK_SYSCONS} == no # to be filled in From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 07:20:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F12E937; Mon, 3 Nov 2014 07:20:05 +0000 (UTC) Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F13392A1; Mon, 3 Nov 2014 07:20:04 +0000 (UTC) Received: by mail-pa0-f52.google.com with SMTP id fa1so11655878pad.11 for ; Sun, 02 Nov 2014 23:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=LGuA9dCnRyUBimpXPlp46VgZlEZWbUHF1ZYME8hMwUo=; b=vBBu2GHR5s45Le7UQQYwdl9jBmOOVOvZTSIOkylqdMqCfWMTBLy31521ab7p9t1VC0 m9yIymmFRjKJNqGErkMUEdvgimghFQ6KJ1EWmeD7jRpI7msax2q5qasZhSztJID0wKWd NhrnKSdEcHHOEU4bu+PlFa2IU/lBsC0T3jU828ttzSWEB69h5p5V/m4FV1EDya6sXyiO Bc9//+a+5+TVbNIrXMG2qiOwxy1CH7afPjdLBeFQa00Yg2ClRHDRLw4X4+GxVMKLxFiN VKf7yg/t1FiT8jcybdzXbL1lFxD8SXvCUthZvxiKKcIYh8hMBjBiJHWNYzts1I/F3Qc4 p/1g== X-Received: by 10.70.40.197 with SMTP id z5mr1775984pdk.120.1414999204648; Sun, 02 Nov 2014 23:20:04 -0800 (PST) Received: from [172.16.0.156] (50-206-19-250-static.hfc.comcastbusiness.net. [50.206.19.250]) by mx.google.com with ESMTPSA id qc8sm16274600pdb.70.2014.11.02.23.20.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Nov 2014 23:20:04 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_F75B7539-3E6B-48AB-B668-27B43609B534"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274016 - in head: . etc/mtree share/doc share/doc/pjdfstest tests/sys tests/sys/pjdfstest tests/sys/pjdfstest/pjdfstest tests/sys/pjdfstest/tests tests/sys/pjdfstest/tests/chflags test... From: Garrett Cooper In-Reply-To: <201411030718.sA37Igm2022805@svn.freebsd.org> Date: Sun, 2 Nov 2014 23:20:03 -0800 Message-Id: <8C609207-88CD-4264-B324-25FD08C9D497@gmail.com> References: <201411030718.sA37Igm2022805@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 07:20:05 -0000 --Apple-Mail=_F75B7539-3E6B-48AB-B668-27B43609B534 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 2, 2014, at 23:18, Garrett Cooper wrote: > Author: ngie > Date: Mon Nov 3 07:18:42 2014 > New Revision: 274016 > URL: https://svnweb.freebsd.org/changeset/base/274016 >=20 > Log: > Integrate pjdfstest test suite execution into kyua >=20 > pjdfstest execution is opt-in and must be done as root due to some of = the > assumptions made by the test suite and lack of error checking in the = non-root > case >=20 > A description of how to execute pjdfstest with kyua is provided in > share/pjdfstest/README I apologize =97 I meant to say =93share/doc/pjdfstest/README=94. I=92ll = correct this in the MFC message. Thanks! --Apple-Mail=_F75B7539-3E6B-48AB-B668-27B43609B534 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUVyyjAAoJEMZr5QU6S73eUqEH/1xJ0xNIOyA0vAO8hhwjPGkS 4Gc7/o0ZTp9iGco/3fqs1We3ZiNXnDDhIf7HUa61+6Oo/4C1kQsAGStG2dPROC+e tYcES47OMz5yOWhn1QbaKOLS1A64jFO1Lwh5Q9DS578tWNn//zsXB1gU/YMY8/DZ 1sDvSZAqtSh3cm5Xn9tXHs/rZaaeScTAGlzo6MN8YqQlfea5O5kfAXUiHNnkry5k VjUL89A37XvXl5Qf9hJn3VYcZiffT8Zx65uEiSFbLcncK18mt3uq8XTH0/xCnvso jF8nVObBm72p6fbHbJ839QKzmaqMBTM9dKyhwn4gITJ4tianSvbE8QfEC532m6E= =Dxgo -----END PGP SIGNATURE----- --Apple-Mail=_F75B7539-3E6B-48AB-B668-27B43609B534-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 07:46:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B79BDC; Mon, 3 Nov 2014 07:46:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07FB27AE; Mon, 3 Nov 2014 07:46:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA37kpO0037114; Mon, 3 Nov 2014 07:46:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA37kpPu037113; Mon, 3 Nov 2014 07:46:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411030746.sA37kpPu037113@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 07:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274017 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 07:46:52 -0000 Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for small ioctl requests. Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Mon Nov 3 07:18:42 2014 (r274016) +++ head/sys/kern/sys_generic.c Mon Nov 3 07:46:51 2014 (r274017) @@ -649,6 +649,7 @@ sys_ioctl(struct thread *td, struct ioct u_long com; int arg, error; u_int size; + u_char smalldata[128]; caddr_t data; if (uap->com > 0xffffffff) { @@ -680,17 +681,18 @@ sys_ioctl(struct thread *td, struct ioct arg = (intptr_t)uap->data; data = (void *)&arg; size = 0; - } else - data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); + } else { + if (size <= sizeof(smalldata)) + data = smalldata; + else + data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); + } } else data = (void *)&uap->data; if (com & IOC_IN) { error = copyin(uap->data, data, (u_int)size); - if (error) { - if (size > 0) - free(data, M_IOCTLOPS); - return (error); - } + if (error != 0) + goto out; } else if (com & IOC_OUT) { /* * Zero the buffer so the user always @@ -704,7 +706,8 @@ sys_ioctl(struct thread *td, struct ioct if (error == 0 && (com & IOC_OUT)) error = copyout(data, uap->data, (u_int)size); - if (size > 0) +out: + if (size > 0 && data != (caddr_t)&smalldata) free(data, M_IOCTLOPS); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:21:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABB4BB78; Mon, 3 Nov 2014 08:21:16 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EB80AEA; Mon, 3 Nov 2014 08:21:16 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id sA38L9XO021931 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 3 Nov 2014 00:21:14 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54573AEE.9010602@freebsd.org> Date: Mon, 03 Nov 2014 16:21:02 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> In-Reply-To: <201411030746.sA37kpPu037113@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:21:16 -0000 On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > Author: mjg > Date: Mon Nov 3 07:46:51 2014 > New Revision: 274017 > URL: https://svnweb.freebsd.org/changeset/base/274017 > > Log: > Provide an on-stack temporary buffer for small ioctl requests. I'm not sure I like this. We don't know how many more levels of stack may be needed. I know that machines are getting faster with more memory, but the current move towards bloating out the worries me. we started out with a single page of stack (SHARED with the U-area!). I think we are now at several pages.. I forget, is it 8? I'm open to being persuaded but I think we need to have a discussion about stack usage. We used to say that anything greater that, say 64 bytes should probably be allocated. > Modified: > head/sys/kern/sys_generic.c > > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Mon Nov 3 07:18:42 2014 (r274016) > +++ head/sys/kern/sys_generic.c Mon Nov 3 07:46:51 2014 (r274017) > @@ -649,6 +649,7 @@ sys_ioctl(struct thread *td, struct ioct > u_long com; > int arg, error; > u_int size; > + u_char smalldata[128]; > caddr_t data; > > if (uap->com > 0xffffffff) { > @@ -680,17 +681,18 @@ sys_ioctl(struct thread *td, struct ioct > arg = (intptr_t)uap->data; > data = (void *)&arg; > size = 0; > - } else > - data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + } else { > + if (size <= sizeof(smalldata)) > + data = smalldata; > + else > + data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + } > } else > data = (void *)&uap->data; > if (com & IOC_IN) { > error = copyin(uap->data, data, (u_int)size); > - if (error) { > - if (size > 0) > - free(data, M_IOCTLOPS); > - return (error); > - } > + if (error != 0) > + goto out; > } else if (com & IOC_OUT) { > /* > * Zero the buffer so the user always > @@ -704,7 +706,8 @@ sys_ioctl(struct thread *td, struct ioct > if (error == 0 && (com & IOC_OUT)) > error = copyout(data, uap->data, (u_int)size); > > - if (size > 0) > +out: > + if (size > 0 && data != (caddr_t)&smalldata) > free(data, M_IOCTLOPS); > return (error); > } > > > From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:23:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DBFA8E4D; Mon, 3 Nov 2014 08:23:49 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F355BA3; Mon, 3 Nov 2014 08:23:49 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id sA38NgTY021951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 3 Nov 2014 00:23:46 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <54573B87.7000801@freebsd.org> Date: Mon, 03 Nov 2014 16:23:35 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> In-Reply-To: <54573AEE.9010602@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:23:50 -0000 On 11/3/14, 4:21 PM, Julian Elischer wrote: > On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >> Author: mjg >> Date: Mon Nov 3 07:46:51 2014 >> New Revision: 274017 >> URL: https://svnweb.freebsd.org/changeset/base/274017 >> >> Log: >> Provide an on-stack temporary buffer for small ioctl requests. > I'm not sure I like this. We don't know how many more levels > of stack may be needed. > I know that machines are getting faster with more memory, > but the current move towards bloating out the ... "bloating out the stack" ... > worries me. we started out with a single page of stack (SHARED > with the U-area!). I think we are now at several pages.. I forget, > is it 8? > I'm open to being persuaded but I think we need to have a discussion > about stack usage. We used to say that anything greater that, say > 64 bytes should probably be allocated. > >> Modified: >> head/sys/kern/sys_generic.c >> >> Modified: head/sys/kern/sys_generic.c >> ============================================================================== >> >> --- head/sys/kern/sys_generic.c Mon Nov 3 07:18:42 2014 (r274016) >> +++ head/sys/kern/sys_generic.c Mon Nov 3 07:46:51 2014 (r274017) >> @@ -649,6 +649,7 @@ sys_ioctl(struct thread *td, struct ioct >> u_long com; >> int arg, error; >> u_int size; >> + u_char smalldata[128]; >> caddr_t data; >> if (uap->com > 0xffffffff) { >> @@ -680,17 +681,18 @@ sys_ioctl(struct thread *td, struct ioct >> arg = (intptr_t)uap->data; >> data = (void *)&arg; >> size = 0; >> - } else >> - data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); >> + } else { >> + if (size <= sizeof(smalldata)) >> + data = smalldata; >> + else >> + data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); >> + } >> } else >> data = (void *)&uap->data; >> if (com & IOC_IN) { >> error = copyin(uap->data, data, (u_int)size); >> - if (error) { >> - if (size > 0) >> - free(data, M_IOCTLOPS); >> - return (error); >> - } >> + if (error != 0) >> + goto out; >> } else if (com & IOC_OUT) { >> /* >> * Zero the buffer so the user always >> @@ -704,7 +706,8 @@ sys_ioctl(struct thread *td, struct ioct >> if (error == 0 && (com & IOC_OUT)) >> error = copyout(data, uap->data, (u_int)size); >> - if (size > 0) >> +out: >> + if (size > 0 && data != (caddr_t)&smalldata) >> free(data, M_IOCTLOPS); >> return (error); >> } >> >> >> > > > > From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:28:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C392AE9; Mon, 3 Nov 2014 08:28:58 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A70C1C; Mon, 3 Nov 2014 08:28:58 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 307331FE022; Mon, 3 Nov 2014 09:28:54 +0100 (CET) Message-ID: <54573CD2.1000702@selasky.org> Date: Mon, 03 Nov 2014 09:29:06 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Julian Elischer , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> In-Reply-To: <54573B87.7000801@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:28:58 -0000 On 11/03/14 09:23, Julian Elischer wrote: > On 11/3/14, 4:21 PM, Julian Elischer wrote: >> On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >>> Author: mjg >>> Date: Mon Nov 3 07:46:51 2014 >>> New Revision: 274017 >>> URL: https://svnweb.freebsd.org/changeset/base/274017 >>> >>> Log: >>> Provide an on-stack temporary buffer for small ioctl requests. >> I'm not sure I like this. We don't know how many more levels >> of stack may be needed. >> I know that machines are getting faster with more memory, >> but the current move towards bloating out the > ... "bloating out the stack" ... >> worries me. we started out with a single page of stack (SHARED >> with the U-area!). I think we are now at several pages.. I forget, is >> it 8? >> I'm open to being persuaded but I think we need to have a discussion >> about stack usage. We used to say that anything greater that, say >> 64 bytes should probably be allocated. >> Hi, I think this patch can give a benefit for the USB stack and CUSE4BSD, because it does frequent IOCTLs. Regarding the stack usage, maybe this general purpose optimisation can be allocated from the thread structure? --HPS From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:34:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BECBE39A; Mon, 3 Nov 2014 08:34:17 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9322BCD1; Mon, 3 Nov 2014 08:34:17 +0000 (UTC) Received: from delphij-macbook.home.us.delphij.net (c-24-5-244-32.hsd1.ca.comcast.net [24.5.244.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 367B61A56C; Mon, 3 Nov 2014 00:34:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1415003656; x=1415018056; bh=rKt372VFxHORwNwphPDF3UEb5GCsZIK4ss8gyrID3Uk=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=kjZRdPFSMrRrid865n0DpcOGA0vtITjIhEtlu1yNmgFYlLyv4GTuIxy88fiEEkH4J i4+k34hWioqJ2QNt5C3ovJr1Vg5rZm0hYAgFASqSpKOzEwG4c1scmr8We3Q3KVc7pk z61BJGB1CXSjTqH0v9MZRWokEMx3rC7GJwdud36U= Message-ID: <54573E07.5040505@delphij.net> Date: Mon, 03 Nov 2014 00:34:15 -0800 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Bruce Evans , d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <5456A47E.2030405@delphij.net> <5456A69C.6040902@delphij.net> <20141103115402.H3149@besplex.bde.org> In-Reply-To: <20141103115402.H3149@besplex.bde.org> Content-Type: multipart/mixed; boundary="------------070009050000080809030508" Cc: "src-committers@freebsd.org" , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:34:17 -0000 This is a multi-part message in MIME format. --------------070009050000080809030508 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 11/2/14 5:13 PM, Bruce Evans wrote: > % - % - KASSERT(random_adaptor != NULL, ("No active random > adaptor in %s", __func__)); % } % % void > > Lots of style bugs (long lines, use of the __func__ obfuscation, > and general verboseness). What would you recommend doing for cases like this? Do we just do KASSERT without the __func__ and rely on ddb to provide the information in backtrace or something else? Speaking for long lines -- I usually use the MTA's default so the diff won't wrap. style(9) is a little bit vague here, what should new code appear like? > % @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev > __unused, str % /* Let the entropy source do any post-read > cleanup. */ % (random_adaptor->ra_read)(NULL, 1); % % - > free(random_buf, M_ENTROPY); % + if (nbytes != > uio->uio_resid && (error == ERESTART || % + error == > EINTR) ) % + error = 0; /* Return partial read, not > error. */ > > This adjustment has no effect. Upper layers already do it for > these 2 errors and one more. Other cases remain broken. > > It is simpler to do nothing. Let upper layers get it right or > wrong. Doesn't matter much either way. Will remove these two portions of the change. > % + > > More style bugs. Extra blank line here. Space bereofe parentheses > above. > > % } % - % sx_sunlock(&random_adaptors_lock); % % + > free(random_buf, M_ENTROPY); % + > > Extra blank lines are sprinkled randomly. Mostly added, but one > was removed. There is an extra blank line after the sx_slock() that > separates it from the blocks(s) of code that it locks; the removed > one used the same style. Will change the code to consistently use no blank line after sx_slock() and before sx_sunlock() if that's correct, can you confirm? Cheers, -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJUVz4HAAoJEJW2GBstM+nsZnkP/0PDU6SvwEG94w/csmWiWRuE IhhmH3oKz+LAzsU7pGUPpyE+UqWaMhRod6CHH9Io7EaJmZ9gsoMD29KWSdrYhWmS eMuZIt/vNkHGd+4SpFMUVq15s1gmRO2AK7wev6PZ1lOeqlJQtEkelnwaO7gWZdyp yWjdBW3MOOuVPR/kj0qF7Nx3nuCPkixO/SldXbMOeM0ofKhZw2DkiJmjSDx17Mk7 q/x2cuui4+nDxyJleFeLDpZqI+zaII/2yGly8OMzmhOsaAUtQrhxFM5I8Py/E85t yIK6U01tuRu1pVMNtqY1EgFqEkzRAr/kWG/wHZOuiITNroGye5J+u9VLaBVgCmQF hJW2Wthq2qFaWX2oqlSamHSss1Mt048iIzIzQd7GhwRYb6Be5IGPaqI2QOyKAYeE ojHvddkL30xIVLwM9qkFmIiyOvaC4gi/dSc6cbSEEYarTLqsIUZlJ1Xx5X5OK9y9 sAsIIo+0v4njB/cv9x4e5aeDXsRU1ABFHk4IUb7hBv2/Um9FRTuVKyKDWiEm4mRV U/uDxRDIFc0KAFj0bEtJXyeB/GsGsYqlba63Z978QQUvtlk7Rjtq8hDBks+I6CcC Hb8UOttzY+jS/XDxphNw5eXeg6rgy0v6isLqSAJvmwnyrXCUPJF5oMYxUla3lYrc QzxqUTKnPyyid4Hl+7n9 =ixEW -----END PGP SIGNATURE----- --------------070009050000080809030508 Content-Type: text/x-patch; name="random-style.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="random-style.diff" Index: sys/dev/random/random_adaptors.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 --- sys/dev/random/random_adaptors.c (revision 274006) +++ sys/dev/random/random_adaptors.c (working copy) @@ -210,7 +210,6 @@ random_adaptor_read(struct cdev *dev __unused, str random_buf =3D malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); =20 sx_slock(&random_adaptors_lock); - KASSERT(random_adaptor !=3D NULL, ("No active random adaptor in %s", __= func__)); =20 /* Let the entropy source do any pre-read setup. */ @@ -234,15 +233,15 @@ random_adaptor_read(struct cdev *dev __unused, str (random_adaptor->ra_read)(NULL, 0); } =20 + /* + * The read-rate stuff is a rough indication of the instantaneous + * read rate, used to increase the use of 'live' entropy sources + * when lots of reads are done. + */ mtx_lock(&random_read_rate_mtx); - - /* The read-rate stuff is a rough indication of the instantaneous read = rate, - * used to increase the use of 'live' entropy sources when lots of read= s are done. - */ nbytes =3D (uio->uio_resid + 32 - 1)/32; /* Round up to units of 32 */ random_adaptor_read_rate_cache +=3D nbytes*32; random_adaptor_read_rate_cache =3D MIN(random_adaptor_read_rate_cache, = 32); - mtx_unlock(&random_read_rate_mtx); =20 if (error =3D=3D 0) { @@ -257,11 +256,6 @@ random_adaptor_read(struct cdev *dev __unused, str =20 /* Let the entropy source do any post-read cleanup. */ (random_adaptor->ra_read)(NULL, 1); - - if (nbytes !=3D uio->uio_resid && (error =3D=3D ERESTART || - error =3D=3D EINTR) ) - error =3D 0; /* Return partial read, not error. */ - } sx_sunlock(&random_adaptors_lock); =20 @@ -296,11 +290,9 @@ random_adaptor_write(struct cdev *dev __unused, st #ifdef RANDOM_DEBUG printf("random: %s %zd\n", __func__, uio->uio_resid); #endif - random_buf =3D malloc(PAGE_SIZE, M_ENTROPY, M_WAITOK); =20 sx_slock(&random_adaptors_lock); - KASSERT(random_adaptor !=3D NULL, ("No active random adaptor in %s", __= func__)); =20 nbytes =3D uio->uio_resid; @@ -317,15 +309,9 @@ random_adaptor_write(struct cdev *dev __unused, st KASSERT(random_adaptor !=3D NULL, ("No active random adaptor in %s", __func__)); } - sx_sunlock(&random_adaptors_lock); =20 - if (nbytes !=3D uio->uio_resid && (error =3D=3D ERESTART || - error =3D=3D EINTR) ) - error =3D 0; /* Partial write, not error. */ - free(random_buf, M_ENTROPY); - return (error); } =20 @@ -339,7 +325,6 @@ random_adaptor_poll(struct cdev *dev __unused, int #endif =20 sx_slock(&random_adaptors_lock); - KASSERT(random_adaptor !=3D NULL, ("No active random adaptor in %s", __= func__)); =20 if (events & (POLLIN | POLLRDNORM)) { @@ -348,7 +333,6 @@ random_adaptor_poll(struct cdev *dev __unused, int else selrecord(td, &rsel); } - sx_sunlock(&random_adaptors_lock); =20 return (events); --------------070009050000080809030508-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:48:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E38D6EE; Mon, 3 Nov 2014 08:48:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BC6DE5; Mon, 3 Nov 2014 08:48:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA38mnsA065501; Mon, 3 Nov 2014 08:48:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA38mnev065500; Mon, 3 Nov 2014 08:48:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411030848.sA38mnev065500@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Nov 2014 08:48: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: r274018 - stable/10/usr.sbin/pmcstat 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:48:49 -0000 Author: bapt Date: Mon Nov 3 08:48:48 2014 New Revision: 274018 URL: https://svnweb.freebsd.org/changeset/base/274018 Log: MFC r273737, 273739 Clarify the documentation of pmcstat: the -d argument should be passed before -p, -s, -P or -S to be taken in account Differential Revision: https://reviews.freebsd.org/D1011 Reviewed by: adrian, gnn Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pmcstat/pmcstat.8 ============================================================================== --- stable/10/usr.sbin/pmcstat/pmcstat.8 Mon Nov 3 07:46:51 2014 (r274017) +++ stable/10/usr.sbin/pmcstat/pmcstat.8 Mon Nov 3 08:48:48 2014 (r274018) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2014 +.Dd Oct 27, 2014 .Dt PMCSTAT 8 .Os .Sh NAME @@ -254,6 +254,12 @@ Toggle between process mode PMCs measuri process' current and future children or only measuring events for the target process. The default is to measure events for the target process alone. +(it has to be passed in the command line prior to +.Fl p , +.Fl s , +.Fl P , +or +.Fl S ) . .It Fl f Ar pluginopt Pass option string to the active plugin. .br From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 08:59:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28C8B9B6 for ; Mon, 3 Nov 2014 08:59:52 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A7AED2 for ; Mon, 3 Nov 2014 08:59:51 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9CF4B20567 for ; Mon, 3 Nov 2014 03:59:44 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute3.internal (MEProxy); Mon, 03 Nov 2014 03:59:44 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:x-sasl-enc:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=mesmtp; bh=Deh7YhUWFZRdBVeJsJ+m0klLzjc=; b=SgeJ 8pwTyhhJoMgYcU5BW7rz1VE4k51YN/+tw9O/RuY37+TDjjDY099HXkitw1OunGz3 dtFWxpqEvEchi+Hd5FxrhTgtIUv4A5XUoUGUihsYZiUUI1YkDUXv0ITvJgWZY8+P ylHipgE0HNzyFfT31//7TtV9ts+dY5XaWRjPHFo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:x-sasl-enc:from:to :mime-version:content-transfer-encoding:content-type:in-reply-to :references:subject:date; s=smtpout; bh=Deh7YhUWFZRdBVeJsJ+m0klL zjc=; b=nTW4tEMTC067JaywTIL2VyhcA2SzrYjDsEsSwZc69uJqTwBgswGopaOR BISpVrqAbxmWghmmzAOFjEH1m3TbfAM5F3mlqXSko9wpOco6x+sTsr3uDySjB0zu 9w3H1ym0obHF9J9os8DeOurum16glCNzJARBS0dscjd9qEZGTeY= Received: by web6.nyi.internal (Postfix, from userid 99) id 6CF6A5ADE6; Mon, 3 Nov 2014 03:59:44 -0500 (EST) Message-Id: <1415005184.2423208.186328305.45AAE6FA@webmail.messagingengine.com> X-Sasl-Enc: 33+jpj0vxS+dQB3B3P3WsVzeoZTiEJV5t4r/dFrzehWY 1415005184 From: Bruce Simpson To: Julian Elischer , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-c51dec4f In-Reply-To: <54573AEE.9010602@freebsd.org> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> Subject: Re: svn commit: r274017 - head/sys/kern Date: Mon, 03 Nov 2014 08:59:44 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 08:59:52 -0000 On Mon, 3 Nov 2014, at 08:21, Julian Elischer wrote: > I'm open to being persuaded but I think we need to have a discussion > about stack usage. We used to say that anything greater that, say > 64 bytes should probably be allocated. I have to admit the level of stack usage in my current $DAYJOB project worries me (although I haven't profiled for this). Every struct in6_addr{} is 16 bytes, and those mount up quickly. -- BMS (sent via webmail) From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:02:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41BD5BCF; Mon, 3 Nov 2014 09:02:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E05EF69; Mon, 3 Nov 2014 09:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA392AYG074113; Mon, 3 Nov 2014 09:02:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA392ACn074112; Mon, 3 Nov 2014 09:02:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411030902.sA392ACn074112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 09:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274020 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:02:10 -0000 Author: hselasky Date: Mon Nov 3 09:02:09 2014 New Revision: 274020 URL: https://svnweb.freebsd.org/changeset/base/274020 Log: Reduce boot verbosity. MFC: 3 days Modified: head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon Nov 3 09:02:08 2014 (r274019) +++ head/sys/dev/usb/usb_hub.c Mon Nov 3 09:02:09 2014 (r274020) @@ -1489,13 +1489,13 @@ uhub_attach(device_t dev) if (usb_disable_port_power != 0 || sc->sc_disable_port_power != 0) { /* turn the power off */ - DPRINTFN(0, "Turning port %d power off\n", portno); + DPRINTFN(2, "Turning port %d power off\n", portno); err = usbd_req_clear_port_feature(udev, NULL, portno, UHF_PORT_POWER); } else { #endif /* turn the power on */ - DPRINTFN(0, "Turning port %d power on\n", portno); + DPRINTFN(2, "Turning port %d power on\n", portno); err = usbd_req_set_port_feature(udev, NULL, portno, UHF_PORT_POWER); #if USB_HAVE_DISABLE_ENUM From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:02:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B405BCE; Mon, 3 Nov 2014 09:02:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36B25F68; Mon, 3 Nov 2014 09:02:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3929st074083; Mon, 3 Nov 2014 09:02:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3928OR074069; Mon, 3 Nov 2014 09:02:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411030902.sA3928OR074069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 3 Nov 2014 09:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274019 - in releng/10.1/release/doc: en_US.ISO8859-1/hardware share/xml X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:02:09 -0000 Author: gjb Date: Mon Nov 3 09:02:08 2014 New Revision: 274019 URL: https://svnweb.freebsd.org/changeset/base/274019 Log: Update the hardware page to reflect CPU updates/additions added in head@r273941. Since the original commit requires changes to the doc/ repository after the release tag had already happened, (re)define entities in share/xml/release.ent that reflect doc@r45900 to prevent build breakage. Requested by: gavin Approved by: re (implicit, relnotes) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/release/doc/en_US.ISO8859-1/hardware/article.xml releng/10.1/release/doc/share/xml/release.ent Modified: releng/10.1/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- releng/10.1/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Nov 3 08:48:48 2014 (r274018) +++ releng/10.1/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Nov 3 09:02:08 2014 (r274019) @@ -77,7 +77,7 @@ Note that there are two names for this architecture, AMD64 (AMD) and Intel EM64T (Extended Memory 64-bit Technology). 64-bit mode of the two architectures are almost compatible - with each other, and &os;/&arch.amd64; should support them + with each other, and &os;/&arch.amd64; supports them both. As of this writing, the following processors are @@ -93,6 +93,18 @@ + &amd.sempron;. + + + + &amd.turion;. + + + + &amd.phenom;. + + + All multi-core &intel; &xeon; processors except Sossaman have EM64T support. @@ -105,22 +117,30 @@ - All &intel; Core 2 (not Core Duo) and later + All &intel; &core; 2 (not &core; Duo) and later processors + All &intel; &core; i range of processors + + + All &intel; &pentium; D processors - &intel; &pentium; 4s and Celeron Ds using + All &intel; ¢rino; Duo and ¢rino; Pro platforms + + + + &intel; &pentium; 4s and &celeron; Ds using the Cedar Mill core have EM64T support. - Some &intel; &pentium; 4s and Celeron Ds using + Some &intel; &pentium; 4s and &celeron; Ds using the Prescott core have EM64T support. See the Intel Modified: releng/10.1/release/doc/share/xml/release.ent ============================================================================== --- releng/10.1/release/doc/share/xml/release.ent Mon Nov 3 08:48:48 2014 (r274018) +++ releng/10.1/release/doc/share/xml/release.ent Mon Nov 3 09:02:08 2014 (r274019) @@ -73,3 +73,17 @@ + + +AMD Phenom"> +AMD Sempron"> +AMD Turion"> +Centrino"> +Intel, + Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, + and Xeon are trademarks or registered trademarks of Intel Corporation + or its subsidiaries in the United States and other countries."> +AMD, + AMD Athlon, AMD Opteron, AMD Phenom, AMD Sempron, AMD Turion, Athlon, + Élan, Opteron, and PCnet are trademarks of Advanced Micro + Devices, Inc."> From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:08:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 636169D; Mon, 3 Nov 2014 09:08:06 +0000 (UTC) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA3CFC7; Mon, 3 Nov 2014 09:08:05 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id q5so5742253wiv.17 for ; Mon, 03 Nov 2014 01:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1gTDhs+p7JO3QR1MG54YxyN43Kd11a6NVxh3jXFepjs=; b=wuzVsKD9bfjlcAp/OsmdUVcnR+8N3F85hY+i0S+sJxZZOxVt7GQ1V7H8cXkMWvW2p9 GjBUGjItOEN1YcRnCPSriIrp4lrv7zQrxiY+hbK0Yj8mjbwAWFQyWNLAwfRgG8nJHntn 1JomdmKaw5KElwHf+ZrpG9pEFq7opl47pcuM8ZeNNByrRoHYsZ4cHrUlJL3QQb11oJBe gtK5jLehk8jskshsAeNr1r3BGJk6yetMpIkzGowQOtDe6J4uiFHQ0+cAFy19w0fUBNB/ uHth4FHOqq6u2IxfmydeMpGH9XO8q+pvCHVsZAXGSnbE4hDsmAQnH8cytqTx2/meiqVh Ay4Q== X-Received: by 10.180.104.229 with SMTP id gh5mr14444715wib.42.1415005683711; Mon, 03 Nov 2014 01:08:03 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id w10sm21448203wje.10.2014.11.03.01.08.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 01:08:03 -0800 (PST) Date: Mon, 3 Nov 2014 10:08:00 +0100 From: Mateusz Guzik To: Julian Elischer Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141103090800.GG29497@dft-labs.eu> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54573AEE.9010602@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:08:06 -0000 On Mon, Nov 03, 2014 at 04:21:02PM +0800, Julian Elischer wrote: > On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > >Author: mjg > >Date: Mon Nov 3 07:46:51 2014 > >New Revision: 274017 > >URL: https://svnweb.freebsd.org/changeset/base/274017 > > > >Log: > > Provide an on-stack temporary buffer for small ioctl requests. > I'm not sure I like this. We don't know how many more levels > of stack may be needed. > I know that machines are getting faster with more memory, > but the current move towards bloating out the > worries me. we started out with a single page of stack (SHARED > with the U-area!). I think we are now at several pages.. I forget, is > it 8? > I'm open to being persuaded but I think we need to have a discussion > about stack usage. We used to say that anything greater that, say > 64 bytes should probably be allocated. > Depends on the arch, 2 on arm and mips, 4 on the rest. Roughly speaking. If 128 in ioctl is really such a big concern I'm happy to make it smaller, but I do prefer to have a buffer covering some stuff. Just booting the system gives: size occurences 4 118 8 60 16 3 20 8 24 33 32 127 36 8 40 16 44 268 48 278 68 1 72 31 80 8 192 1 236 55 256 1 288 22 817 8 Building the kernel gives me over 38000 occurences of size 44 (separate question is what is that ioctl and is it really necessary to call it). That said, maybe 128 was indeed too big. 64 sounds like a nice round number to me. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:17:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F5284F9; Mon, 3 Nov 2014 09:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2D1179; Mon, 3 Nov 2014 09:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA39HADi079698; Mon, 3 Nov 2014 09:17:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA39HABu079697; Mon, 3 Nov 2014 09:17:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411030917.sA39HABu079697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 09:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274021 - head/tests/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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:17:10 -0000 Author: ngie Date: Mon Nov 3 09:17:09 2014 New Revision: 274021 URL: https://svnweb.freebsd.org/changeset/base/274021 Log: Remove explicit KYUAFILE=yes from tests/sys/Makefile This causes the directory traversing Kyuafile to be installed, which in turn causes tests/sys/pjdfstest to always be run from /usr/tests/sys Let KYUAFILE default to auto, so the file generated by suite.test.mk gets installed instead MFC after: 1 week Modified: head/tests/sys/Makefile Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Nov 3 09:02:09 2014 (r274020) +++ head/tests/sys/Makefile Mon Nov 3 09:17:09 2014 (r274021) @@ -2,8 +2,6 @@ .include -.PATH: ${.CURDIR}/.. - TESTSDIR= ${TESTSBASE}/sys TESTS_SUBDIRS+= kern @@ -12,6 +10,4 @@ TESTS_SUBDIRS+= netinet # Items not integrated into kyua runs by default SUBDIR+= pjdfstest -KYUAFILE= yes - .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:19:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA53674D; Mon, 3 Nov 2014 09:19:59 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3422019C; Mon, 3 Nov 2014 09:19:59 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA39Jsrp000200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 11:19:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA39Jsrp000200 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA39JsRh000199; Mon, 3 Nov 2014 11:19:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Nov 2014 11:19:54 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141103091954.GJ53947@kib.kiev.ua> References: <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <20141103113629.I3149@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103113629.I3149@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "src-committers@freebsd.org" , d@delphij.net, Ian Lepore , "svn-src-all@freebsd.org" , Mark R V Murray , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:19:59 -0000 On Mon, Nov 03, 2014 at 11:53:26AM +1100, Bruce Evans wrote: > On Sun, 2 Nov 2014, Ian Lepore wrote: > > > On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA512 > >> > >> Hi, Mark, > >> > >> I'd like to propose the attached patch for review. It replaces > >> tsleep's with sx_sleep's, then checks the return value and quit the loop. > > > > It still doesn't handle the partial read/write case Kostik mentioned, > > but there are plenty of other drivers that don't get that right. > > Returning an error for a partial read is good enough for random devices, > since there is no problem with discarding the input. Upper layers are > still broken, so this (discarding the input is what happens automatically > except for ERESTART, EINTR and EWOULDBLOCK. But usermode buffer is already partially accessed and modified. Yes, I am picky about it after vn_io_fault() work. Also, it reminds me about the pipe EPIPE fix. I will commit it in a minute, finally. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:20:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B499891; Mon, 3 Nov 2014 09:20:25 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECA2D228; Mon, 3 Nov 2014 09:20:24 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2E21F1FE022; Mon, 3 Nov 2014 10:20:22 +0100 (CET) Message-ID: <545748E1.5050100@selasky.org> Date: Mon, 03 Nov 2014 10:20:33 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Mateusz Guzik , Julian Elischer Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <20141103090800.GG29497@dft-labs.eu> In-Reply-To: <20141103090800.GG29497@dft-labs.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:20:25 -0000 On 11/03/14 10:08, Mateusz Guzik wrote: > On Mon, Nov 03, 2014 at 04:21:02PM +0800, Julian Elischer wrote: >> On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >>> Author: mjg >>> Date: Mon Nov 3 07:46:51 2014 >>> New Revision: 274017 >>> URL: https://svnweb.freebsd.org/changeset/base/274017 >>> >>> Log: >>> Provide an on-stack temporary buffer for small ioctl requests. >> I'm not sure I like this. We don't know how many more levels >> of stack may be needed. >> I know that machines are getting faster with more memory, >> but the current move towards bloating out the >> worries me. we started out with a single page of stack (SHARED >> with the U-area!). I think we are now at several pages.. I forget, is >> it 8? >> I'm open to being persuaded but I think we need to have a discussion >> about stack usage. We used to say that anything greater that, say >> 64 bytes should probably be allocated. >> > > Depends on the arch, 2 on arm and mips, 4 on the rest. Roughly speaking. > > If 128 in ioctl is really such a big concern I'm happy to make it > smaller, but I do prefer to have a buffer covering some stuff. > > Just booting the system gives: > size occurences > 4 118 > 8 60 > 16 3 > 20 8 > 24 33 > 32 127 > 36 8 > 40 16 > 44 268 > 48 278 > 68 1 > 72 31 > 80 8 > 192 1 > 236 55 > 256 1 > 288 22 > 817 8 > > Building the kernel gives me over 38000 occurences of size 44 (separate question > is what is that ioctl and is it really necessary to call it). > > That said, maybe 128 was indeed too big. 64 sounds like a nice round number to me. > Hi, 64 will work for USB and CUSE4BSD too, which cause thousands of such small memory allocations inside IOCTLs when streaming TV and such. Mateusz: Maybe you have a USB device laying around? Goto src/tools/tools/usbtest, build and install, select a USB device and run the string descriptor test (not harmful). Then watch the memory statistics! --HPS From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:21:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 531F79D0; Mon, 3 Nov 2014 09:21:38 +0000 (UTC) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24DFF231; Mon, 3 Nov 2014 09:21:36 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id l18so10487778wgh.38 for ; Mon, 03 Nov 2014 01:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=sH+q1mEaESdYYMhbPPAc14MoHSShL8XUpYQXIsnCP1o=; b=XqVILHtphyZ9kpl8DKPjLv8pR9Fj6BVUjHAJy4RI0EaJ5+E+48NibY9XLEc+JoQtrT tsp+ER+BvMBd8jailV4SnW8p9GpZGG8EZzPqgnUaYhJp2i5QyZs9JqL/v4dME7973mfR 3eCh5RD/MlJcLdOyjQ91bdjmb1c1qROublknPJdXw0iaTWUZCWxI9krM1UyAfXtWhfEC NM5C2jbn+SjbxOGzcrEn5KMyaYUlle1nyFmOpSGNaaSpoobKhwyTBNNmp3vDwLhigOIb VXH00eRIK9FGlTyB29pdjAl/3lNzELuU/sZTFIt1cG+jCgiMmfH0qMdmpxHblTiv2tV9 PYnA== X-Received: by 10.180.102.135 with SMTP id fo7mr15096448wib.79.1415006495375; Mon, 03 Nov 2014 01:21:35 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id u13sm8034938wiv.10.2014.11.03.01.21.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 01:21:34 -0800 (PST) Date: Mon, 3 Nov 2014 10:21:32 +0100 From: Mateusz Guzik To: Hans Petter Selasky Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141103092132.GH29497@dft-labs.eu> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54573CD2.1000702@selasky.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:21:38 -0000 On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: > On 11/03/14 09:23, Julian Elischer wrote: > >On 11/3/14, 4:21 PM, Julian Elischer wrote: > >>On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > >>>Author: mjg > >>>Date: Mon Nov 3 07:46:51 2014 > >>>New Revision: 274017 > >>>URL: https://svnweb.freebsd.org/changeset/base/274017 > >>> > >>>Log: > >>> Provide an on-stack temporary buffer for small ioctl requests. > >>I'm not sure I like this. We don't know how many more levels > >>of stack may be needed. > >>I know that machines are getting faster with more memory, > >>but the current move towards bloating out the > >... "bloating out the stack" ... > >>worries me. we started out with a single page of stack (SHARED > >>with the U-area!). I think we are now at several pages.. I forget, is > >>it 8? > >>I'm open to being persuaded but I think we need to have a discussion > >>about stack usage. We used to say that anything greater that, say > >>64 bytes should probably be allocated. > >> > > Hi, > > I think this patch can give a benefit for the USB stack and CUSE4BSD, > because it does frequent IOCTLs. Regarding the stack usage, maybe > this general purpose optimisation can be allocated from the thread > structure? > I was considering something like that. The idea is that frequently allocating threads could allocate, say, 1KB from malloc and use that to satisfy their needs. This definitely helps offenders with longer lifespan, but does not help short-lived ones. That said, maybe I'm over-engineering this, but for cases where increased stack usage is undersirable we could have a malloc wrapper for use by code which knows it allocates stuff just to free it after the request. When it concludes a threshold is reached, allocates some memory and keeps it around. It can easily support multiple "allocations" from that buffer and fallbak to malloc if it runs out of space. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:26:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80BCFC1D; Mon, 3 Nov 2014 09:26:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2DB255; Mon, 3 Nov 2014 09:26:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA39Qexp084823; Mon, 3 Nov 2014 09:26:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA39Qewo084822; Mon, 3 Nov 2014 09:26:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411030926.sA39Qewo084822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 09:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274022 - head/usr.sbin/pw/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:26:40 -0000 Author: ngie Date: Mon Nov 3 09:26:39 2014 New Revision: 274022 URL: https://svnweb.freebsd.org/changeset/base/274022 Log: Require root when running the pw_delete and pw_modify test programs (pw(8) requires it) Modified: head/usr.sbin/pw/tests/Makefile Modified: head/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Mon Nov 3 09:17:09 2014 (r274021) +++ head/usr.sbin/pw/tests/Makefile Mon Nov 3 09:26:39 2014 (r274022) @@ -7,6 +7,9 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw ATF_TESTS_SH= pw_delete pw_modify +TEST_METADATA.pw_delete+= required_user="root" +TEST_METADATA.pw_modify+= required_user="root" + FILES= group helper_functions.shin master.passwd FILESDIR= ${TESTSDIR} From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 09:29:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19DE5E64; Mon, 3 Nov 2014 09:29:50 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 364152C7; Mon, 3 Nov 2014 09:29:49 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 97C491FE022; Mon, 3 Nov 2014 10:29:46 +0100 (CET) Message-ID: <54574B16.8030808@selasky.org> Date: Mon, 03 Nov 2014 10:29:58 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> In-Reply-To: <20141103092132.GH29497@dft-labs.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 09:29:50 -0000 On 11/03/14 10:21, Mateusz Guzik wrote: > On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: >> On 11/03/14 09:23, Julian Elischer wrote: >>> On 11/3/14, 4:21 PM, Julian Elischer wrote: >>>> On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >>>>> Author: mjg >>>>> Date: Mon Nov 3 07:46:51 2014 >>>>> New Revision: 274017 >>>>> URL: https://svnweb.freebsd.org/changeset/base/274017 >>>>> >>>>> Log: >>>>> Provide an on-stack temporary buffer for small ioctl requests. >>>> I'm not sure I like this. We don't know how many more levels >>>> of stack may be needed. >>>> I know that machines are getting faster with more memory, >>>> but the current move towards bloating out the >>> ... "bloating out the stack" ... >>>> worries me. we started out with a single page of stack (SHARED >>>> with the U-area!). I think we are now at several pages.. I forget, is >>>> it 8? >>>> I'm open to being persuaded but I think we need to have a discussion >>>> about stack usage. We used to say that anything greater that, say >>>> 64 bytes should probably be allocated. >>>> >> >> Hi, >> >> I think this patch can give a benefit for the USB stack and CUSE4BSD, >> because it does frequent IOCTLs. Regarding the stack usage, maybe >> this general purpose optimisation can be allocated from the thread >> structure? >> > > I was considering something like that. The idea is that frequently > allocating threads could allocate, say, 1KB from malloc and use that > to satisfy their needs. This definitely helps offenders with longer > lifespan, but does not help short-lived ones. Hi, This might be non-deterministic behaviour. I'm thinking about IOCTL latency, that its better when the latency is constant all the time. > > That said, maybe I'm over-engineering this, but for cases where increased > stack usage is undersirable we could have a malloc wrapper for use by > code which knows it allocates stuff just to free it after the request. Maybe the size you allocate from the stack could be some kind of kernel option, having some sensible default like 64 bytes when not set. > > When it concludes a threshold is reached, allocates some memory and > keeps it around. It can easily support multiple "allocations" from that > buffer and fallbak to malloc if it runs out of space. > Don't forget to MFC! --HPS From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:01:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C9195BC; Mon, 3 Nov 2014 10:01:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2932287A; Mon, 3 Nov 2014 10:01:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3A1vtr003612; Mon, 3 Nov 2014 10:01:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3A1vY7003611; Mon, 3 Nov 2014 10:01:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031001.sA3A1vY7003611@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 10:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274023 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:01:57 -0000 Author: kib Date: Mon Nov 3 10:01:56 2014 New Revision: 274023 URL: https://svnweb.freebsd.org/changeset/base/274023 Log: When other end of the pipe closed during the write, but some bytes were written, return short write instead of EPIPE. Update comment. Discussed with: bde (long time ago) MFC after: 2 weeks Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Mon Nov 3 09:26:39 2014 (r274022) +++ head/sys/kern/sys_pipe.c Mon Nov 3 10:01:56 2014 (r274023) @@ -1296,13 +1296,13 @@ pipe_write(fp, uio, active_cred, flags, } /* - * Don't return EPIPE if I/O was successful + * Don't return EPIPE if any byte was written. + * EINTR and other interrupts are handled by generic I/O layer. + * Do not pretend that I/O succeeded for obvious user error + * like EFAULT. */ - if ((wpipe->pipe_buffer.cnt == 0) && - (uio->uio_resid == 0) && - (error == EPIPE)) { + if (uio->uio_resid != orig_resid && error == EPIPE) error = 0; - } if (error == 0) vfs_timestamp(&wpipe->pipe_mtime); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:08:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D5D985E; Mon, 3 Nov 2014 10:08:54 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2077B8DD; Mon, 3 Nov 2014 10:08:53 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA3A8ltk011468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 12:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA3A8ltk011468 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA3A8lPp011467; Mon, 3 Nov 2014 12:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Nov 2014 12:08:47 +0200 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141103100847.GK53947@kib.kiev.ua> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103092132.GH29497@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Hans Petter Selasky , src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:08:54 -0000 On Mon, Nov 03, 2014 at 10:21:32AM +0100, Mateusz Guzik wrote: > On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: > > On 11/03/14 09:23, Julian Elischer wrote: > > >On 11/3/14, 4:21 PM, Julian Elischer wrote: > > >>On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > > >>>Author: mjg > > >>>Date: Mon Nov 3 07:46:51 2014 > > >>>New Revision: 274017 > > >>>URL: https://svnweb.freebsd.org/changeset/base/274017 > > >>> > > >>>Log: > > >>> Provide an on-stack temporary buffer for small ioctl requests. > > >>I'm not sure I like this. We don't know how many more levels > > >>of stack may be needed. > > >>I know that machines are getting faster with more memory, > > >>but the current move towards bloating out the > > >... "bloating out the stack" ... > > >>worries me. we started out with a single page of stack (SHARED > > >>with the U-area!). I think we are now at several pages.. I forget, is > > >>it 8? > > >>I'm open to being persuaded but I think we need to have a discussion > > >>about stack usage. We used to say that anything greater that, say > > >>64 bytes should probably be allocated. > > >> > > > > Hi, > > > > I think this patch can give a benefit for the USB stack and CUSE4BSD, > > because it does frequent IOCTLs. Regarding the stack usage, maybe > > this general purpose optimisation can be allocated from the thread > > structure? > > > > I was considering something like that. The idea is that frequently > allocating threads could allocate, say, 1KB from malloc and use that > to satisfy their needs. This definitely helps offenders with longer > lifespan, but does not help short-lived ones. Allocating 1KB by malloc() consumes that memory for the whole lifespan of the thread, and the memory sit unused except some short periods. For the stack allocation which you did, at least the memory is reused when needed (i.e. when syscalls other than ioctl(2) are executing). That said, you could slightly improve the code by using __builtin_alloc() instead of unconditionally reserving memory on stack. This will simultaneosly reduce the stack usage, since you only allocate as much as needed, and also avoid stack space waste when fallback to malloc() is required anyway. > > That said, maybe I'm over-engineering this, but for cases where increased > stack usage is undersirable we could have a malloc wrapper for use by > code which knows it allocates stuff just to free it after the request. > > When it concludes a threshold is reached, allocates some memory and > keeps it around. It can easily support multiple "allocations" from that > buffer and fallbak to malloc if it runs out of space. > > -- > Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:26:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6EE3C96; Mon, 3 Nov 2014 10:26:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2BD2A92; Mon, 3 Nov 2014 10:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AQUXO013861; Mon, 3 Nov 2014 10:26:30 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AQUvC013857; Mon, 3 Nov 2014 10:26:30 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031026.sA3AQUvC013857@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:26:30 +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: r274024 - in stable/10: sys/sys usr.sbin/fdread 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:26:31 -0000 Author: nyan Date: Mon Nov 3 10:26:29 2014 New Revision: 274024 URL: https://svnweb.freebsd.org/changeset/base/274024 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/10/sys/sys/fdcio.h stable/10/usr.sbin/fdread/fdutil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/fdcio.h ============================================================================== --- stable/10/sys/sys/fdcio.h Mon Nov 3 10:01:56 2014 (r274023) +++ stable/10/sys/sys/fdcio.h Mon Nov 3 10:26:29 2014 (r274024) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/10/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/10/usr.sbin/fdread/fdutil.c Mon Nov 3 10:01:56 2014 (r274023) +++ stable/10/usr.sbin/fdread/fdutil.c Mon Nov 3 10:26:29 2014 (r274024) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:27:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22165DC0; Mon, 3 Nov 2014 10:27:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC22A96; Mon, 3 Nov 2014 10:27:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AR3KE013992; Mon, 3 Nov 2014 10:27:03 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AR32L013990; Mon, 3 Nov 2014 10:27:03 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031027.sA3AR32L013990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:27:03 +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: r274025 - in stable/9: sys/sys usr.sbin/fdread 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:27:04 -0000 Author: nyan Date: Mon Nov 3 10:27:03 2014 New Revision: 274025 URL: https://svnweb.freebsd.org/changeset/base/274025 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/9/sys/sys/fdcio.h stable/9/usr.sbin/fdread/fdutil.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/fdread/ (props changed) Modified: stable/9/sys/sys/fdcio.h ============================================================================== --- stable/9/sys/sys/fdcio.h Mon Nov 3 10:26:29 2014 (r274024) +++ stable/9/sys/sys/fdcio.h Mon Nov 3 10:27:03 2014 (r274025) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/9/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/9/usr.sbin/fdread/fdutil.c Mon Nov 3 10:26:29 2014 (r274024) +++ stable/9/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:03 2014 (r274025) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:27:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F0C7EF3; Mon, 3 Nov 2014 10:27:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A44AA9A; Mon, 3 Nov 2014 10:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3ARMuK014081; Mon, 3 Nov 2014 10:27:22 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3ARMqd014079; Mon, 3 Nov 2014 10:27:22 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031027.sA3ARMqd014079@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274026 - in stable/8: sys/sys usr.sbin/fdread X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:27:22 -0000 Author: nyan Date: Mon Nov 3 10:27:21 2014 New Revision: 274026 URL: https://svnweb.freebsd.org/changeset/base/274026 Log: MFC: r272248 - Cleanups pc98 code. - Remove unworked formats. Modified: stable/8/sys/sys/fdcio.h stable/8/usr.sbin/fdread/fdutil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/fdread/ (props changed) Modified: stable/8/sys/sys/fdcio.h ============================================================================== --- stable/8/sys/sys/fdcio.h Mon Nov 3 10:27:03 2014 (r274025) +++ stable/8/sys/sys/fdcio.h Mon Nov 3 10:27:21 2014 (r274026) @@ -181,27 +181,17 @@ enum fd_drivetype { * XXX: should have been done 20 years ago to make sense. */ #ifdef PC98 -#define FDF_3_1722 21,2,0xFF,0x04,82,0,2,2,0x0C,2,0,FL_MFM -#define FDF_3_1476 18,2,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1440 18,2,0xFF,0x1B,80,0,2,2,0x54,1,0,FL_MFM #define FDF_3_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_3_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_3_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_3_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_3_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_3_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM -#define FDF_3_1480 9,3,0xFF,0x35,82,0,0,2,0x47,1,0,FL_MFM -#define FDF_3_1640 10,3,0xFF,0x1B,82,0,2,2,0x54,1,0,FL_MFM #define FDF_5_1200 15,2,0xFF,0x1B,80,0,0,2,0x54,1,0,FL_MFM -#define FDF_5_820 10,2,0xFF,0x10,82,0,1,2,0x30,1,0,FL_MFM -#define FDF_5_800 10,2,0xFF,0x10,80,0,1,2,0x30,1,0,FL_MFM #define FDF_5_720 9,2,0xFF,0x20,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_360 9,2,0xFF,0x20,40,0,1,2,0x50,1,0,FL_MFM|FL_2STEP #define FDF_5_640 8,2,0xFF,0x2A,80,0,1,2,0x50,1,0,FL_MFM #define FDF_5_1230 8,3,0xFF,0x35,77,0,0,2,0x74,1,0,FL_MFM -#define FDF_5_1280 8,3,0xFF,0x35,80,0,0,2,0x74,1,0,FL_MFM #else /* PC98 */ #define FDF_3_2880 36,2,0xFF,0x1B,80,0,FDC_1MBPS,002,0x4C,1,1,FL_MFM|FL_PERPND #define FDF_3_1722 21,2,0xFF,0x04,82,0,FDC_500KBPS,2,0x0C,2,0,FL_MFM Modified: stable/8/usr.sbin/fdread/fdutil.c ============================================================================== --- stable/8/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:03 2014 (r274025) +++ stable/8/usr.sbin/fdread/fdutil.c Mon Nov 3 10:27:21 2014 (r274026) @@ -92,6 +92,7 @@ static struct fd_type fd_types_auto[1] = static struct fd_type fd_types_288m[] = { +#ifndef PC98 #if 0 { FDF_3_2880 }, #endif @@ -102,30 +103,18 @@ static struct fd_type fd_types_288m[] = { FDF_3_820 }, { FDF_3_800 }, { FDF_3_720 }, +#endif /* !PC98 */ { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_144m[] = { #ifdef PC98 -#if 0 - { FDF_3_1722 }, - { FDF_3_1476 }, -#endif { FDF_3_1440 }, { FDF_3_1200 }, -#if 0 - { FDF_3_820 }, - { FDF_3_800 }, -#endif { FDF_3_720 }, { FDF_3_360 }, { FDF_3_640 }, { FDF_3_1230 }, -#if 0 - { FDF_3_1280 }, - { FDF_3_1480 }, - { FDF_3_1640 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_3_1722 }, @@ -142,17 +131,10 @@ static struct fd_type fd_types_144m[] = static struct fd_type fd_types_12m[] = { #ifdef PC98 { FDF_5_1200 }, -#if 0 - { FDF_5_820 }, - { FDF_5_800 }, -#endif { FDF_5_720 }, { FDF_5_360 }, { FDF_5_640 }, { FDF_5_1230 }, -#if 0 - { FDF_5_1280 }, -#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } #else { FDF_5_1200 }, @@ -170,13 +152,17 @@ static struct fd_type fd_types_12m[] = { static struct fd_type fd_types_720k[] = { +#ifndef PC98 { FDF_3_720 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; static struct fd_type fd_types_360k[] = { +#ifndef PC98 { FDF_5_360 }, +#endif { 0,0,0,0,0,0,0,0,0,0,0,0 } }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:30:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BAA2D6; Mon, 3 Nov 2014 10:30:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B38AB4; Mon, 3 Nov 2014 10:30:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AUjvO015728; Mon, 3 Nov 2014 10:30:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AUjQA015727; Mon, 3 Nov 2014 10:30:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031030.sA3AUjQA015727@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 10:30:45 +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: r274027 - stable/10/sys/fs/nfsserver 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:30:45 -0000 Author: kib Date: Mon Nov 3 10:30:44 2014 New Revision: 274027 URL: https://svnweb.freebsd.org/changeset/base/274027 Log: MFC r273727: Original commit message was Allow the vfs.nfsd knobs to be set from loader.conf (or using kenv(8)). This is useful when nfsd is loaded as module. As I understand, automatic fetch from kenv does not work in stable/10. Merge the change still, to reduce code difference. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Nov 3 10:27:21 2014 (r274026) +++ stable/10/sys/fs/nfsserver/nfs_nfsdkrpc.c Mon Nov 3 10:30:44 2014 (r274027) @@ -88,16 +88,16 @@ SYSCTL_DECL(_vfs_nfsd); SVCPOOL *nfsrvd_pool; static int nfs_privport = 0; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RWTUN, &nfs_privport, 0, "Only allow clients using a privileged port for NFSv2 and 3"); static int nfs_minvers = NFS_VER2; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RWTUN, &nfs_minvers, 0, "The lowest version of NFS handled by the server"); static int nfs_maxvers = NFS_VER4; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RWTUN, &nfs_maxvers, 0, "The highest version of NFS handled by the server"); static int nfs_proc(struct nfsrv_descript *, u_int32_t, SVCXPRT *xprt, From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:33:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59B6F26D; Mon, 3 Nov 2014 10:33:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BAF4B63; Mon, 3 Nov 2014 10:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AX2oo018387; Mon, 3 Nov 2014 10:33:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AX1DC018384; Mon, 3 Nov 2014 10:33:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031033.sA3AX1DC018384@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 10:33:01 +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: r274028 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:33:02 -0000 Author: kib Date: Mon Nov 3 10:33:01 2014 New Revision: 274028 URL: https://svnweb.freebsd.org/changeset/base/274028 Log: MFC r273728: Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte transfers to be default. Modified: stable/10/sys/dev/iicbus/iicbus.h stable/10/sys/dev/iicbus/iiconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/iicbus.h ============================================================================== --- stable/10/sys/dev/iicbus/iicbus.h Mon Nov 3 10:30:44 2014 (r274027) +++ stable/10/sys/dev/iicbus/iicbus.h Mon Nov 3 10:33:01 2014 (r274028) @@ -49,16 +49,19 @@ struct iicbus_softc struct iicbus_ivar { uint32_t addr; + bool nostop; }; enum { - IICBUS_IVAR_ADDR /* Address or base address */ + IICBUS_IVAR_ADDR, /* Address or base address */ + IICBUS_IVAR_NOSTOP, /* nostop defaults */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) +IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: stable/10/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/10/sys/dev/iicbus/iiconf.c Mon Nov 3 10:30:44 2014 (r274027) +++ stable/10/sys/dev/iicbus/iiconf.c Mon Nov 3 10:33:01 2014 (r274028) @@ -365,6 +365,7 @@ iicbus_transfer_gen(device_t dev, struct { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; + bool nostop; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (error); @@ -375,6 +376,7 @@ iicbus_transfer_gen(device_t dev, struct bus = children[0]; rpstart = 0; free(children, M_TEMP); + nostop = iicbus_get_nostop(dev); for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; if (msgs[i].flags & IIC_M_RD) @@ -399,11 +401,12 @@ iicbus_transfer_gen(device_t dev, struct error = iicbus_write(bus, msgs[i].buf, msgs[i].len, &lenwrote, 0); - if (!(msgs[i].flags & IIC_M_NOSTOP)) { + if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || + (nostop && i + 1 < nmsgs)) { + rpstart = 1; /* Next message gets repeated start */ + } else { rpstart = 0; iicbus_stop(bus); - } else { - rpstart = 1; /* Next message gets repeated start */ } } return (error); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:34:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 370013C4; Mon, 3 Nov 2014 10:34:51 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 772D4B78; Mon, 3 Nov 2014 10:34:50 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so5659021wiv.4 for ; Mon, 03 Nov 2014 02:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=1ne6YM2NKbl926GMCuZNk7Knjv0cO3ovDqOKMqVaIEw=; b=tagCpu3arV8KaMLMQuXMYsxKHj1vRfVQHDPt/mLPnuUmdRbBQ80MQwbsK+Fd6sZvU+ d/FAYe3T+KmNOGAvrqD3APhtMv99AR/gQFg7WtSbZOoAOacdDJRpht83x6hpQrhZg1Tg XnXX3B7H4nXp64rDXIO4B8fJ/mAYJFVs2PpFqkwTPlxyhg17U7V9x/hFuyh4MYKqQapi UH5vhVpHVl/pSXEr+cFQeOSmBBrSMvMpj5GwYByo1Wio9ttusXbKF+n1b4mt/F60mqlR u2T1NERmqBNeOBtJNjg4PYsblMhM5l8E0unZ7S9jqHbApangYtnjhm2VHUTw6oQP851l H6nw== MIME-Version: 1.0 X-Received: by 10.180.19.234 with SMTP id i10mr15653509wie.28.1415010888689; Mon, 03 Nov 2014 02:34:48 -0800 (PST) Reply-To: attilio@FreeBSD.org Sender: asmrookie@gmail.com Received: by 10.217.69.73 with HTTP; Mon, 3 Nov 2014 02:34:48 -0800 (PST) In-Reply-To: <20141102224934.GG53947@kib.kiev.ua> References: <20141102163728.GX53947@kib.kiev.ua> <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> <20141102213819.GF53947@kib.kiev.ua> <20141102224934.GG53947@kib.kiev.ua> Date: Mon, 3 Nov 2014 11:34:48 +0100 X-Google-Sender-Auth: IOn3XVqAiyy0Aj7669g1-nwZYAs Message-ID: Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys From: Attilio Rao To: Konstantin Belousov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:34:51 -0000 On Sun, Nov 2, 2014 at 11:49 PM, Konstantin Belousov wrote: > On Sun, Nov 02, 2014 at 11:37:57PM +0100, Attilio Rao wrote: >> On Sun, Nov 2, 2014 at 10:38 PM, Konstantin Belousov >> wrote: >> > On Sun, Nov 02, 2014 at 10:17:26PM +0100, Attilio Rao wrote: >> >> I think that your initial patch (what is in head now) is a better approach. >> >> I would just make it a lockinit() flag to make it less alien to the KPI. >> >> >> > >> > Ok. >> > >> > Can you explain what would the proposed lockinit() flag do ? What should >> > it change comparing with the current code ? >> >> You now provide LK_NODDLKTREAT on a call basis. >> The lockinit() flag would embed this into the lock attribute and make >> it always real, without the need for the callers to provide >> LK_NODDLKTREAT on a call basis. > > Am I reading your proposal right ? Do you mean, that for all vnodes, > I should disable exclusive starvation avoidance at all ? I completely > disagree with this. No, I'm saying that we should support doing this at the KPI level. Not that you should enable this for all the vnodes. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:38:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D50452F; Mon, 3 Nov 2014 10:38:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A3BB9C; Mon, 3 Nov 2014 10:38:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Ac3eZ019079; Mon, 3 Nov 2014 10:38:03 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Ac3ug019078; Mon, 3 Nov 2014 10:38:03 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031038.sA3Ac3ug019078@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:38:03 +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: r274029 - stable/10/sys/boot/pc98/cdboot 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:38:04 -0000 Author: nyan Date: Mon Nov 3 10:38:03 2014 New Revision: 274029 URL: https://svnweb.freebsd.org/changeset/base/274029 Log: MFC: r272252 Drop the 3rd clause from all 3 clause BSD licenses. Modified: stable/10/sys/boot/pc98/cdboot/cdboot.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/10/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:33:01 2014 (r274028) +++ stable/10/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:03 2014 (r274029) @@ -11,9 +11,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:38:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C4AA65B; Mon, 3 Nov 2014 10:38:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBE38BA0; Mon, 3 Nov 2014 10:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AcMHC019165; Mon, 3 Nov 2014 10:38:22 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AcM5N019164; Mon, 3 Nov 2014 10:38:22 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031038.sA3AcM5N019164@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 10:38:22 +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: r274030 - stable/9/sys/boot/pc98/cdboot 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:38:23 -0000 Author: nyan Date: Mon Nov 3 10:38:22 2014 New Revision: 274030 URL: https://svnweb.freebsd.org/changeset/base/274030 Log: MFC: r272252 Drop the 3rd clause from all 3 clause BSD licenses. Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:03 2014 (r274029) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Mon Nov 3 10:38:22 2014 (r274030) @@ -11,9 +11,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 10:42:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAD829BA; Mon, 3 Nov 2014 10:42:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B631FC53; Mon, 3 Nov 2014 10:42:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3AgSHc023255; Mon, 3 Nov 2014 10:42:28 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3AgSQQ023252; Mon, 3 Nov 2014 10:42:28 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411031042.sA3AgSQQ023252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 3 Nov 2014 10:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274031 - head/sys/dev/drm2 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:42:28 -0000 Author: dumbbell Date: Mon Nov 3 10:42:27 2014 New Revision: 274031 URL: https://svnweb.freebsd.org/changeset/base/274031 Log: drm: Take vt(4) default mode from loader tunables By default, vt(4) gets the "preferred mode" from DRM, when using a DRM video driver as its backend. The preferred mode is usually the native screen resolution. Now, if this mode isn't appropriate, a user can use loader tunables to select a mode. The tunables are read in the following order: 1. kern.vt.fb.modes.$connector_name 2. kern.vt.fb.default_mode For example, to set a 1024x768 mode, no matter the connector: kern.vt.fb.default_mode="1024x768" To set a 800x600 mode only on the laptop builtin screen: kern.vt.fb.modes.LVDS-1="800x600" MFC after: 1 week Modified: head/sys/dev/drm2/drm_fb_helper.c head/sys/dev/drm2/drm_fb_helper.h Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Mon Nov 3 10:38:22 2014 (r274030) +++ head/sys/dev/drm2/drm_fb_helper.c Mon Nov 3 10:42:27 2014 (r274031) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include struct vt_kms_softc { struct drm_fb_helper *fb_helper; @@ -96,170 +98,31 @@ int drm_fb_helper_single_add_all_connect return 0; } -const char *fb_mode_option; - -/** - * drm_fb_helper_connector_parse_command_line - parse command line for connector - * @connector - connector to parse line for - * @mode_option - per connector mode option - * - * This parses the connector specific then generic command lines for - * modes and options to configure the connector. - * - * This uses the same parameters as the fb modedb.c, except for extra - * x[M][R][-][@][i][m][eDd] - * - * enable/enable Digital/disable bit at the end - */ -static bool drm_fb_helper_connector_parse_command_line(struct drm_fb_helper_connector *fb_helper_conn, - const char *mode_option) -{ - const char *name; - unsigned int namelen; - int res_specified = 0, bpp_specified = 0, refresh_specified = 0; - unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; - int yres_specified = 0, cvt = 0, rb = 0, interlace = 0, margins = 0; - int i; - enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; - struct drm_fb_helper_cmdline_mode *cmdline_mode; - struct drm_connector *connector; - - if (!fb_helper_conn) - return false; - connector = fb_helper_conn->connector; - - cmdline_mode = &fb_helper_conn->cmdline_mode; - if (!mode_option) - mode_option = fb_mode_option; - - if (!mode_option) { - cmdline_mode->specified = false; - return false; - } - - name = mode_option; - namelen = strlen(name); - for (i = namelen-1; i >= 0; i--) { - switch (name[i]) { - case '@': - namelen = i; - if (!refresh_specified && !bpp_specified && - !yres_specified) { - refresh = strtol(&name[i+1], NULL, 10); - refresh_specified = 1; - if (cvt || rb) - cvt = 0; - } else - goto done; - break; - case '-': - namelen = i; - if (!bpp_specified && !yres_specified) { - bpp = strtol(&name[i+1], NULL, 10); - bpp_specified = 1; - if (cvt || rb) - cvt = 0; - } else - goto done; - break; - case 'x': - if (!yres_specified) { - yres = strtol(&name[i+1], NULL, 10); - yres_specified = 1; - } else - goto done; - case '0' ... '9': - break; - case 'M': - if (!yres_specified) - cvt = 1; - break; - case 'R': - if (cvt) - rb = 1; - break; - case 'm': - if (!cvt) - margins = 1; - break; - case 'i': - if (!cvt) - interlace = 1; - break; - case 'e': - force = DRM_FORCE_ON; - break; - case 'D': - if ((connector->connector_type != DRM_MODE_CONNECTOR_DVII) && - (connector->connector_type != DRM_MODE_CONNECTOR_HDMIB)) - force = DRM_FORCE_ON; - else - force = DRM_FORCE_ON_DIGITAL; - break; - case 'd': - force = DRM_FORCE_OFF; - break; - default: - goto done; - } - } - if (i < 0 && yres_specified) { - xres = strtol(name, NULL, 10); - res_specified = 1; - } -done: - - DRM_DEBUG_KMS("cmdline mode for connector %s %dx%d@%dHz%s%s%s\n", - drm_get_connector_name(connector), xres, yres, - (refresh) ? refresh : 60, (rb) ? " reduced blanking" : - "", (margins) ? " with margins" : "", (interlace) ? - " interlaced" : ""); - - if (force) { - const char *s; - switch (force) { - case DRM_FORCE_OFF: s = "OFF"; break; - case DRM_FORCE_ON_DIGITAL: s = "ON - dig"; break; - default: - case DRM_FORCE_ON: s = "ON"; break; - } - - DRM_INFO("forcing %s connector %s\n", - drm_get_connector_name(connector), s); - connector->force = force; - } - - if (res_specified) { - cmdline_mode->specified = true; - cmdline_mode->xres = xres; - cmdline_mode->yres = yres; - } - - if (refresh_specified) { - cmdline_mode->refresh_specified = true; - cmdline_mode->refresh = refresh; - } - - if (bpp_specified) { - cmdline_mode->bpp_specified = true; - cmdline_mode->bpp = bpp; - } - cmdline_mode->rb = rb ? true : false; - cmdline_mode->cvt = cvt ? true : false; - cmdline_mode->interlace = interlace ? true : false; - - return true; -} - static int fb_get_options(const char *connector_name, char **option) { + char tunable[64]; /* - * TODO: store mode options pointer in ${option} for connector with - * name ${connector_name} + * A user may use loader tunables to set a specific mode for the + * console. Tunables are read in the following order: + * 1. kern.vt.fb.modes.$connector_name + * 2. kern.vt.fb.default_mode + * + * Example of a mode specific to the LVDS connector: + * kern.vt.fb.modes.LVDS="1024x768" + * + * Example of a mode applied to all connectors not having a + * connector-specific mode: + * kern.vt.fb.default_mode="640x480" */ - return (1); + snprintf(tunable, sizeof(tunable), "kern.vt.fb.modes.%s", + connector_name); + *option = kern_getenv(tunable); + if (*option == NULL) + *option = kern_getenv("kern.vt.fb.default_mode"); + + return (*option != NULL ? 0 : 1); } static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper) @@ -268,15 +131,52 @@ static int drm_fb_helper_parse_command_l int i; for (i = 0; i < fb_helper->connector_count; i++) { + struct drm_cmdline_mode *mode; + struct drm_connector *connector; char *option = NULL; fb_helper_conn = fb_helper->connector_info[i]; + connector = fb_helper_conn->connector; + mode = &fb_helper_conn->cmdline_mode; /* do something on return - turn off connector maybe */ - if (fb_get_options(drm_get_connector_name(fb_helper_conn->connector), &option)) + if (fb_get_options(drm_get_connector_name(connector), &option)) continue; - drm_fb_helper_connector_parse_command_line(fb_helper_conn, option); + if (drm_mode_parse_command_line_for_connector(option, + connector, + mode)) { + if (mode->force) { + const char *s; + switch (mode->force) { + case DRM_FORCE_OFF: + s = "OFF"; + break; + case DRM_FORCE_ON_DIGITAL: + s = "ON - dig"; + break; + default: + case DRM_FORCE_ON: + s = "ON"; + break; + } + + DRM_INFO("forcing %s connector %s\n", + drm_get_connector_name(connector), s); + connector->force = mode->force; + } + + DRM_INFO("cmdline mode for connector %s %dx%d@%dHz%s%s%s\n", + drm_get_connector_name(connector), + mode->xres, mode->yres, + mode->refresh_specified ? mode->refresh : 60, + mode->rb ? " reduced blanking" : "", + mode->margins ? " with margins" : "", + mode->interlace ? " interlaced" : ""); + } + + freeenv(option); + } return 0; } @@ -955,7 +855,7 @@ int drm_fb_helper_single_fb_probe(struct /* first up get a count of crtcs now in use and new min/maxes width/heights */ for (i = 0; i < fb_helper->connector_count; i++) { struct drm_fb_helper_connector *fb_helper_conn = fb_helper->connector_info[i]; - struct drm_fb_helper_cmdline_mode *cmdline_mode; + struct drm_cmdline_mode *cmdline_mode; cmdline_mode = &fb_helper_conn->cmdline_mode; @@ -1180,7 +1080,7 @@ static struct drm_display_mode *drm_has_ static bool drm_has_cmdline_mode(struct drm_fb_helper_connector *fb_connector) { - struct drm_fb_helper_cmdline_mode *cmdline_mode; + struct drm_cmdline_mode *cmdline_mode; cmdline_mode = &fb_connector->cmdline_mode; return cmdline_mode->specified; } @@ -1191,10 +1091,8 @@ static struct drm_display_mode *drm_pick struct drm_cmdline_mode *cmdline_mode; struct drm_display_mode *mode = NULL; - cmdline_mode = &fb_helper_conn->cmdline_mode1; - if (cmdline_mode->specified == false && - !drm_fetch_cmdline_mode_from_kenv(fb_helper_conn->connector, - cmdline_mode)) + cmdline_mode = &fb_helper_conn->cmdline_mode; + if (cmdline_mode->specified == false) return (NULL); /* attempt to find a matching mode in the list of modes Modified: head/sys/dev/drm2/drm_fb_helper.h ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.h Mon Nov 3 10:38:22 2014 (r274030) +++ head/sys/dev/drm2/drm_fb_helper.h Mon Nov 3 10:42:27 2014 (r274031) @@ -40,20 +40,6 @@ struct drm_fb_helper_crtc { struct drm_display_mode *desired_mode; }; -/* mode specified on the command line */ -struct drm_fb_helper_cmdline_mode { - bool specified; - bool refresh_specified; - bool bpp_specified; - int xres, yres; - int bpp; - int refresh; - bool rb; - bool interlace; - bool cvt; - bool margins; -}; - struct drm_fb_helper_surface_size { u32 fb_width; u32 fb_height; @@ -74,9 +60,8 @@ struct drm_fb_helper_funcs { }; struct drm_fb_helper_connector { - struct drm_fb_helper_cmdline_mode cmdline_mode; - struct drm_cmdline_mode cmdline_mode1; struct drm_connector *connector; + struct drm_cmdline_mode cmdline_mode; }; struct drm_fb_helper { From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:01:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75B0BD6B; Mon, 3 Nov 2014 11:01:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61428E14; Mon, 3 Nov 2014 11:01:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3B1DH4031768; Mon, 3 Nov 2014 11:01:13 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3B1D7L031767; Mon, 3 Nov 2014 11:01:13 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031101.sA3B1D7L031767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:01:13 +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: r274032 - stable/10/sys/boot/pc98/libpc98 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:01:13 -0000 Author: nyan Date: Mon Nov 3 11:01:12 2014 New Revision: 274032 URL: https://svnweb.freebsd.org/changeset/base/274032 Log: MFC: r272255 Supress clang warning for FreeBSD printf %b and %D formats. Modified: stable/10/sys/boot/pc98/libpc98/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/10/sys/boot/pc98/libpc98/Makefile Mon Nov 3 10:42:27 2014 (r274031) +++ stable/10/sys/boot/pc98/libpc98/Makefile Mon Nov 3 11:01:12 2014 (r274032) @@ -44,4 +44,7 @@ CFLAGS+= -I${.CURDIR}/../../common \ # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .include From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:05:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36202FC6; Mon, 3 Nov 2014 11:05:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21FF9E4F; Mon, 3 Nov 2014 11:05:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3B5OVI033396; Mon, 3 Nov 2014 11:05:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3B5OYF033395; Mon, 3 Nov 2014 11:05:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411031105.sA3B5OYF033395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Nov 2014 11:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274033 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:05:24 -0000 Author: trasz Date: Mon Nov 3 11:05:23 2014 New Revision: 274033 URL: https://svnweb.freebsd.org/changeset/base/274033 Log: s/icl_pdu_new/icl_pdu_new_empty/g; no functional changes. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Mon Nov 3 11:01:12 2014 (r274032) +++ head/sys/dev/iscsi/icl.c Mon Nov 3 11:05:23 2014 (r274033) @@ -147,7 +147,7 @@ icl_conn_receive(struct icl_conn *ic, si } static struct icl_pdu * -icl_pdu_new(struct icl_conn *ic, int flags) +icl_pdu_new_empty(struct icl_conn *ic, int flags) { struct icl_pdu *ip; @@ -192,7 +192,7 @@ icl_pdu_new_bhs(struct icl_conn *ic, int { struct icl_pdu *ip; - ip = icl_pdu_new(ic, flags); + ip = icl_pdu_new_empty(ic, flags); if (ip == NULL) return (NULL); @@ -542,7 +542,7 @@ icl_conn_receive_pdu(struct icl_conn *ic if (ic->ic_receive_state == ICL_CONN_STATE_BHS) { KASSERT(ic->ic_receive_pdu == NULL, ("ic->ic_receive_pdu != NULL")); - request = icl_pdu_new(ic, M_NOWAIT); + request = icl_pdu_new_empty(ic, M_NOWAIT); if (request == NULL) { ICL_DEBUG("failed to allocate PDU; " "dropping connection"); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:08:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 531B22A4; Mon, 3 Nov 2014 11:08:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3B6E7F; Mon, 3 Nov 2014 11:08:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3B81aJ033773; Mon, 3 Nov 2014 11:08:01 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3B80Bh033767; Mon, 3 Nov 2014 11:08:00 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031108.sA3B80Bh033767@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:08: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: r274034 - in stable/10/sys/boot: . pc98/loader 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:08:01 -0000 Author: nyan Date: Mon Nov 3 11:08:00 2014 New Revision: 274034 URL: https://svnweb.freebsd.org/changeset/base/274034 Log: MFC: r272256 Switch from lib/libstand to sys/boot/libstand32. Modified: stable/10/sys/boot/Makefile.pc98 stable/10/sys/boot/pc98/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/Makefile.pc98 ============================================================================== --- stable/10/sys/boot/Makefile.pc98 Mon Nov 3 11:05:23 2014 (r274033) +++ stable/10/sys/boot/Makefile.pc98 Mon Nov 3 11:08:00 2014 (r274034) @@ -1,4 +1,3 @@ # $FreeBSD$ -# Blank, to override Makefile.i386 since Makefile.$MACHINE is included before -# Makefile.$MACHINE_ARCH +SUBDIR+= libstand32 Modified: stable/10/sys/boot/pc98/loader/Makefile ============================================================================== --- stable/10/sys/boot/pc98/loader/Makefile Mon Nov 3 11:05:23 2014 (r274033) +++ stable/10/sys/boot/pc98/loader/Makefile Mon Nov 3 11:08:00 2014 (r274034) @@ -56,6 +56,8 @@ LDFLAGS= -static -Ttext 0x0 LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a CFLAGS+= -I${.CURDIR}/.. +LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a + # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:11:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60E6F40B; Mon, 3 Nov 2014 11:11:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B66EF24; Mon, 3 Nov 2014 11:11:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BBoBE037915; Mon, 3 Nov 2014 11:11:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BBkqB037888; Mon, 3 Nov 2014 11:11:46 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411031111.sA3BBkqB037888@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 3 Nov 2014 11:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274035 - in head/sys/dev/sound: isa midi pci pcm 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:11:50 -0000 Author: bapt Date: Mon Nov 3 11:11:45 2014 New Revision: 274035 URL: https://svnweb.freebsd.org/changeset/base/274035 Log: Remove check for obsolete FreeBSD versions PR: 194517 Submitted by: François Tigeot Modified: head/sys/dev/sound/isa/gusc.c head/sys/dev/sound/isa/sb16.c head/sys/dev/sound/isa/sbc.c head/sys/dev/sound/midi/sequencer.c head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/cs4281.c head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/maestro.c head/sys/dev/sound/pci/vibes.c head/sys/dev/sound/pcm/dsp.c head/sys/dev/sound/pcm/mixer.c head/sys/dev/sound/pcm/sound.c head/sys/dev/sound/pcm/sound.h Modified: head/sys/dev/sound/isa/gusc.c ============================================================================== --- head/sys/dev/sound/isa/gusc.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/isa/gusc.c Mon Nov 3 11:11:45 2014 (r274035) @@ -421,20 +421,16 @@ gusc_release_resource(device_t bus, devi static int gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, -#if __FreeBSD_version >= 700031 driver_filter_t *filter, -#endif driver_intr_t *intr, void *arg, void **cookiep) { sc_p scp = (sc_p)device_get_softc(dev); devclass_t devclass; -#if __FreeBSD_version >= 700031 if (filter != NULL) { printf("gusc.c: we cannot use a filter here\n"); return (EINVAL); } -#endif devclass = device_get_devclass(child); if (strcmp(devclass_get_name(devclass), "midi") == 0) { scp->midi_intr.intr = intr; @@ -446,9 +442,7 @@ gusc_setup_intr(device_t dev, device_t c return 0; } return bus_generic_setup_intr(dev, child, irq, flags, -#if __FreeBSD_version >= 700031 filter, -#endif intr, arg, cookiep); } Modified: head/sys/dev/sound/isa/sb16.c ============================================================================== --- head/sys/dev/sound/isa/sb16.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/isa/sb16.c Mon Nov 3 11:11:45 2014 (r274035) @@ -176,10 +176,8 @@ sb_dspwr(struct sb_info *sb, u_char val) return 1; } } -#if __FreeBSD_version > 500000 if (curthread->td_intr_nesting_level == 0) printf("sb_dspwr(0x%02x) timed out.\n", val); -#endif return 0; } Modified: head/sys/dev/sound/isa/sbc.c ============================================================================== --- head/sys/dev/sound/isa/sbc.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/isa/sbc.c Mon Nov 3 11:11:45 2014 (r274035) @@ -85,9 +85,7 @@ static int sbc_release_resource(device_t struct resource *r); static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, -#if __FreeBSD_version >= 700031 driver_filter_t *filter, -#endif driver_intr_t *intr, void *arg, void **cookiep); static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq, @@ -512,9 +510,7 @@ sbc_intr(void *p) static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, -#if __FreeBSD_version >= 700031 driver_filter_t *filter, -#endif driver_intr_t *intr, void *arg, void **cookiep) { @@ -522,12 +518,10 @@ sbc_setup_intr(device_t dev, device_t ch struct sbc_ihl *ihl = NULL; int i, ret; -#if __FreeBSD_version >= 700031 if (filter != NULL) { printf("sbc.c: we cannot use a filter here\n"); return (EINVAL); } -#endif sbc_lock(scp); i = 0; while (i < IRQ_MAX) { Modified: head/sys/dev/sound/midi/sequencer.c ============================================================================== --- head/sys/dev/sound/midi/sequencer.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/midi/sequencer.c Mon Nov 3 11:11:45 2014 (r274035) @@ -466,12 +466,7 @@ done: cv_broadcast(&scp->th_cv); mtx_unlock(&scp->seq_lock); SEQ_DEBUG(2, printf("seq_eventthread finished\n")); -#if __FreeBSD_version >= 800002 kproc_exit(0); -#else - mtx_lock(&Giant); - kthread_exit(0); -#endif } /* @@ -587,11 +582,7 @@ seq_addunit(void) */ ret = -#if __FreeBSD_version >= 800002 kproc_create -#else - kthread_create -#endif (seq_eventthread, scp, NULL, RFHIGHPID, 0, "sequencer %02d", scp->unit); Modified: head/sys/dev/sound/pci/als4000.c ============================================================================== --- head/sys/dev/sound/pci/als4000.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/als4000.c Mon Nov 3 11:11:45 2014 (r274035) @@ -818,22 +818,12 @@ als_pci_attach(device_t dev) * ALS4000 is entirely controlled by the pci powerstate. We * could attempt finer grained control by setting GCR6.31. */ -#if __FreeBSD_version > 500000 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { /* Reset the power state. */ device_printf(dev, "chip is in D%d power mode " "-- setting to D0\n", pci_get_powerstate(dev)); pci_set_powerstate(dev, PCI_POWERSTATE_D0); } -#else - data = pci_read_config(dev, ALS_PCI_POWERREG, 2); - if ((data & 0x03) != 0) { - device_printf(dev, "chip is in D%d power mode " - "-- setting to D0\n", data & 0x03); - data &= ~0x03; - pci_write_config(dev, ALS_PCI_POWERREG, data, 2); - } -#endif if (als_resource_grab(dev, sc)) { device_printf(dev, "failed to allocate resources\n"); Modified: head/sys/dev/sound/pci/cs4281.c ============================================================================== --- head/sys/dev/sound/pci/cs4281.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/cs4281.c Mon Nov 3 11:11:45 2014 (r274035) @@ -768,7 +768,6 @@ cs4281_pci_attach(device_t dev) pci_enable_busmaster(dev); -#if __FreeBSD_version > 500000 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { /* Reset the power state. */ device_printf(dev, "chip is in D%d power mode " @@ -776,17 +775,6 @@ cs4281_pci_attach(device_t dev) pci_set_powerstate(dev, PCI_POWERSTATE_D0); } -#else - data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4); - if (data & CS4281PCI_PMCS_PS_MASK) { - /* Reset the power state. */ - device_printf(dev, "chip is in D%d power mode " - "-- setting to D0\n", - data & CS4281PCI_PMCS_PS_MASK); - pci_write_config(dev, CS4281PCI_PMCS_OFFSET, - data & ~CS4281PCI_PMCS_PS_MASK, 4); - } -#endif sc->regid = PCIR_BAR(0); sc->regtype = SYS_RES_MEMORY; Modified: head/sys/dev/sound/pci/csa.c ============================================================================== --- head/sys/dev/sound/pci/csa.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/csa.c Mon Nov 3 11:11:45 2014 (r274035) @@ -86,9 +86,7 @@ static int csa_release_resource(device_t struct resource *r); static int csa_setup_intr(device_t bus, device_t child, struct resource *irq, int flags, -#if __FreeBSD_version >= 700031 driver_filter_t *filter, -#endif driver_intr_t *intr, void *arg, void **cookiep); static int csa_teardown_intr(device_t bus, device_t child, struct resource *irq, void *cookie); @@ -450,21 +448,17 @@ csa_release_resource(device_t bus, devic static int csa_setup_intr(device_t bus, device_t child, struct resource *irq, int flags, -#if __FreeBSD_version >= 700031 driver_filter_t *filter, -#endif driver_intr_t *intr, void *arg, void **cookiep) { sc_p scp; csa_res *resp; struct sndcard_func *func; -#if __FreeBSD_version >= 700031 if (filter != NULL) { printf("ata-csa.c: we cannot use a filter here\n"); return (EINVAL); } -#endif scp = device_get_softc(bus); resp = &scp->res; Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/emu10kx.c Mon Nov 3 11:11:45 2014 (r274035) @@ -3203,9 +3203,7 @@ emu_pci_attach(device_t dev) i = 0; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE); if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV, -#if __FreeBSD_version >= 700031 NULL, -#endif emu_intr, sc, &sc->ih)) { device_printf(dev, "unable to map interrupt\n"); goto bad; Modified: head/sys/dev/sound/pci/envy24.c ============================================================================== --- head/sys/dev/sound/pci/envy24.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/envy24.c Mon Nov 3 11:11:45 2014 (r274035) @@ -2690,11 +2690,7 @@ static device_method_t envy24_methods[] static driver_t envy24_driver = { "pcm", envy24_methods, -#if __FreeBSD_version > 500000 PCM_SOFTC_SIZE, -#else - sizeof(struct snddev_info), -#endif }; DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0); Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/envy24ht.c Mon Nov 3 11:11:45 2014 (r274035) @@ -2588,11 +2588,7 @@ static device_method_t envy24ht_methods[ static driver_t envy24ht_driver = { "pcm", envy24ht_methods, -#if __FreeBSD_version > 500000 PCM_SOFTC_SIZE, -#else - sizeof(struct snddev_info), -#endif }; DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0); Modified: head/sys/dev/sound/pci/maestro.c ============================================================================== --- head/sys/dev/sound/pci/maestro.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/maestro.c Mon Nov 3 11:11:45 2014 (r274035) @@ -87,12 +87,6 @@ SND_DECLARE_FILE("$FreeBSD$"); #define AGG_DEFAULT_BUFSZ 0x4000 /* 0x1000, but gets underflows */ -/* compatibility */ -#if __FreeBSD_version < 500000 -# define critical_enter() disable_intr() -# define critical_exit() enable_intr() -#endif - #ifndef PCIR_BAR #define PCIR_BAR(x) (PCIR_MAPS + (x) * 4) #endif @@ -1815,9 +1809,7 @@ agg_attach(device_t dev) /*filter*/ NULL, NULL, /*size */ ess->bufsz, 1, 0x3ffff, /*flags */ 0, -#if __FreeBSD_version >= 501102 /*lock */ busdma_lock_mutex, &Giant, -#endif &ess->buf_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); ret = ENOMEM; @@ -1831,9 +1823,7 @@ agg_attach(device_t dev) /*filter*/ NULL, NULL, /*size */ 3*ess->bufsz, 1, 0x3ffff, /*flags */ 0, -#if __FreeBSD_version >= 501102 /*lock */ busdma_lock_mutex, &Giant, -#endif &ess->stat_dmat) != 0) { device_printf(dev, "unable to create dma tag\n"); ret = ENOMEM; Modified: head/sys/dev/sound/pci/vibes.c ============================================================================== --- head/sys/dev/sound/pci/vibes.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pci/vibes.c Mon Nov 3 11:11:45 2014 (r274035) @@ -730,13 +730,11 @@ sv_attach(device_t dev) { pci_enable_busmaster(dev); -#if __FreeBSD_version > 500000 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { device_printf(dev, "chip is in D%d power mode " "-- setting to D0\n", pci_get_powerstate(dev)); pci_set_powerstate(dev, PCI_POWERSTATE_D0); } -#endif sc->enh_rid = SV_PCI_ENHANCED; sc->enh_type = SYS_RES_IOPORT; sc->enh_reg = bus_alloc_resource(dev, sc->enh_type, Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pcm/dsp.c Mon Nov 3 11:11:45 2014 (r274035) @@ -2324,9 +2324,7 @@ dsp_stdclone(char *name, char *namep, ch static void dsp_clone(void *arg, -#if __FreeBSD_version >= 600034 struct ucred *cred, -#endif char *name, int namelen, struct cdev **dev) { struct snddev_info *d; Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pcm/mixer.c Mon Nov 3 11:11:45 2014 (r274035) @@ -1328,9 +1328,7 @@ done: static void mixer_clone(void *arg, -#if __FreeBSD_version >= 600034 struct ucred *cred, -#endif char *name, int namelen, struct cdev **dev) { struct snddev_info *d; Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pcm/sound.c Mon Nov 3 11:11:45 2014 (r274035) @@ -124,11 +124,7 @@ snd_setup_intr(device_t dev, struct reso if (d != NULL && (flags & INTR_MPSAFE)) d->flags |= SD_F_MPSAFE; - return bus_setup_intr(dev, res, flags, -#if __FreeBSD_version >= 700031 - NULL, -#endif - hand, param, cookiep); + return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep); } static void Modified: head/sys/dev/sound/pcm/sound.h ============================================================================== --- head/sys/dev/sound/pcm/sound.h Mon Nov 3 11:08:00 2014 (r274034) +++ head/sys/dev/sound/pcm/sound.h Mon Nov 3 11:11:45 2014 (r274035) @@ -53,9 +53,6 @@ #include #include #include -#if __FreeBSD_version < 500000 -#include -#endif #include #include #include @@ -120,11 +117,7 @@ struct snd_mixer; #define PCMCHAN(x) (snd_unit2c(dev2unit(x))) /* XXX unit2minor compat */ -#if __FreeBSD_version >= 800062 #define PCMMINOR(x) (x) -#else -#define PCMMINOR(x) unit2minor(x) -#endif /* * By design, limit possible channels for each direction. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:15:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F13666D; Mon, 3 Nov 2014 11:15:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8AFF4B; Mon, 3 Nov 2014 11:15:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BFrnp038663; Mon, 3 Nov 2014 11:15:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BFqjr038656; Mon, 3 Nov 2014 11:15:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411031115.sA3BFqjr038656@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 3 Nov 2014 11:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274036 - in head/sys: cam/ctl dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:15:53 -0000 Author: trasz Date: Mon Nov 3 11:15:51 2014 New Revision: 274036 URL: https://svnweb.freebsd.org/changeset/base/274036 Log: s/icl_pdu_new_bhs/icl_pdu_new/; no functional changes, just a little nicer code. Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/dev/iscsi/icl.c head/sys/dev/iscsi/icl.h head/sys/dev/iscsi/iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Nov 3 11:11:45 2014 (r274035) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Nov 3 11:15:51 2014 (r274036) @@ -187,7 +187,7 @@ static struct icl_pdu * cfiscsi_pdu_new_response(struct icl_pdu *request, int flags) { - return (icl_pdu_new_bhs(request->ip_conn, flags)); + return (icl_pdu_new(request->ip_conn, flags)); } static bool @@ -1040,7 +1040,7 @@ cfiscsi_callout(void *context) if (cs->cs_timeout < 2) return; - cp = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + cp = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (cp == NULL) { CFISCSI_SESSION_WARN(cs, "failed to allocate memory"); return; @@ -1643,7 +1643,7 @@ cfiscsi_ioctl_terminate(struct ctl_iscsi strcmp(cs->cs_initiator_addr, citp->initiator_addr) != 0) continue; - response = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { /* * Oh well. Just terminate the connection. @@ -1693,7 +1693,7 @@ cfiscsi_ioctl_logout(struct ctl_iscsi *c strcmp(cs->cs_initiator_addr, cilp->initiator_addr) != 0) continue; - response = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); + response = icl_pdu_new(cs->cs_conn, M_NOWAIT); if (response == NULL) { ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1863,7 +1863,7 @@ cfiscsi_ioctl_send(struct ctl_iscsi *ci) } } - ip = icl_pdu_new_bhs(cs->cs_conn, M_WAITOK); + ip = icl_pdu_new(cs->cs_conn, M_WAITOK); memcpy(ip->ip_bhs, cisp->bhs, sizeof(*ip->ip_bhs)); if (datalen > 0) { icl_pdu_append_data(ip, data, datalen, M_WAITOK); Modified: head/sys/dev/iscsi/icl.c ============================================================================== --- head/sys/dev/iscsi/icl.c Mon Nov 3 11:11:45 2014 (r274035) +++ head/sys/dev/iscsi/icl.c Mon Nov 3 11:15:51 2014 (r274036) @@ -188,7 +188,7 @@ icl_pdu_free(struct icl_pdu *ip) * Allocate icl_pdu with empty BHS to fill up by the caller. */ struct icl_pdu * -icl_pdu_new_bhs(struct icl_conn *ic, int flags) +icl_pdu_new(struct icl_conn *ic, int flags) { struct icl_pdu *ip; Modified: head/sys/dev/iscsi/icl.h ============================================================================== --- head/sys/dev/iscsi/icl.h Mon Nov 3 11:11:45 2014 (r274035) +++ head/sys/dev/iscsi/icl.h Mon Nov 3 11:15:51 2014 (r274036) @@ -57,7 +57,7 @@ struct icl_pdu { uint32_t ip_prv2; }; -struct icl_pdu *icl_pdu_new_bhs(struct icl_conn *ic, int flags); +struct icl_pdu *icl_pdu_new(struct icl_conn *ic, int flags); size_t icl_pdu_data_segment_length(const struct icl_pdu *ip); int icl_pdu_append_data(struct icl_pdu *ip, const void *addr, size_t len, int flags); void icl_pdu_get_data(struct icl_pdu *ip, size_t off, void *addr, size_t len); Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Mon Nov 3 11:11:45 2014 (r274035) +++ head/sys/dev/iscsi/iscsi.c Mon Nov 3 11:15:51 2014 (r274036) @@ -266,7 +266,7 @@ iscsi_session_logout(struct iscsi_sessio struct icl_pdu *request; struct iscsi_bhs_logout_request *bhslr; - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) return; @@ -585,7 +585,7 @@ iscsi_callout(void *context) if (is->is_timeout < 2) return; - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate PDU"); return; @@ -789,7 +789,7 @@ iscsi_pdu_handle_nop_in(struct icl_pdu * icl_pdu_get_data(response, 0, data, datasize); } - request = icl_pdu_new_bhs(response->ip_conn, M_NOWAIT); + request = icl_pdu_new(response->ip_conn, M_NOWAIT); if (request == NULL) { ISCSI_SESSION_WARN(is, "failed to allocate memory; " "reconnecting"); @@ -1150,7 +1150,7 @@ iscsi_pdu_handle_r2t(struct icl_pdu *res return; } - request = icl_pdu_new_bhs(response->ip_conn, M_NOWAIT); + request = icl_pdu_new(response->ip_conn, M_NOWAIT); if (request == NULL) { icl_pdu_free(response); iscsi_session_reconnect(is); @@ -1554,7 +1554,7 @@ iscsi_ioctl_daemon_send(struct iscsi_sof } } - ip = icl_pdu_new_bhs(is->is_conn, M_WAITOK); + ip = icl_pdu_new(is->is_conn, M_WAITOK); memcpy(ip->ip_bhs, ids->ids_bhs, sizeof(*ip->ip_bhs)); if (datalen > 0) { error = icl_pdu_append_data(ip, data, datalen, M_WAITOK); @@ -2004,7 +2004,7 @@ iscsi_action_abort(struct iscsi_session return; } - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { ccb->ccb_h.status = CAM_RESRC_UNAVAIL; xpt_done(ccb); @@ -2058,7 +2058,7 @@ iscsi_action_scsiio(struct iscsi_session } #endif - request = icl_pdu_new_bhs(is->is_conn, M_NOWAIT); + request = icl_pdu_new(is->is_conn, M_NOWAIT); if (request == NULL) { if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { xpt_freeze_devq(ccb->ccb_h.path, 1); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:18:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4416E80D; Mon, 3 Nov 2014 11:18:57 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC14FF69; Mon, 3 Nov 2014 11:18:56 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA3BIpBd027189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 13:18:51 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA3BIpBd027189 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA3BIpk1027188; Mon, 3 Nov 2014 13:18:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Nov 2014 13:18:51 +0200 From: Konstantin Belousov To: Attilio Rao Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20141103111851.GM53947@kib.kiev.ua> References: <20141102165916.GY53947@kib.kiev.ua> <20141102174958.GZ53947@kib.kiev.ua> <20141102191029.GA53947@kib.kiev.ua> <20141102213819.GF53947@kib.kiev.ua> <20141102224934.GG53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:18:57 -0000 On Mon, Nov 03, 2014 at 11:34:48AM +0100, Attilio Rao wrote: > On Sun, Nov 2, 2014 at 11:49 PM, Konstantin Belousov > wrote: > > On Sun, Nov 02, 2014 at 11:37:57PM +0100, Attilio Rao wrote: > >> On Sun, Nov 2, 2014 at 10:38 PM, Konstantin Belousov > >> wrote: > >> > On Sun, Nov 02, 2014 at 10:17:26PM +0100, Attilio Rao wrote: > >> >> I think that your initial patch (what is in head now) is a better approach. > >> >> I would just make it a lockinit() flag to make it less alien to the KPI. > >> >> > >> > > >> > Ok. > >> > > >> > Can you explain what would the proposed lockinit() flag do ? What should > >> > it change comparing with the current code ? > >> > >> You now provide LK_NODDLKTREAT on a call basis. > >> The lockinit() flag would embed this into the lock attribute and make > >> it always real, without the need for the callers to provide > >> LK_NODDLKTREAT on a call basis. > > > > Am I reading your proposal right ? Do you mean, that for all vnodes, > > I should disable exclusive starvation avoidance at all ? I completely > > disagree with this. > > No, I'm saying that we should support doing this at the KPI level. Not > that you should enable this for all the vnodes. I am unable to decipher your proposal. The property of guaranteed non-recursive shared request is per call site, it is not global for the life of lock. As such, I do not understand what would a proposed flag for lockinit(9) indicate to kern_lock.c, vs. the currently passed flag to __lockmgr_args(9). Only specific calls need to avoid check for td_lk_slocks != 0, not specific locks. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:21:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3900896F; Mon, 3 Nov 2014 11:21:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21EC2F7A; Mon, 3 Nov 2014 11:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BLiNV042890; Mon, 3 Nov 2014 11:21:44 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BLhff042889; Mon, 3 Nov 2014 11:21:43 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031121.sA3BLhff042889@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:21: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: r274037 - stable/10/sys/pc98/conf 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:21:44 -0000 Author: nyan Date: Mon Nov 3 11:21:43 2014 New Revision: 274037 URL: https://svnweb.freebsd.org/changeset/base/274037 Log: MFC: r272258 - Cosmetic changes. - Reduce diffs against i386. MFC: 272259 MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. Modified: stable/10/sys/pc98/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/pc98/conf/GENERIC ============================================================================== --- stable/10/sys/pc98/conf/GENERIC Mon Nov 3 11:15:51 2014 (r274036) +++ stable/10/sys/pc98/conf/GENERIC Mon Nov 3 11:21:43 2014 (r274037) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server @@ -60,6 +61,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing @@ -67,9 +69,11 @@ options CAPABILITY_MODE # Capsicum cap options CAPABILITIES # Capsicum capabilities options PROCDESC # Support for process descriptors options MAC # TrustedBSD MAC Framework -options INCLUDE_CONFIG_FILE # Include this file in kernel -options KDB # Kernel debugger related code -options KDB_TRACE # Print a stack trace for a panic +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel @@ -82,47 +86,48 @@ device pci device fdc # ATA controllers -device ahci # AHCI-compatible SATA controllers -device ata # Legacy ATA/SATA controllers -options ATA_STATIC_ID # Static device numbering -device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA -device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_STATIC_ID # Static device numbering +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device adv # Advansys SCSI adapters -device ahc # AHA2940 and onboard AIC7xxx devices -device esp # AMD Am53C974 (Tekram DC-390(T)) -device isp # Qlogic family -#device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') - -device aic # PC-9801-100 -device ct # host adapter using WD33C93[ABC] chip (C bus) - -device ncv # NCR 53C500 -device nsp # Workbit Ninja SCSI-3 -device stg # TMC 18C30/18C50 +device ahc # AHA2940 and onboard AIC7xxx devices +device esp # AMD Am53C974 (Tekram DC-390(T)) +device isp # Qlogic family +#device ncr # NCR/Symbios Logic +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') + +device adv # Advansys SCSI adapters +device aic # PC-9801-100 +device ct # host adapter using WD33C93[ABC] chip + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 # ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device ch # SCSI media changers -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct ATA/SCSI access) -device ses # Enclosure Services (SES and SAF-TE) +device scbus # SCSI bus (required for ATA/SCSI) +device ch # SCSI media changers +device da # Direct Access (disks) +device sa # Sequential Access (tape etc) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # keyboard driver -device pckbd # PC98 keyboard +device pckbd # PC98 keyboard -device gdc # GDC screen +device gdc # GDC screen -device splash # Splash screen and screen saver support +device splash # Splash screen and screen saver support # syscons is the default console driver, resembling an SCO console device sc -#device agp # support several AGP chipsets +#device agp # support several AGP chipsets # Power management support (see NOTES for more options) #device apm @@ -134,114 +139,116 @@ device sc # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -device cbb # cardbus (yenta) bridge -device pccard # PC Card (16-bit) bus -device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports #options COM_MULTIPORT -#options COM_ESP # ESP98 -#device sio # 8250, 16[45]50, 8251 based serial ports -device uart # Generic UART driver +#options COM_ESP # ESP98 +#device sio # 8250, 16[45]50, 8251 based serial ports +device uart # Generic UART driver device mse #device joy -# NEW Parallel port +# Parallel port device ppc -device ppbus # Parallel port bus (required) -device lpt # Printer -device ppi # Parallel port interface device -#device vpo # Requires scbus and da +device ppbus # Parallel port bus (required) +device lpt # Printer +device ppi # Parallel port interface device +#device vpo # Requires scbus and da # OLD Parallel port #device olpt +device puc # Multi I/O cards and multi-channel UARTs + # PCI Ethernet NICs. -device de # DEC/Intel DC21x4x (``Tulip'') -#device em # Intel PRO/1000 adapter Gigabit Ethernet Card -device le # AMD Am7900 LANCE and Am79C9xx PCnet -#device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') -device vx # 3Com 3c590, 3c595 (``Vortex'') +device de # DEC/Intel DC21x4x (``Tulip'') +#device em # Intel PRO/1000 Gigabit Ethernet Family +device le # AMD Am7900 LANCE and Am79C9xx PCnet +#device ti # Alteon Networks Tigon I/II gigabit Ethernet +device txp # 3Com 3cR990 (``Typhoon'') +device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! -device miibus # MII bus support -device bfe # Broadcom BCM440x 10/100 Ethernet -#device bge # Broadcom BCM570xx Gigabit Ethernet -device dc # DEC/Intel 21143 and various workalikes -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -#device lge # Level 1 LXT1001 gigabit Ethernet -#device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') -device re # RealTek 8139C+/8169/8169S/8110S -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -device ste # Sundance ST201 (D-Link DFE-550TX) -device tl # Texas Instruments ThunderLAN -device tx # SMC EtherPower II (83c170 ``EPIC'') -#device vge # VIA VT612x gigabit Ethernet -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +device miibus # MII bus support +device bfe # Broadcom BCM440x 10/100 Ethernet +#device bge # Broadcom BCM570xx Gigabit Ethernet +device dc # DEC/Intel 21143 and various workalikes +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +#device lge # Level 1 LXT1001 gigabit Ethernet +#device nge # NatSemi DP83820 gigabit Ethernet +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') +device re # RealTek 8139C+/8169/8169S/8110S +device rl # RealTek 8129/8139 +device sf # Adaptec AIC-6915 (``Starfire'') +device sis # Silicon Integrated Systems SiS 900/SiS 7016 +#device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet +device ste # Sundance ST201 (D-Link DFE-550TX) +device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 ``EPIC'') +#device vge # VIA VT612x gigabit Ethernet +device vr # VIA Rhine, Rhine II +device wb # Winbond W89C840F +device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. # 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards -device ep # Etherlink III based cards -device fe # Fujitsu MB8696x based cards -device sn # SMC's 9000 series of Ethernet chips +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device sn # SMC's 9000 series of Ethernet chips device snc -device xe # Xircom pccard Ethernet +device xe # Xircom pccard Ethernet # Wireless NIC cards -#device wlan # 802.11 support -#options IEEE80211_DEBUG # enable debug msgs +#device wlan # 802.11 support +#options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's options IEEE80211_SUPPORT_MESH # enable 802.11s draft support -#device wlan_wep # 802.11 WEP support -#device wlan_ccmp # 802.11 CCMP support -#device wlan_tkip # 802.11 TKIP support -#device wlan_amrr # AMRR transmit rate control algorithm -#device an # Aironet 4500/4800 802.11 wireless NICs. -#device ath # Atheros NICs -#device ath_pci # Atheros pci/cardbus glue -#device ath_hal # pci/cardbus chip support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm +#device an # Aironet 4500/4800 802.11 wireless NICs. +#device ath # Atheros NICs +#device ath_pci # Atheros pci/cardbus glue +#device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors -#device ath_rate_sample # SampleRate tx rate control for ath -#device ral # Ralink Technology RT2500 wireless NICs. -#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. -#device wl # Older non 802.11 Wavelan wireless NIC. +#device ath_rate_sample # SampleRate tx rate control for ath +#device ral # Ralink Technology RT2500 wireless NICs. +#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. # Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -device vlan # 802.1Q VLAN support -device tun # Packet tunnel. -device md # Memory "disks" -device gif # IPv6 and IPv4 tunneling -device faith # IPv6-to-IPv4 relaying (translation) -device firmware # firmware assist module +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +device gif # IPv6 and IPv4 tunneling +device faith # IPv6-to-IPv4 relaying (translation) +device firmware # firmware assist module # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter +device bpf # Berkeley packet filter # USB support -#options USB_DEBUG # enable debug msgs -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) -#device usb # USB Bus (required) -#device ukbd # Keyboard -#device umass # Disks/Mass storage - Requires scbus and da +#options USB_DEBUG # enable debug msgs +#device uhci # UHCI PCI->USB interface +#device ohci # OHCI PCI->USB interface +#device ehci # EHCI PCI->USB interface (USB 2.0) +#device usb # USB Bus (required) +#device ukbd # Keyboard +#device umass # Disks/Mass storage - Requires scbus and da # Sound support -#device sound # Generic sound driver (required) -#device snd_mss # Microsoft Sound System -#device "snd_sb16" # Sound Blaster 16 -#device snd_sbc # Sound Blaster +#device sound # Generic sound driver (required) +#device snd_mss # Microsoft Sound System +#device "snd_sb16" # Sound Blaster 16 +#device snd_sbc # Sound Blaster From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:29:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0670BCF; Mon, 3 Nov 2014 11:29:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C6FDCA; Mon, 3 Nov 2014 11:29:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BT9AC043891; Mon, 3 Nov 2014 11:29:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BT9uh043890; Mon, 3 Nov 2014 11:29:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031129.sA3BT9uh043890@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 11:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274038 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:29:09 -0000 Author: kib Date: Mon Nov 3 11:29:08 2014 New Revision: 274038 URL: https://svnweb.freebsd.org/changeset/base/274038 Log: Clean up confusing comment. Move it to the place of code which is talked about. Explain where the mentioned trampoline located (usermode), and the fact that attempt to exit last thread is denied in kernel (by delegating the work to usermode). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Mon Nov 3 11:21:43 2014 (r274037) +++ head/sys/kern/kern_thr.c Mon Nov 3 11:29:08 2014 (r274038) @@ -317,10 +317,6 @@ sys_thr_exit(struct thread *td, struct t PROC_LOCK(p); - /* - * Shutting down last thread in the proc. This will actually - * call exit() in the trampoline when it returns. - */ if (p->p_numthreads != 1) { racct_sub(p, RACCT_NTHR, 1); LIST_REMOVE(td, td_hash); @@ -331,6 +327,12 @@ sys_thr_exit(struct thread *td, struct t thread_exit(); /* NOTREACHED */ } + + /* + * Ignore attempts to shut down last thread in the proc. This + * will actually call _exit(2) in the usermode trampoline when + * it returns. + */ PROC_UNLOCK(p); rw_wunlock(&tidhash_lock); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:43:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90B78E2A; Mon, 3 Nov 2014 11:43:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7159525E; Mon, 3 Nov 2014 11:43:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BheYf052537; Mon, 3 Nov 2014 11:43:40 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Bhemb052535; Mon, 3 Nov 2014 11:43:40 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031143.sA3Bhemb052535@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:43:40 +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: r274039 - stable/9/sys/pc98/conf 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:43:40 -0000 Author: nyan Date: Mon Nov 3 11:43:39 2014 New Revision: 274039 URL: https://svnweb.freebsd.org/changeset/base/274039 Log: MFC: r272258 (partial) - Reduce diffs against i386. MFC: r272259 MFi386: Enable QUOTA, PRINTF_BUFR_SIZE and puc. Modified: stable/9/sys/pc98/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Mon Nov 3 11:29:08 2014 (r274038) +++ stable/9/sys/pc98/conf/GENERIC Mon Nov 3 11:43:39 2014 (r274039) @@ -35,6 +35,7 @@ options SOFTUPDATES # Enable FFS soft options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling +options QUOTA # Enable disk quotas for UFS options MD_ROOT # MD is a potential root device options NFSCL # New Network Filesystem Client options NFSD # New Network Filesystem Server @@ -60,6 +61,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing @@ -87,13 +89,13 @@ device mvs # Marvell 88SX50XX/88SX60XX device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers -device adv # Advansys SCSI adapters device ahc # AHA2940 and onboard AIC7xxx devices device esp # AMD Am53C974 (Tekram DC-390(T)) device isp # Qlogic family #device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') +device adv # Advansys SCSI adapters device aic # PC-9801-100 device ct # host adapter using WD33C93[ABC] chip (C bus) @@ -108,7 +110,8 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) +#device ctl # CAM Target Layer # keyboard driver device pckbd # PC98 keyboard @@ -145,7 +148,7 @@ device uart # Generic UART driver device mse #device joy -# NEW Parallel port +# Parallel port device ppc device ppbus # Parallel port bus (required) device lpt # Printer @@ -155,6 +158,8 @@ device ppi # Parallel port interface d # OLD Parallel port #device olpt +device puc # Multi I/O cards and multi-channel UARTs + # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') #device em # Intel PRO/1000 adapter Gigabit Ethernet Card From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:49:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92A7C111; Mon, 3 Nov 2014 11:49:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 730DC28A; Mon, 3 Nov 2014 11:49:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BnaA3053507; Mon, 3 Nov 2014 11:49:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BnaNe053503; Mon, 3 Nov 2014 11:49:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411031149.sA3BnaNe053503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Nov 2014 11:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274040 - in head/sys: conf dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:49:36 -0000 Author: kib Date: Mon Nov 3 11:49:35 2014 New Revision: 274040 URL: https://svnweb.freebsd.org/changeset/base/274040 Log: agp_intel.c provides support for AGP on Intel chipsets from 440/BX to 875. This intersects with the agp_i810.c, which supports all Intels from i810 to Core i5/7. Both agp_intel.c and agp_i810.c are compiled into kernel when device agp is specified in config, and agp_i810 attach seems to be selected by chance due to linking order. Strip support for 810 and later from agp_intel.c. Since 440-class chipsets do not support any long-mode capable CPUs, remove agp_intel.c from amd64 kernel file list. Note that agp_intel.c is not compiled into agp.ko on amd64 already. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/conf/files.amd64 head/sys/dev/agp/agp_intel.c Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Nov 3 11:43:39 2014 (r274039) +++ head/sys/conf/files.amd64 Mon Nov 3 11:49:35 2014 (r274040) @@ -143,7 +143,6 @@ dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp -dev/agp/agp_intel.c optional agp dev/agp/agp_via.c optional agp dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp Modified: head/sys/dev/agp/agp_intel.c ============================================================================== --- head/sys/dev/agp/agp_intel.c Mon Nov 3 11:43:39 2014 (r274039) +++ head/sys/dev/agp/agp_intel.c Mon Nov 3 11:49:35 2014 (r274040) @@ -76,35 +76,6 @@ agp_intel_match(device_t dev) return ("Intel 82443GX host to PCI bridge"); case 0x71a18086: return ("Intel 82443GX host to AGP bridge"); - case 0x11308086: - return ("Intel 82815 (i815 GMCH) host to PCI bridge"); - case 0x25008086: - case 0x25018086: - return ("Intel 82820 host to AGP bridge"); - case 0x35758086: - return ("Intel 82830 host to AGP bridge"); - case 0x1a218086: - return ("Intel 82840 host to AGP bridge"); - case 0x1a308086: - return ("Intel 82845 host to AGP bridge"); - case 0x25308086: - return ("Intel 82850 host to AGP bridge"); - case 0x33408086: - return ("Intel 82855 host to AGP bridge"); - case 0x25318086: - return ("Intel 82860 host to AGP bridge"); - case 0x25708086: - return ("Intel 82865 host to AGP bridge"); - case 0x255d8086: - return ("Intel E7205 host to AGP bridge"); - case 0x25508086: - return ("Intel E7505 host to AGP bridge"); - case 0x25788086: - return ("Intel 82875P host to AGP bridge"); - case 0x25608086: - return ("Intel 82845G host to AGP bridge"); - case 0x35808086: - return ("Intel 82855GM host to AGP bridge"); } return (NULL); @@ -158,31 +129,6 @@ agp_intel_commit_gatt(device_t dev) /* Enable aperture accesses. */ switch (type) { - case 0x25008086: /* i820 */ - case 0x25018086: /* i820 */ - pci_write_config(dev, AGP_INTEL_I820_RDCR, - (pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) - | (1 << 1)), 1); - break; - case 0x1a308086: /* i845 */ - case 0x25608086: /* i845G */ - case 0x33408086: /* i855 */ - case 0x35808086: /* i855GM */ - case 0x25708086: /* i865 */ - case 0x25788086: /* i875P */ - pci_write_config(dev, AGP_INTEL_I845_AGPM, - (pci_read_config(dev, AGP_INTEL_I845_AGPM, 1) - | (1 << 1)), 1); - break; - case 0x1a218086: /* i840 */ - case 0x25308086: /* i850 */ - case 0x25318086: /* i860 */ - case 0x255d8086: /* E7205 */ - case 0x25508086: /* E7505 */ - pci_write_config(dev, AGP_INTEL_MCHCFG, - (pci_read_config(dev, AGP_INTEL_MCHCFG, 2) - | (1 << 9)), 2); - break; default: /* Intel Generic (maybe) */ pci_write_config(dev, AGP_INTEL_NBXCFG, (pci_read_config(dev, AGP_INTEL_NBXCFG, 4) @@ -191,22 +137,6 @@ agp_intel_commit_gatt(device_t dev) /* Clear errors. */ switch (type) { - case 0x1a218086: /* i840 */ - pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0xc000, 2); - break; - case 0x25008086: /* i820 */ - case 0x25018086: /* i820 */ - case 0x1a308086: /* i845 */ - case 0x25608086: /* i845G */ - case 0x25308086: /* i850 */ - case 0x33408086: /* i855 */ - case 0x25318086: /* i860 */ - case 0x25708086: /* i865 */ - case 0x25788086: /* i875P */ - case 0x255d8086: /* E7205 */ - case 0x25508086: /* E7505 */ - pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0x00ff, 2); - break; default: /* Intel Generic (maybe) */ pci_write_config(dev, AGP_INTEL_ERRSTS + 1, 7, 1); } @@ -267,31 +197,6 @@ agp_intel_detach(device_t dev) /* Disable aperture accesses. */ switch (pci_get_devid(dev)) { - case 0x25008086: /* i820 */ - case 0x25018086: /* i820 */ - reg = pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1); - printf("%s: set RDCR to %02x\n", __func__, reg & 0xff); - pci_write_config(dev, AGP_INTEL_I820_RDCR, reg, 1); - break; - case 0x1a308086: /* i845 */ - case 0x25608086: /* i845G */ - case 0x33408086: /* i855 */ - case 0x35808086: /* i855GM */ - case 0x25708086: /* i865 */ - case 0x25788086: /* i875P */ - reg = pci_read_config(dev, AGP_INTEL_I845_AGPM, 1) & ~(1 << 1); - printf("%s: set AGPM to %02x\n", __func__, reg & 0xff); - pci_write_config(dev, AGP_INTEL_I845_AGPM, reg, 1); - break; - case 0x1a218086: /* i840 */ - case 0x25308086: /* i850 */ - case 0x25318086: /* i860 */ - case 0x255d8086: /* E7205 */ - case 0x25508086: /* E7505 */ - reg = pci_read_config(dev, AGP_INTEL_MCHCFG, 2) & ~(1 << 9); - printf("%s: set MCHCFG to %x04\n", __func__, reg & 0xffff); - pci_write_config(dev, AGP_INTEL_MCHCFG, reg, 2); - break; default: /* Intel Generic (maybe) */ reg = pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9); printf("%s: set NBXCFG to %08x\n", __func__, reg); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 11:58:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B91AB456; Mon, 3 Nov 2014 11:58:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 999223CD; Mon, 3 Nov 2014 11:58:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3BwXMq058116; Mon, 3 Nov 2014 11:58:33 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3BwXLf058114; Mon, 3 Nov 2014 11:58:33 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031158.sA3BwXLf058114@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 11:58:33 +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: r274041 - in stable/10/sys/boot: i386/boot2 pc98/boot2 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 11:58:33 -0000 Author: nyan Date: Mon Nov 3 11:58:32 2014 New Revision: 274041 URL: https://svnweb.freebsd.org/changeset/base/274041 Log: MFC: r268475 (by imp) Make SERIAL support optional again. Enable it for i386 because a huge percentage of machines has a 16550. Disable it for pc98 since only a tiny fraction of them have one. Modified: stable/10/sys/boot/i386/boot2/boot2.c stable/10/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/i386/boot2/boot2.c Mon Nov 3 11:49:35 2014 (r274040) +++ stable/10/sys/boot/i386/boot2/boot2.c Mon Nov 3 11:58:32 2014 (r274041) @@ -34,9 +34,22 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +/* Define to 0 to omit serial support */ +#ifndef SERIAL +#define SERIAL 1 +#endif + #define IO_KEYBOARD 1 #define IO_SERIAL 2 +#if SERIAL +#define DO_KBD (ioctrl & IO_KEYBOARD) +#define DO_SIO (ioctrl & IO_SERIAL) +#else +#define DO_KBD (1) +#define DO_SIO (0) +#endif + #define SECOND 18 /* Circa that many ticks in a second. */ #define RBX_ASKNAME 0x0 /* -a */ @@ -131,9 +144,11 @@ static struct dsk { static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; -static int comspeed = SIOSPD; static struct bootinfo bootinfo; +#if SERIAL +static int comspeed = SIOSPD; static uint8_t ioctrl = IO_KEYBOARD; +#endif void exit(int); static void load(void); @@ -276,7 +291,7 @@ main(void) "boot: ", dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, 'a' + dsk.part, kname); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_flush(); if (!autoboot || keyhit(3*SECOND)) getstr(); @@ -398,6 +413,7 @@ parse() } printf("Keyboard: %s\n", cp); continue; +#if SERIAL } else if (c == 'S') { j = 0; while ((unsigned int)(i = *arg++ - '0') <= 9) @@ -407,18 +423,21 @@ parse() break; } /* Fall through to error below ('S' not in optstr[]). */ +#endif } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; opts ^= OPT_SET(flags[i]); } +#if SERIAL ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { + if (DO_SIO) { if (sio_init(115200 / comspeed) != 0) ioctrl &= ~IO_SERIAL; } +#endif } else { for (q = arg--; *q && *q != '('; q++); if (*q) { @@ -626,9 +645,9 @@ keyhit(unsigned ticks) static int xputc(int c) { - if (ioctrl & IO_KEYBOARD) + if (DO_KBD) putc(c); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_putc(c); return c; } @@ -648,9 +667,9 @@ xgetc(int fn) if (OPT_CHECK(RBX_NOINTR)) return 0; for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) + if (DO_KBD && getc(1)) return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) + if (DO_SIO && sio_ischar()) return fn ? 1 : sio_getc(); if (fn) return 0; Modified: stable/10/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/10/sys/boot/pc98/boot2/boot2.c Mon Nov 3 11:49:35 2014 (r274040) +++ stable/10/sys/boot/pc98/boot2/boot2.c Mon Nov 3 11:58:32 2014 (r274041) @@ -36,9 +36,22 @@ __FBSDID("$FreeBSD$"); #include "boot2.h" #include "lib.h" +/* Define to 0 to omit serial support */ +#ifndef SERIAL +#define SERIAL 0 +#endif + #define IO_KEYBOARD 1 #define IO_SERIAL 2 +#if SERIAL +#define DO_KBD (ioctrl & IO_KEYBOARD) +#define DO_SIO (ioctrl & IO_SERIAL) +#else +#define DO_KBD (1) +#define DO_SIO (0) +#endif + #define SECOND 1 /* Circa that many ticks in a second. */ #define RBX_ASKNAME 0x0 /* -a */ @@ -133,9 +146,11 @@ static struct dsk { static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; static uint32_t opts; -static int comspeed = SIOSPD; static struct bootinfo bootinfo; +#if SERIAL +static int comspeed = SIOSPD; static uint8_t ioctrl = IO_KEYBOARD; +#endif void exit(int); static void load(void); @@ -415,7 +430,7 @@ main(void) "boot: ", dsk.unit, dev_nm[dsk.type], dsk.unit, 'a' + dsk.part, kname); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_flush(); if (!autoboot || keyhit(3*SECOND)) getstr(); @@ -537,6 +552,7 @@ parse() } printf("Keyboard: %s\n", cp); continue; +#if SERIAL } else if (c == 'S') { j = 0; while ((unsigned int)(i = *arg++ - '0') <= 9) @@ -546,18 +562,21 @@ parse() break; } /* Fall through to error below ('S' not in optstr[]). */ +#endif } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; opts ^= OPT_SET(flags[i]); } +#if SERIAL ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { + if (DO_SIO) { if (sio_init(115200 / comspeed) != 0) ioctrl &= ~IO_SERIAL; } +#endif } else { for (q = arg--; *q && *q != '('; q++); if (*q) { @@ -780,9 +799,9 @@ keyhit(unsigned sec) static int xputc(int c) { - if (ioctrl & IO_KEYBOARD) + if (DO_KBD) putc(c); - if (ioctrl & IO_SERIAL) + if (DO_SIO) sio_putc(c); return c; } @@ -805,9 +824,9 @@ xgetc(int fn) if (OPT_CHECK(RBX_NOINTR)) return 0; for (;;) { - if (ioctrl & IO_KEYBOARD && getc(1)) + if (DO_KBD && getc(1)) return fn ? 1 : getc(0); - if (ioctrl & IO_SERIAL && sio_ischar()) + if (DO_SIO && sio_ischar()) return fn ? 1 : sio_getc(); if (fn) return 0; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 12:07:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AFAC8D5; Mon, 3 Nov 2014 12:07:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C0C66E5; Mon, 3 Nov 2014 12:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3C75bS062882; Mon, 3 Nov 2014 12:07:05 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3C75uY062881; Mon, 3 Nov 2014 12:07:05 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201411031207.sA3C75uY062881@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 3 Nov 2014 12:07:05 +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: r274042 - stable/10/sys/boot/pc98/boot2 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 12:07:05 -0000 Author: nyan Date: Mon Nov 3 12:07:04 2014 New Revision: 274042 URL: https://svnweb.freebsd.org/changeset/base/274042 Log: MFC: r268474 and r268476 (by imp) - Merge the clang support from i386. - Compile boot2 with clang on pc98. MFC: r272250 (by nyan) - Reduce diffs against i386. Modified: stable/10/sys/boot/pc98/boot2/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot2/Makefile Mon Nov 3 11:58:32 2014 (r274041) +++ stable/10/sys/boot/pc98/boot2/Makefile Mon Nov 3 12:07:04 2014 (r274042) @@ -2,10 +2,6 @@ .include -# XXX: clang can compile the boot code just fine, but boot2 gets too big -CC:= gcc -COMPILER_TYPE:= gcc - FILES= boot boot1 boot2 NM?= nm @@ -24,10 +20,7 @@ BOOT2_UFS?= UFS1_AND_UFS2 #BOOT2_UFS?= UFS1_ONLY CFLAGS= -Os \ - -fno-guess-branch-probability \ -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ -mrtd \ -mregparm=3 \ -D${BOOT2_UFS} \ @@ -42,9 +35,13 @@ CFLAGS= -Os \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline \ + ${CLANG_OPT_SMALL} -CFLAGS.gcc+= --param max-inline-insns-single=100 +CFLAGS.gcc+= -fno-guess-branch-probability \ + -fno-unit-at-a-time \ + -mno-align-long-strings \ + --param max-inline-insns-single=100 # Set machine type to PC98_SYSTEM_PARAMETER #CFLAGS+= -DSET_MACHINE_TYPE @@ -110,3 +107,7 @@ boot2.h: boot1.out REL1=`printf "%d" ${REL1}` > ${.TARGET} .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot1.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 12:38:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CA97FB6; Mon, 3 Nov 2014 12:38:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2565AAA1; Mon, 3 Nov 2014 12:38:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3CcY93077325; Mon, 3 Nov 2014 12:38:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3CcThx077296; Mon, 3 Nov 2014 12:38:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031238.sA3CcThx077296@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 12:38:29 +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: r274043 - in stable/10/sys: dev/oce dev/vmware/vmxnet3 dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 12:38:34 -0000 Author: hselasky Date: Mon Nov 3 12:38:29 2014 New Revision: 274043 URL: https://svnweb.freebsd.org/changeset/base/274043 Log: MFC r271946 and r272595: Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/oce/oce_if.c stable/10/sys/dev/oce/oce_if.h stable/10/sys/dev/vmware/vmxnet3/if_vmx.c stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h stable/10/sys/dev/xen/netfront/netfront.c stable/10/sys/kern/uipc_sockbuf.c stable/10/sys/net/if.c stable/10/sys/net/if_lagg.c stable/10/sys/net/if_var.h stable/10/sys/net/if_vlan.c stable/10/sys/netinet/tcp_input.c stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet/tcp_var.h stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/sys/sockbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/oce/oce_if.c ============================================================================== --- stable/10/sys/dev/oce/oce_if.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/oce/oce_if.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1735,7 +1735,9 @@ oce_attach_ifp(POCE_SOFTC sc) if_initbaudrate(sc->ifp, IF_Gbps(10)); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: stable/10/sys/dev/oce/oce_if.h ============================================================================== --- stable/10/sys/dev/oce/oce_if.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/oce/oce_if.h Mon Nov 3 12:38:29 2014 (r274043) @@ -150,7 +150,6 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1720,7 +1720,9 @@ vmxnet3_setup_interface(struct vmxnet3_s ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_init = vmxnet3_init; ifp->if_ioctl = vmxnet3_ioctl; - ifp->if_hw_tsomax = VMXNET3_TSO_MAXSIZE; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = VMXNET3_TX_MAXSEGS; + ifp->if_hw_tsomaxsegsize = VMXNET3_TX_MAXSEGSIZE; #ifdef VMXNET3_LEGACY_TX ifp->if_start = vmxnet3_start; Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/vmware/vmxnet3/if_vmxvar.h Mon Nov 3 12:38:29 2014 (r274043) @@ -277,8 +277,6 @@ struct vmxnet3_softc { */ #define VMXNET3_TX_MAXSEGS 32 #define VMXNET3_TX_MAXSIZE (VMXNET3_TX_MAXSEGS * MCLBYTES) -#define VMXNET3_TSO_MAXSIZE \ - (VMXNET3_TX_MAXSIZE - sizeof(struct ether_vlan_header)) /* * Maximum support Tx segments size. The length field in the Modified: stable/10/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/10/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:29 2014 (r274043) @@ -134,7 +134,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2102,7 +2101,9 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = NF_TSO_MAXBURST; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/10/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/10/sys/kern/uipc_sockbuf.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1015,6 +1015,37 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf and the mbuf data offset for the provided + * send offset without changing the "sb_sndptroff" field. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + /* + * If the "off" is below the stored offset, which happens on + * retransmits, just use "sb_mb": + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + m = sb->sb_mb; + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + *moff = off; + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ Modified: stable/10/sys/net/if.c ============================================================================== --- stable/10/sys/net/if.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if.c Mon Nov 3 12:38:29 2014 (r274043) @@ -583,6 +583,57 @@ if_attach(struct ifnet *ifp) if_attach_internal(ifp, 0); } +/* + * Compute the least common TSO limit. + */ +void +if_hw_tsomax_common(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + /* + * 1) If there is no limit currently, take the limit from + * the network adapter. + * + * 2) If the network adapter has a limit below the current + * limit, apply it. + */ + if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 && + ifp->if_hw_tsomax < pmax->tsomaxbytes)) { + pmax->tsomaxbytes = ifp->if_hw_tsomax; + } + if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 && + ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) { + pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + } + if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 && + ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) { + pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; + } +} + +/* + * Update TSO limit of a network adapter. + * + * Returns zero if no change. Else non-zero. + */ +int +if_hw_tsomax_update(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + int retval = 0; + if (ifp->if_hw_tsomax != pmax->tsomaxbytes) { + ifp->if_hw_tsomax = pmax->tsomaxbytes; + retval++; + } + if (ifp->if_hw_tsomaxsegsize != pmax->tsomaxsegsize) { + ifp->if_hw_tsomaxsegsize = pmax->tsomaxsegsize; + retval++; + } + if (ifp->if_hw_tsomaxsegcount != pmax->tsomaxsegcount) { + ifp->if_hw_tsomaxsegcount = pmax->tsomaxsegcount; + retval++; + } + return (retval); +} + static void if_attach_internal(struct ifnet *ifp, int vmove) { @@ -657,13 +708,36 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_broadcastaddr = NULL; #if defined(INET) || defined(INET6) - /* Initialize to max value. */ - if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + /* Use defaults for TSO, if nothing is set */ + if (ifp->if_hw_tsomax == 0 && + ifp->if_hw_tsomaxsegcount == 0 && + ifp->if_hw_tsomaxsegsize == 0) { + /* + * The TSO defaults needs to be such that an + * NFS mbuf list of 35 mbufs totalling just + * below 64K works and that a chain of mbufs + * can be defragged into at most 32 segments: + */ + ifp->if_hw_tsomax = min(IP_MAXPACKET, (32 * MCLBYTES) - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); - KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && - ifp->if_hw_tsomax >= IP_MAXPACKET / 8, - ("%s: tsomax outside of range", __func__)); + ifp->if_hw_tsomaxsegcount = 35; + ifp->if_hw_tsomaxsegsize = 2048; /* 2K */ + + /* XXX some drivers set IFCAP_TSO after ethernet attach */ + if (ifp->if_capabilities & IFCAP_TSO) { + if_printf(ifp, "Using defaults for TSO: %u/%u/%u\n", + ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, + ifp->if_hw_tsomaxsegsize); + } + } + /* + * If the "if_hw_tsomax" limit is set, check if it is + * too small: + */ + KASSERT(ifp->if_hw_tsomax == 0 || + ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), + ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: stable/10/sys/net/if_lagg.c ============================================================================== --- stable/10/sys/net/if_lagg.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_lagg.c Mon Nov 3 12:38:29 2014 (r274043) @@ -448,23 +448,18 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; -#if defined(INET) || defined(INET6) - u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ -#else - u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ -#endif + struct ifnet_hw_tsomax hw_tsomax; LAGG_WLOCK_ASSERT(sc); + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + /* Get capabilities from the lagg ports */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; - /* Set to the minimum value of the lagg ports. */ - if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && - lp->lp_ifp->if_hw_tsomax > 0) - hw_tsomax = lp->lp_ifp->if_hw_tsomax; + if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -473,11 +468,10 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || sc->sc_ifp->if_hwassist != hwa || - sc->sc_ifp->if_hw_tsomax != hw_tsomax) { + if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax) != 0) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; - sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_var.h Mon Nov 3 12:38:29 2014 (r274043) @@ -116,6 +116,12 @@ struct ifqueue { struct mtx ifq_mtx; }; +struct ifnet_hw_tsomax { + u_int tsomaxbytes; /* TSO total burst length limit in bytes */ + u_int tsomaxsegcount; /* TSO maximum segment count */ + u_int tsomaxsegsize; /* TSO maximum segment size in bytes */ +}; + /* * Structure defining a network interface. * @@ -204,10 +210,11 @@ struct ifnet { u_int if_fib; /* interface FIB */ u_char if_alloctype; /* if_type at time of allocation */ - u_int if_hw_tsomax; /* tso burst length limit, the minimum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ + u_int if_hw_tsomax; /* TSO total burst length + * limit in bytes. A value of + * zero means no limit. Have + * to find a better place for + * it eventually. */ /* * Spare fields are added so that we can modify sensitive data @@ -215,7 +222,14 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - int if_ispare[4]; + int if_ispare[2]; + + /* + * TSO fields for segment limits. If a field is zero below, + * there is no limit: + */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; @@ -967,6 +981,10 @@ int ether_poll_register(poll_handler_ int ether_poll_deregister(struct ifnet *ifp); #endif /* DEVICE_POLLING */ +/* TSO */ +void if_hw_tsomax_common(struct ifnet *, struct ifnet_hw_tsomax *); +int if_hw_tsomax_update(struct ifnet *, struct ifnet_hw_tsomax *); + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: stable/10/sys/net/if_vlan.c ============================================================================== --- stable/10/sys/net/if_vlan.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/net/if_vlan.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1483,6 +1483,7 @@ vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p = PARENT(ifv); struct ifnet *ifp = ifv->ifv_ifp; + struct ifnet_hw_tsomax hw_tsomax; TRUNK_LOCK_ASSERT(TRUNK(ifv)); @@ -1509,8 +1510,9 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ - if (p->if_hw_tsomax > 0) - ifp->if_hw_tsomax = p->if_hw_tsomax; + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + if_hw_tsomax_common(p, &hw_tsomax); + if_hw_tsomax_update(ifp, &hw_tsomax); if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { Modified: stable/10/sys/netinet/tcp_input.c ============================================================================== --- stable/10/sys/netinet/tcp_input.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_input.c Mon Nov 3 12:38:29 2014 (r274043) @@ -3623,6 +3623,8 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegcount = cap.tsomaxsegcount; + tp->t_tsomaxsegsize = cap.tsomaxsegsize; } } Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_output.c Mon Nov 3 12:38:29 2014 (r274043) @@ -774,28 +774,112 @@ send: flags &= ~TH_FIN; if (tso) { + u_int if_hw_tsomax; + u_int if_hw_tsomaxsegcount; + u_int if_hw_tsomaxsegsize; + struct mbuf *mb; + u_int moff; + int max_len; + + /* extract TSO information */ + if_hw_tsomax = tp->t_tsomax; + if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; + if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; + + /* + * Limit a TSO burst to prevent it from + * overflowing or exceeding the maximum length + * allowed by the network interface: + */ KASSERT(ipoptlen == 0, ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to t_tsomax minus IP, - * TCP and options length to keep ip->ip_len - * from overflowing or exceeding the maximum - * length allowed by the network interface. + * Check if we should limit by maximum payload + * length: */ - if (len > tp->t_tsomax - hdrlen) { - len = tp->t_tsomax - hdrlen; - sendalot = 1; + if (if_hw_tsomax != 0) { + /* compute maximum TSO length */ + max_len = (if_hw_tsomax - hdrlen); + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } + } + + /* + * Check if we should limit by maximum segment + * size and count: + */ + if (if_hw_tsomaxsegcount != 0 && + if_hw_tsomaxsegsize != 0) { + max_len = 0; + mb = sbsndmbuf(&so->so_snd, off, &moff); + + while (mb != NULL && (u_int)max_len < len) { + u_int mlen; + u_int frags; + + /* + * Get length of mbuf fragment + * and how many hardware frags, + * rounded up, it would use: + */ + mlen = (mb->m_len - moff); + frags = howmany(mlen, + if_hw_tsomaxsegsize); + + /* Handle special case: Zero Length Mbuf */ + if (frags == 0) + frags = 1; + + /* + * Check if the fragment limit + * will be reached or exceeded: + */ + if (frags >= if_hw_tsomaxsegcount) { + max_len += min(mlen, + if_hw_tsomaxsegcount * + if_hw_tsomaxsegsize); + break; + } + max_len += mlen; + if_hw_tsomaxsegcount -= frags; + moff = 0; + mb = mb->m_next; + } + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } } /* * Prevent the last segment from being - * fractional unless the send sockbuf can - * be emptied. + * fractional unless the send sockbuf can be + * emptied: + */ + max_len = (tp->t_maxopd - optlen); + if ((off + len) < so->so_snd.sb_cc) { + moff = len % (u_int)max_len; + if (moff != 0) { + len -= moff; + sendalot = 1; + } + } + + /* + * In case there are too many small fragments + * don't use TSO: */ - if (sendalot && off + len < so->so_snd.sb_cc) { - len -= len % (tp->t_maxopd - optlen); + if (len <= (u_int)max_len) { + len = (u_int)max_len; sendalot = 1; + tso = 0; } /* Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_subr.c Mon Nov 3 12:38:29 2014 (r274043) @@ -1808,6 +1808,8 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro.ro_rt); @@ -1847,6 +1849,8 @@ tcp_maxmtu6(struct in_conninfo *inc, str ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro6.ro_rt); Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/netinet/tcp_var.h Mon Nov 3 12:38:29 2014 (r274043) @@ -208,13 +208,15 @@ struct tcpcb { u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - u_int t_tsomax; /* tso burst length limit */ + u_int t_tsomax; /* TSO total burst length limit in bytes */ u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ u_int t_flags2; /* More tcpcb flags storage */ uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ - uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ + uint64_t _pad[5]; /* 5 TBD (1-2 CC/RTT?) */ + uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ + uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ }; /* @@ -342,6 +344,8 @@ struct hc_metrics_lite { /* must stay in struct tcp_ifcap { int ifcap; u_int tsomax; + u_int tsomaxsegcount; + u_int tsomaxsegsize; }; #ifndef _NETINET_IN_PCB_H_ Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:29 2014 (r274043) @@ -2106,12 +2106,12 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if 0 + /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); dev->if_hw_tsomaxsegcount = 16; dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ -#endif + dev->if_capenable = dev->if_capabilities; dev->if_hwassist = 0; Modified: stable/10/sys/sys/sockbuf.h ============================================================================== --- stable/10/sys/sys/sockbuf.h Mon Nov 3 12:07:04 2014 (r274042) +++ stable/10/sys/sys/sockbuf.h Mon Nov 3 12:38:29 2014 (r274043) @@ -158,6 +158,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 12:38:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C5EB167; Mon, 3 Nov 2014 12:38:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6483FAA2; Mon, 3 Nov 2014 12:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3CckPL077400; Mon, 3 Nov 2014 12:38:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Ccgc9077380; Mon, 3 Nov 2014 12:38:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031238.sA3Ccgc9077380@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 12:38:42 +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: r274044 - in stable/9/sys: dev/oce dev/xen/netfront kern net netinet ofed/drivers/net/mlx4 sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 12:38:46 -0000 Author: hselasky Date: Mon Nov 3 12:38:41 2014 New Revision: 274044 URL: https://svnweb.freebsd.org/changeset/base/274044 Log: MFC r271946 and r272595: Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies Modified: stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/kern/uipc_sockbuf.c stable/9/sys/net/if.c stable/9/sys/net/if_lagg.c stable/9/sys/net/if_var.h stable/9/sys/net/if_vlan.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_var.h stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/sys/sockbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/oce/oce_if.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1734,7 +1734,9 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_baudrate = IF_Gbps(10UL); #if __FreeBSD_version >= 1000000 - sc->ifp->if_hw_tsomax = OCE_MAX_TSO_SIZE; + sc->ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + sc->ifp->if_hw_tsomaxsegcount = OCE_MAX_TX_ELEMENTS; + sc->ifp->if_hw_tsomaxsegsize = 4096; #endif ether_ifattach(sc->ifp, sc->macaddr.mac_addr); Modified: stable/9/sys/dev/oce/oce_if.h ============================================================================== --- stable/9/sys/dev/oce/oce_if.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/oce/oce_if.h Mon Nov 3 12:38:41 2014 (r274044) @@ -150,7 +150,6 @@ extern int mp_ncpus; /* system's total #define OCE_MAX_TX_ELEMENTS 29 #define OCE_MAX_TX_DESC 1024 #define OCE_MAX_TX_SIZE 65535 -#define OCE_MAX_TSO_SIZE (65535 - ETHER_HDR_LEN) #define OCE_MAX_RX_SIZE 4096 #define OCE_MAX_RQ_POSTS 255 #define OCE_DEFAULT_PROMISCUOUS 0 Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/dev/xen/netfront/netfront.c Mon Nov 3 12:38:41 2014 (r274044) @@ -135,7 +135,6 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) -#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2103,7 +2102,9 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hw_tsomax = NF_TSO_MAXBURST; + ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/9/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/9/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/kern/uipc_sockbuf.c Mon Nov 3 12:38:41 2014 (r274044) @@ -989,6 +989,37 @@ sbsndptr(struct sockbuf *sb, u_int off, } /* + * Return the first mbuf and the mbuf data offset for the provided + * send offset without changing the "sb_sndptroff" field. + */ +struct mbuf * +sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff) +{ + struct mbuf *m; + + KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); + + /* + * If the "off" is below the stored offset, which happens on + * retransmits, just use "sb_mb": + */ + if (sb->sb_sndptr == NULL || sb->sb_sndptroff > off) { + m = sb->sb_mb; + } else { + m = sb->sb_sndptr; + off -= sb->sb_sndptroff; + } + while (off > 0 && m != NULL) { + if (off < m->m_len) + break; + off -= m->m_len; + m = m->m_next; + } + *moff = off; + return (m); +} + +/* * Drop a record off the front of a sockbuf and move the next record to the * front. */ Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if.c Mon Nov 3 12:38:41 2014 (r274044) @@ -599,6 +599,57 @@ if_attach(struct ifnet *ifp) if_attach_internal(ifp, 0); } +/* + * Compute the least common TSO limit. + */ +void +if_hw_tsomax_common(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + /* + * 1) If there is no limit currently, take the limit from + * the network adapter. + * + * 2) If the network adapter has a limit below the current + * limit, apply it. + */ + if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 && + ifp->if_hw_tsomax < pmax->tsomaxbytes)) { + pmax->tsomaxbytes = ifp->if_hw_tsomax; + } + if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 && + ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) { + pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + } + if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 && + ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) { + pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; + } +} + +/* + * Update TSO limit of a network adapter. + * + * Returns zero if no change. Else non-zero. + */ +int +if_hw_tsomax_update(struct ifnet *ifp, struct ifnet_hw_tsomax *pmax) +{ + int retval = 0; + if (ifp->if_hw_tsomax != pmax->tsomaxbytes) { + ifp->if_hw_tsomax = pmax->tsomaxbytes; + retval++; + } + if (ifp->if_hw_tsomaxsegsize != pmax->tsomaxsegsize) { + ifp->if_hw_tsomaxsegsize = pmax->tsomaxsegsize; + retval++; + } + if (ifp->if_hw_tsomaxsegcount != pmax->tsomaxsegcount) { + ifp->if_hw_tsomaxsegcount = pmax->tsomaxsegcount; + retval++; + } + return (retval); +} + static void if_attach_internal(struct ifnet *ifp, int vmove) { @@ -673,13 +724,36 @@ if_attach_internal(struct ifnet *ifp, in ifp->if_broadcastaddr = NULL; #if defined(INET) || defined(INET6) - /* Initialize to max value. */ - if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + /* Use defaults for TSO, if nothing is set */ + if (ifp->if_hw_tsomax == 0 && + ifp->if_hw_tsomaxsegcount == 0 && + ifp->if_hw_tsomaxsegsize == 0) { + /* + * The TSO defaults needs to be such that an + * NFS mbuf list of 35 mbufs totalling just + * below 64K works and that a chain of mbufs + * can be defragged into at most 32 segments: + */ + ifp->if_hw_tsomax = min(IP_MAXPACKET, (32 * MCLBYTES) - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); - KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && - ifp->if_hw_tsomax >= IP_MAXPACKET / 8, - ("%s: tsomax outside of range", __func__)); + ifp->if_hw_tsomaxsegcount = 35; + ifp->if_hw_tsomaxsegsize = 2048; /* 2K */ + + /* XXX some drivers set IFCAP_TSO after ethernet attach */ + if (ifp->if_capabilities & IFCAP_TSO) { + if_printf(ifp, "Using defaults for TSO: %u/%u/%u\n", + ifp->if_hw_tsomax, + ifp->if_hw_tsomaxsegcount, + ifp->if_hw_tsomaxsegsize); + } + } + /* + * If the "if_hw_tsomax" limit is set, check if it is + * too small: + */ + KASSERT(ifp->if_hw_tsomax == 0 || + ifp->if_hw_tsomax >= (IP_MAXPACKET / 8), + ("%s: if_hw_tsomax is outside of range", __func__)); #endif } #ifdef VIMAGE Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_lagg.c Mon Nov 3 12:38:41 2014 (r274044) @@ -406,23 +406,18 @@ lagg_capabilities(struct lagg_softc *sc) struct lagg_port *lp; int cap = ~0, ena = ~0; u_long hwa = ~0UL; -#if defined(INET) || defined(INET6) - u_int hw_tsomax = IP_MAXPACKET; /* Initialize to the maximum value. */ -#else - u_int hw_tsomax = ~0; /* if_hw_tsomax is only for INET/INET6, but.. */ -#endif + struct ifnet_hw_tsomax hw_tsomax; LAGG_WLOCK_ASSERT(sc); + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + /* Get capabilities from the lagg ports */ SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; ena &= lp->lp_ifp->if_capenable; hwa &= lp->lp_ifp->if_hwassist; - /* Set to the minimum value of the lagg ports. */ - if (lp->lp_ifp->if_hw_tsomax < hw_tsomax && - lp->lp_ifp->if_hw_tsomax > 0) - hw_tsomax = lp->lp_ifp->if_hw_tsomax; + if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); } cap = (cap == ~0 ? 0 : cap); ena = (ena == ~0 ? 0 : ena); @@ -431,11 +426,10 @@ lagg_capabilities(struct lagg_softc *sc) if (sc->sc_ifp->if_capabilities != cap || sc->sc_ifp->if_capenable != ena || sc->sc_ifp->if_hwassist != hwa || - sc->sc_ifp->if_hw_tsomax != hw_tsomax) { + if_hw_tsomax_update(sc->sc_ifp, &hw_tsomax) != 0) { sc->sc_ifp->if_capabilities = cap; sc->sc_ifp->if_capenable = ena; sc->sc_ifp->if_hwassist = hwa; - sc->sc_ifp->if_hw_tsomax = hw_tsomax; getmicrotime(&sc->sc_ifp->if_lastchange); if (sc->sc_ifflags & IFF_DEBUG) Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_var.h Mon Nov 3 12:38:41 2014 (r274044) @@ -111,6 +111,12 @@ struct ifqueue { struct mtx ifq_mtx; }; +struct ifnet_hw_tsomax { + u_int tsomaxbytes; /* TSO total burst length limit in bytes */ + u_int tsomaxsegcount; /* TSO maximum segment count */ + u_int tsomaxsegsize; /* TSO maximum segment size in bytes */ +}; + /* * Structure defining a network interface. * @@ -205,11 +211,18 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - u_int if_hw_tsomax; /* tso burst length limit, the minmum - * is (IP_MAXPACKET / 8). - * XXXAO: Have to find a better place - * for it eventually. */ - int if_ispare[3]; + u_int if_hw_tsomax; /* TSO total burst length + * limit in bytes. A value of + * zero means no limit. Have + * to find a better place for + * it eventually. */ + int if_ispare[1]; + /* + * TSO fields for segment limits. If a field is zero below, + * there is no limit: + */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; @@ -966,6 +979,10 @@ int ether_poll_register(poll_handler_ int ether_poll_deregister(struct ifnet *ifp); #endif /* DEVICE_POLLING */ +/* TSO */ +void if_hw_tsomax_common(struct ifnet *, struct ifnet_hw_tsomax *); +int if_hw_tsomax_update(struct ifnet *, struct ifnet_hw_tsomax *); + #endif /* _KERNEL */ #endif /* !_NET_IF_VAR_H_ */ Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/net/if_vlan.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1475,6 +1475,7 @@ vlan_capabilities(struct ifvlan *ifv) { struct ifnet *p = PARENT(ifv); struct ifnet *ifp = ifv->ifv_ifp; + struct ifnet_hw_tsomax hw_tsomax; TRUNK_LOCK_ASSERT(TRUNK(ifv)); @@ -1501,8 +1502,9 @@ vlan_capabilities(struct ifvlan *ifv) * propagate the hardware-assisted flag. TSO on VLANs * does not necessarily require hardware VLAN tagging. */ - if (p->if_hw_tsomax > 0) - ifp->if_hw_tsomax = p->if_hw_tsomax; + memset(&hw_tsomax, 0, sizeof(hw_tsomax)); + if_hw_tsomax_common(p, &hw_tsomax); + if_hw_tsomax_update(ifp, &hw_tsomax); if (p->if_capabilities & IFCAP_VLAN_HWTSO) ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; if (p->if_capenable & IFCAP_VLAN_HWTSO) { Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_input.c Mon Nov 3 12:38:41 2014 (r274044) @@ -3628,6 +3628,8 @@ tcp_mss(struct tcpcb *tp, int offer) if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; tp->t_tsomax = cap.tsomax; + tp->t_tsomaxsegcount = cap.tsomaxsegcount; + tp->t_tsomaxsegsize = cap.tsomaxsegsize; } } Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_output.c Mon Nov 3 12:38:41 2014 (r274044) @@ -765,28 +765,112 @@ send: flags &= ~TH_FIN; if (tso) { + u_int if_hw_tsomax; + u_int if_hw_tsomaxsegcount; + u_int if_hw_tsomaxsegsize; + struct mbuf *mb; + u_int moff; + int max_len; + + /* extract TSO information */ + if_hw_tsomax = tp->t_tsomax; + if_hw_tsomaxsegcount = tp->t_tsomaxsegcount; + if_hw_tsomaxsegsize = tp->t_tsomaxsegsize; + + /* + * Limit a TSO burst to prevent it from + * overflowing or exceeding the maximum length + * allowed by the network interface: + */ KASSERT(ipoptlen == 0, ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to t_tsomax minus IP, - * TCP and options length to keep ip->ip_len - * from overflowing or exceeding the maximum - * length allowed by the network interface. + * Check if we should limit by maximum payload + * length: */ - if (len > tp->t_tsomax - hdrlen) { - len = tp->t_tsomax - hdrlen; - sendalot = 1; + if (if_hw_tsomax != 0) { + /* compute maximum TSO length */ + max_len = (if_hw_tsomax - hdrlen); + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } + } + + /* + * Check if we should limit by maximum segment + * size and count: + */ + if (if_hw_tsomaxsegcount != 0 && + if_hw_tsomaxsegsize != 0) { + max_len = 0; + mb = sbsndmbuf(&so->so_snd, off, &moff); + + while (mb != NULL && (u_int)max_len < len) { + u_int mlen; + u_int frags; + + /* + * Get length of mbuf fragment + * and how many hardware frags, + * rounded up, it would use: + */ + mlen = (mb->m_len - moff); + frags = howmany(mlen, + if_hw_tsomaxsegsize); + + /* Handle special case: Zero Length Mbuf */ + if (frags == 0) + frags = 1; + + /* + * Check if the fragment limit + * will be reached or exceeded: + */ + if (frags >= if_hw_tsomaxsegcount) { + max_len += min(mlen, + if_hw_tsomaxsegcount * + if_hw_tsomaxsegsize); + break; + } + max_len += mlen; + if_hw_tsomaxsegcount -= frags; + moff = 0; + mb = mb->m_next; + } + if (max_len <= 0) { + len = 0; + } else if (len > (u_int)max_len) { + sendalot = 1; + len = (u_int)max_len; + } } /* * Prevent the last segment from being - * fractional unless the send sockbuf can - * be emptied. + * fractional unless the send sockbuf can be + * emptied: + */ + max_len = (tp->t_maxopd - optlen); + if ((off + len) < so->so_snd.sb_cc) { + moff = len % (u_int)max_len; + if (moff != 0) { + len -= moff; + sendalot = 1; + } + } + + /* + * In case there are too many small fragments + * don't use TSO: */ - if (sendalot && off + len < so->so_snd.sb_cc) { - len -= len % (tp->t_maxopd - optlen); + if (len <= (u_int)max_len) { + len = (u_int)max_len; sendalot = 1; + tso = 0; } /* Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_subr.c Mon Nov 3 12:38:41 2014 (r274044) @@ -1744,6 +1744,8 @@ tcp_maxmtu(struct in_conninfo *inc, stru ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro.ro_rt); @@ -1783,6 +1785,8 @@ tcp_maxmtu6(struct in_conninfo *inc, str ifp->if_hwassist & CSUM_TSO) { cap->ifcap |= CSUM_TSO; cap->tsomax = ifp->if_hw_tsomax; + cap->tsomaxsegcount = ifp->if_hw_tsomaxsegcount; + cap->tsomaxsegsize = ifp->if_hw_tsomaxsegsize; } } RTFREE(sro6.ro_rt); Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/netinet/tcp_var.h Mon Nov 3 12:38:41 2014 (r274044) @@ -212,7 +212,9 @@ struct tcpcb { uint32_t t_ispare[7]; /* 5 UTO, 2 TBD */ void *t_pspare2[4]; /* 4 TBD */ - uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ + uint64_t _pad[5]; /* 5 TBD (1-2 CC/RTT?) */ + uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ + uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ }; /* @@ -333,6 +335,8 @@ struct hc_metrics_lite { /* must stay in struct tcp_ifcap { int ifcap; u_int tsomax; + u_int tsomaxsegcount; + u_int tsomaxsegsize; }; #ifndef _NETINET_IN_PCB_H_ Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Mon Nov 3 12:38:41 2014 (r274044) @@ -2106,12 +2106,12 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if 0 + /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); dev->if_hw_tsomaxsegcount = 16; dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ -#endif + dev->if_capenable = dev->if_capabilities; dev->if_hwassist = 0; Modified: stable/9/sys/sys/sockbuf.h ============================================================================== --- stable/9/sys/sys/sockbuf.h Mon Nov 3 12:38:29 2014 (r274043) +++ stable/9/sys/sys/sockbuf.h Mon Nov 3 12:38:41 2014 (r274044) @@ -155,6 +155,8 @@ int sbreserve_locked(struct sockbuf *sb, struct thread *td); struct mbuf * sbsndptr(struct sockbuf *sb, u_int off, u_int len, u_int *moff); +struct mbuf * + sbsndmbuf(struct sockbuf *sb, u_int off, u_int *moff); void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb); int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 12:55:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D7C8515; Mon, 3 Nov 2014 12:55:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5960AC8D; Mon, 3 Nov 2014 12:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3CtWSJ086507; Mon, 3 Nov 2014 12:55:32 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3CtWj0086506; Mon, 3 Nov 2014 12:55:32 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201411031255.sA3CtWj0086506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Mon, 3 Nov 2014 12:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274045 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 12:55:32 -0000 Author: tychon Date: Mon Nov 3 12:55:31 2014 New Revision: 274045 URL: https://svnweb.freebsd.org/changeset/base/274045 Log: If the start bit, PxCMD.ST, is cleared and nothing is in-flight then PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0. Reviewed by: grehan Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon Nov 3 12:38:41 2014 (r274044) +++ head/usr.sbin/bhyve/pci_ahci.c Mon Nov 3 12:55:31 2014 (r274045) @@ -367,11 +367,15 @@ ahci_check_stopped(struct ahci_port *p) { /* * If we are no longer processing the command list and nothing - * is in-flight, clear the running bit. + * is in-flight, clear the running bit, the current command + * slot, the command issue and active bits. */ if (!(p->cmd & AHCI_P_CMD_ST)) { - if (p->pending == 0) + if (p->pending == 0) { p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); + p->ci = 0; + p->sact = 0; + } } } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 13:01:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 631A36FD; Mon, 3 Nov 2014 13:01:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48737D6A; Mon, 3 Nov 2014 13:01:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3D1xjZ090812; Mon, 3 Nov 2014 13:01:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3D1wYV090809; Mon, 3 Nov 2014 13:01:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031301.sA3D1wYV090809@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 13:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274046 - in head/sys: netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 13:01:59 -0000 Author: hselasky Date: Mon Nov 3 13:01:58 2014 New Revision: 274046 URL: https://svnweb.freebsd.org/changeset/base/274046 Log: Restore spares used in "struct tcpcb" and bump "__FreeBSD_version" to indicate need for kernel module re-compilation. Sponsored by: Mellanox Technologies Modified: head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Nov 3 12:55:31 2014 (r274045) +++ head/sys/netinet/tcp_var.h Mon Nov 3 13:01:58 2014 (r274046) @@ -200,13 +200,12 @@ struct tcpcb { u_int t_keepcnt; /* number of keepalives before close */ u_int t_tsomax; /* TSO total burst length limit in bytes */ + u_int t_tsomaxsegcount; /* TSO maximum segment count */ + u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ u_int t_flags2; /* More tcpcb flags storage */ - uint32_t t_ispare[6]; /* 5 UTO, 1 TBD */ - uint32_t t_tsomaxsegcount; /* TSO maximum segment count */ - uint32_t t_tsomaxsegsize; /* TSO maximum segment size in bytes */ - + uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 3 12:55:31 2014 (r274045) +++ head/sys/sys/param.h Mon Nov 3 13:01:58 2014 (r274046) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100041 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100042 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 13:02:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6454686A; Mon, 3 Nov 2014 13:02:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50572D82; Mon, 3 Nov 2014 13:02:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3D2xK3090985; Mon, 3 Nov 2014 13:02:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3D2xbA090984; Mon, 3 Nov 2014 13:02:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411031302.sA3D2xbA090984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Nov 2014 13:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274047 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 13:02:59 -0000 Author: hselasky Date: Mon Nov 3 13:02:58 2014 New Revision: 274047 URL: https://svnweb.freebsd.org/changeset/base/274047 Log: Clarify TSO segment limit comment and remove two TABs to make lines a bit shorter. Sponsored by: Mellanox Technologies Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Nov 3 13:01:58 2014 (r274046) +++ head/sys/net/if_var.h Mon Nov 3 13:02:58 2014 (r274047) @@ -238,9 +238,12 @@ struct ifnet { * to find a better place for * it eventually. */ - /* TSO fields for segment limits. If a field is zero below, there is no limit. */ - u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ - u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ + /* + * TSO fields for segment limits. If a field below is zero, + * there is no TSO segment limit. + */ + u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ + u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ /* * Spare fields to be added before branching a stable branch, so From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 13:14:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2359FD3D; Mon, 3 Nov 2014 13:14:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C6AEC0; Mon, 3 Nov 2014 13:14:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3DEY0c096437; Mon, 3 Nov 2014 13:14:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3DEYX7096436; Mon, 3 Nov 2014 13:14:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411031314.sA3DEYX7096436@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 3 Nov 2014 13:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274048 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 13:14:35 -0000 Author: mjg Date: Mon Nov 3 13:14:34 2014 New Revision: 274048 URL: https://svnweb.freebsd.org/changeset/base/274048 Log: Fix misplaced read memory barrier in seq. Impact on capability races was small: it was possible to get a spurious ENOTCAPABLE (early return), but it was not possible to bypass checks. Tidy up some comments. Modified: head/sys/sys/seq.h Modified: head/sys/sys/seq.h ============================================================================== --- head/sys/sys/seq.h Mon Nov 3 13:02:58 2014 (r274047) +++ head/sys/sys/seq.h Mon Nov 3 13:14:34 2014 (r274048) @@ -70,16 +70,16 @@ typedef uint32_t seq_t; #include /* - * This is a temporary hack until memory barriers are cleaned up. + * Stuff below is going away when we gain suitable memory barriers. * * atomic_load_acq_int at least on amd64 provides a full memory barrier, - * in a way which affects perforance. + * in a way which affects performance. * * Hack below covers all architectures and avoids most of the penalty at least - * on amd64. + * on amd64 but still has unnecessary cost. */ static __inline int -atomic_load_acq_rmb_int(volatile u_int *p) +atomic_load_rmb_int(volatile u_int *p) { volatile u_int v; @@ -88,6 +88,16 @@ atomic_load_acq_rmb_int(volatile u_int * return (v); } +static __inline int +atomic_rmb_load_int(volatile u_int *p) +{ + volatile u_int v = 0; + + atomic_load_acq_int(&v); + v = *p; + return (v); +} + static __inline bool seq_in_modify(seq_t seqp) { @@ -117,7 +127,7 @@ seq_read(seq_t *seqp) seq_t ret; for (;;) { - ret = atomic_load_acq_rmb_int(seqp); + ret = atomic_load_rmb_int(seqp); if (seq_in_modify(ret)) { cpu_spinwait(); continue; @@ -132,7 +142,7 @@ static __inline seq_t seq_consistent(seq_t *seqp, seq_t oldseq) { - return (atomic_load_acq_rmb_int(seqp) == oldseq); + return (atomic_rmb_load_int(seqp) == oldseq); } static __inline seq_t From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:35:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AF6BA81; Mon, 3 Nov 2014 14:35:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76A32973; Mon, 3 Nov 2014 14:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3EZ8LE034063; Mon, 3 Nov 2014 14:35:08 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3EZ8kW034062; Mon, 3 Nov 2014 14:35:08 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411031435.sA3EZ8kW034062@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 3 Nov 2014 14:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274049 - head/sys/dev/drm2 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 14:35:08 -0000 Author: dumbbell Date: Mon Nov 3 14:35:07 2014 New Revision: 274049 URL: https://svnweb.freebsd.org/changeset/base/274049 Log: drm: When reading connector mode tunables, list connectors ... and their associated tunables. This gives a way to know the list of available connectors, no matter the driver. The problem is that xrandr(1) can list connectors but it uses a different naming. MFC after: 1 week Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Mon Nov 3 13:14:34 2014 (r274048) +++ head/sys/dev/drm2/drm_fb_helper.c Mon Nov 3 14:35:07 2014 (r274049) @@ -118,6 +118,9 @@ fb_get_options(const char *connector_nam */ snprintf(tunable, sizeof(tunable), "kern.vt.fb.modes.%s", connector_name); + DRM_INFO("Connector %s: get mode from tunables:\n", connector_name); + DRM_INFO(" - %s\n", tunable); + DRM_INFO(" - kern.vt.fb.default_mode\n"); *option = kern_getenv(tunable); if (*option == NULL) *option = kern_getenv("kern.vt.fb.default_mode"); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 14:57:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77D8DF7F; Mon, 3 Nov 2014 14:57:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58A1DB91; Mon, 3 Nov 2014 14:57:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Evgll044005; Mon, 3 Nov 2014 14:57:42 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3EvgCJ044004; Mon, 3 Nov 2014 14:57:42 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411031457.sA3EvgCJ044004@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 3 Nov 2014 14:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274050 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 14:57:42 -0000 Author: dumbbell Date: Mon Nov 3 14:57:41 2014 New Revision: 274050 URL: https://svnweb.freebsd.org/changeset/base/274050 Log: vt(4): Document kern.vt.fb.default_mode and kern.vt.fb.modes.* Those tunables are used to set a specific mode in vt(4) instead of using the default mode. Differential Revision: https://reviews.freebsd.org/D1098 Reviewed by: ak@, emaste@, kwm@ MFC after: 1 week Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Mon Nov 3 14:35:07 2014 (r274049) +++ head/share/man/man4/vt.4 Mon Nov 3 14:57:41 2014 (r274050) @@ -45,6 +45,8 @@ In .Xr loader.conf 5 : .Cd hw.vga.textmode=1 .Cd kern.vty=vt +.Cd kern.vt.fb.default_mode="x" +.Cd kern.vt.fb.modes.="x" .Pp In .Xr loader.conf 5 or @@ -176,7 +178,7 @@ Otherwise, switches to 640x480x16 VGA mode using .Cm vt_vga . If a KMS -.Pq Kernel Mode Switching +.Pq Kernel Mode Setting video driver is available, the display is switched to high resolution and the KMS driver takes over. When a KMS driver is not available, @@ -203,6 +205,28 @@ By default, is used on computers that boot from BIOS, and .Nm is used on computers that boot from UEFI. +.It Va kern.vt.fb.default_mode +Set this value to a graphic mode to override the default mode picked by the +.Nm +backend. The mode is applied to all output connectors. This is currently +only supported by the +.Cm vt_fb +backend when it's paired with a KMS video driver. +.It Va kern.vt.fb.modes. Ns Pa connector_name +Set this value to a graphic mode to override the default mode picked by the +.Nm +backend. This mode is applied to the output connector +.Pa connector_name +only. It has precedence over +.Va kern.vt.fb.default_mode . +To know the list of available connectors, load the KMS driver and look +at +.Xr dmesg 8 : +it'll contain a list of connectors and their associated tunables. This +is currently only supported by the +.Cm vt_fb +backend when it's paired with a KMS video driver. +.El .Sh KEYBOARD SYSCTL TUNABLES These settings control whether certain special key combinations are enabled or ignored. @@ -255,6 +279,22 @@ This line changes the default color of k on a black background, or black on a bright red background when reversed. .Pp .Dl "options TERMINAL_KERN_ATTR=(FG_LIGHTRED|BG_BLACK)" +.Pp +To set a 1024x768 mode on all output connectors, put the following line in +.Pa /boot/loader.conf : +.Pp +.Dl kern.vt.fb.default_mode="1024x768" +.Pp +To set a 800x600 only on a laptop builtin screen, use the following line instead: +.Pp +.Dl kern.vt.fb.modes.LVDS-1="800x600" +.Pp +The connector name was found in +.Xr dmesg 8 : +.Pp +.Dl info: [drm] Connector LVDS-1: get mode from tunables: +.Dl info: [drm] - kern.vt.fb.modes.LVDS-1 +.Dl info: [drm] - kern.vt.fb.default_mode .Sh SEE ALSO .Xr kbdcontrol 1 , .Xr login 1 , From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 15:25:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86A1A6C2; Mon, 3 Nov 2014 15:25:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7221CE6A; Mon, 3 Nov 2014 15:25:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3FPnJP058069; Mon, 3 Nov 2014 15:25:49 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3FPnUQ058068; Mon, 3 Nov 2014 15:25:49 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411031525.sA3FPnUQ058068@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 3 Nov 2014 15:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274051 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 15:25:49 -0000 Author: dumbbell Date: Mon Nov 3 15:25:48 2014 New Revision: 274051 URL: https://svnweb.freebsd.org/changeset/base/274051 Log: vt(4): Improve the description of kern.vt.fb.modes.$connector Differential Revision: https://reviews.freebsd.org/D1098 Submitted by: emaste@ MFC after: 1 week Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Mon Nov 3 14:57:41 2014 (r274050) +++ head/share/man/man4/vt.4 Mon Nov 3 15:25:48 2014 (r274051) @@ -219,11 +219,10 @@ backend. This mode is applied to the out .Pa connector_name only. It has precedence over .Va kern.vt.fb.default_mode . -To know the list of available connectors, load the KMS driver and look -at -.Xr dmesg 8 : -it'll contain a list of connectors and their associated tunables. This -is currently only supported by the +The names of available connector names can be found in +.Xr dmesg 8 +after loading the KMS driver. It will contain a list of connectors and +their associated tunables. This is currently only supported by the .Cm vt_fb backend when it's paired with a KMS video driver. .El From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 15:40:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 512A1972; Mon, 3 Nov 2014 15:40:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2563C77; Mon, 3 Nov 2014 15:40:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Feo4v063851; Mon, 3 Nov 2014 15:40:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3FeoQ9063850; Mon, 3 Nov 2014 15:40:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411031540.sA3FeoQ9063850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 15:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274052 - head/tests/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 15:40:50 -0000 Author: ngie Date: Mon Nov 3 15:40:49 2014 New Revision: 274052 URL: https://svnweb.freebsd.org/changeset/base/274052 Log: Remove unused tests/lib directory MFC after: 1 week Deleted: head/tests/lib/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 15:59:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B572ACAA; Mon, 3 Nov 2014 15:59:21 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 6E2101DE; Mon, 3 Nov 2014 15:59:21 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id F3687D67143; Tue, 4 Nov 2014 02:59:17 +1100 (AEDT) Date: Tue, 4 Nov 2014 02:59:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r273958 - head/sys/dev/random In-Reply-To: <20141103091954.GJ53947@kib.kiev.ua> Message-ID: <20141104024151.M1038@besplex.bde.org> References: <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <20141103113629.I3149@besplex.bde.org> <20141103091954.GJ53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=LppoKKA_doCjU4PeTzIA:9 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , d@delphij.net, Bruce Evans , Ian Lepore , "svn-src-all@freebsd.org" , Mark R V Murray , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 15:59:21 -0000 On Mon, 3 Nov 2014, Konstantin Belousov wrote: > On Mon, Nov 03, 2014 at 11:53:26AM +1100, Bruce Evans wrote: >> On Sun, 2 Nov 2014, Ian Lepore wrote: >> >>> On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA512 >>>> >>>> Hi, Mark, >>>> >>>> I'd like to propose the attached patch for review. It replaces >>>> tsleep's with sx_sleep's, then checks the return value and quit the loop. >>> >>> It still doesn't handle the partial read/write case Kostik mentioned, >>> but there are plenty of other drivers that don't get that right. >> >> Returning an error for a partial read is good enough for random devices, >> since there is no problem with discarding the input. Upper layers are >> still broken, so this (discarding the input is what happens automatically >> except for ERESTART, EINTR and EWOULDBLOCK. > But usermode buffer is already partially accessed and modified. > Yes, I am picky about it after vn_io_fault() work. Urk. For some reason I was thinking that the uio modifications were in a kernel buffer, so they could be backed out of easily. But surely the user buffer is indeterminate after a read error? Even after success, the region beyond the part read should be specified as indeterminate. Consider an implementation that asks the hardware to DMA into part of the read buffer beyond a (possibly null) region already successfully read. If the DMA fails, you might not know how far it got. The best you can do to recover is to back out of the failed part of the read only. Possibly zero the part that failed for security. For further complications, consider a similar implementations but with multiple DMA channels writing in indeterminate order. If (part of) the buffer is not allowed to be indeterminate after a success or failure, then both the success and the failure cases are broken in the FreeBSD implementation (apart from not handling short I/O's correctly). In the failure case, not backing out of partial I/O's leaves a trashed buffer. In the success case, if it is implemented by a partial backout, the part not backed out of is still trashed. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:01:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2988EC5; Mon, 3 Nov 2014 16:01:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7D6287; Mon, 3 Nov 2014 16:01:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3G1jqk073955; Mon, 3 Nov 2014 16:01:45 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3G1jBE073954; Mon, 3 Nov 2014 16:01:45 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411031601.sA3G1jBE073954@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Mon, 3 Nov 2014 16:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274053 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 16:01:45 -0000 Author: dumbbell Date: Mon Nov 3 16:01:44 2014 New Revision: 274053 URL: https://svnweb.freebsd.org/changeset/base/274053 Log: vt(4): Start new sentences on their own lines Submitted by: brueffer@ MFC after: 1 week Modified: head/share/man/man4/vt.4 Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Mon Nov 3 15:40:49 2014 (r274052) +++ head/share/man/man4/vt.4 Mon Nov 3 16:01:44 2014 (r274053) @@ -208,21 +208,24 @@ is used on computers that boot from UEFI .It Va kern.vt.fb.default_mode Set this value to a graphic mode to override the default mode picked by the .Nm -backend. The mode is applied to all output connectors. This is currently -only supported by the +backend. +The mode is applied to all output connectors. +This is currently only supported by the .Cm vt_fb backend when it's paired with a KMS video driver. .It Va kern.vt.fb.modes. Ns Pa connector_name Set this value to a graphic mode to override the default mode picked by the .Nm -backend. This mode is applied to the output connector +backend. +This mode is applied to the output connector .Pa connector_name only. It has precedence over .Va kern.vt.fb.default_mode . The names of available connector names can be found in .Xr dmesg 8 -after loading the KMS driver. It will contain a list of connectors and -their associated tunables. This is currently only supported by the +after loading the KMS driver. +It will contain a list of connectors and their associated tunables. +This is currently only supported by the .Cm vt_fb backend when it's paired with a KMS video driver. .El From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:31:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BA9B5FB; Mon, 3 Nov 2014 16:31:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0842389E; Mon, 3 Nov 2014 16:31:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3GVVnE089823; Mon, 3 Nov 2014 16:31:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3GVVmC089821; Mon, 3 Nov 2014 16:31:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411031631.sA3GVVmC089821@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 16:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274054 - head/sys/i386/xen 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 16:31:32 -0000 Author: jhb Date: Mon Nov 3 16:31:31 2014 New Revision: 274054 URL: https://svnweb.freebsd.org/changeset/base/274054 Log: Fix XEN kernel build. Pointy hat to: jhb Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Mon Nov 3 16:01:44 2014 (r274053) +++ head/sys/i386/xen/mp_machdep.c Mon Nov 3 16:31:31 2014 (r274054) @@ -604,7 +604,7 @@ init_secondary(void) #endif /* set up FPU state on the AP */ - npxinit(); + npxinit(false); #if 0 /* A quick check from sanity claus */ if (PCPU_GET(apic_id) != lapic_id()) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:57:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDEB9D75; Mon, 3 Nov 2014 16:57:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C970EB21; Mon, 3 Nov 2014 16:57:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Gv1xR000484; Mon, 3 Nov 2014 16:57:01 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Gv181000483; Mon, 3 Nov 2014 16:57:01 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411031657.sA3Gv181000483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Mon, 3 Nov 2014 16:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274055 - head/sys/dev/virtio/console 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 16:57:02 -0000 Author: bryanv Date: Mon Nov 3 16:57:01 2014 New Revision: 274055 URL: https://svnweb.freebsd.org/changeset/base/274055 Log: Add support for the multiport feature and fix hot plug races MFC after: 1 month Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Mon Nov 3 16:31:31 2014 (r274054) +++ head/sys/dev/virtio/console/virtio_console.c Mon Nov 3 16:57:01 2014 (r274055) @@ -55,33 +55,40 @@ __FBSDID("$FreeBSD$"); #include "virtio_if.h" -#define VTCON_MAX_PORTS 1 +#define VTCON_MAX_PORTS 32 #define VTCON_TTY_PREFIX "V" #define VTCON_BULK_BUFSZ 128 +/* + * The buffer cannot cross more than one page boundary due to the + * size of the sglist segment array used. + */ +CTASSERT(VTCON_BULK_BUFSZ <= PAGE_SIZE); + struct vtcon_softc; +struct vtcon_softc_port; struct vtcon_port { - struct vtcon_softc *vtcport_sc; - TAILQ_ENTRY(vtcon_port) vtcport_next; - struct mtx vtcport_mtx; - int vtcport_id; - struct tty *vtcport_tty; - struct virtqueue *vtcport_invq; - struct virtqueue *vtcport_outvq; - char vtcport_name[16]; + struct mtx vtcport_mtx; + struct vtcon_softc *vtcport_sc; + struct vtcon_softc_port *vtcport_scport; + struct tty *vtcport_tty; + struct virtqueue *vtcport_invq; + struct virtqueue *vtcport_outvq; + int vtcport_id; + int vtcport_flags; +#define VTCON_PORT_FLAG_GONE 0x01 }; -#define VTCON_PORT_MTX(_port) &(_port)->vtcport_mtx -#define VTCON_PORT_LOCK_INIT(_port) \ - mtx_init(VTCON_PORT_MTX((_port)), (_port)->vtcport_name, NULL, MTX_DEF) -#define VTCON_PORT_LOCK(_port) mtx_lock(VTCON_PORT_MTX((_port))) -#define VTCON_PORT_UNLOCK(_port) mtx_unlock(VTCON_PORT_MTX((_port))) -#define VTCON_PORT_LOCK_DESTROY(_port) mtx_destroy(VTCON_PORT_MTX((_port))) -#define VTCON_PORT_LOCK_ASSERT(_port) \ - mtx_assert(VTCON_PORT_MTX((_port)), MA_OWNED) -#define VTCON_PORT_LOCK_ASSERT_NOTOWNED(_port) \ - mtx_assert(VTCON_PORT_MTX((_port)), MA_NOTOWNED) +#define VTCON_PORT_LOCK(_port) mtx_lock(&(_port)->vtcport_mtx) +#define VTCON_PORT_UNLOCK(_port) mtx_unlock(&(_port)->vtcport_mtx) + +struct vtcon_softc_port { + struct vtcon_softc *vcsp_sc; + struct vtcon_port *vcsp_port; + struct virtqueue *vcsp_invq; + struct virtqueue *vcsp_outvq; +}; struct vtcon_softc { device_t vtcon_dev; @@ -95,38 +102,33 @@ struct vtcon_softc { struct task vtcon_ctrl_task; struct virtqueue *vtcon_ctrl_rxvq; struct virtqueue *vtcon_ctrl_txvq; + struct mtx vtcon_ctrl_tx_mtx; uint32_t vtcon_max_ports; - TAILQ_HEAD(, vtcon_port) - vtcon_ports; /* * Ports can be added and removed during runtime, but we have * to allocate all the virtqueues during attach. This array is * indexed by the port ID. */ - struct vtcon_port_extra { - struct vtcon_port *port; - struct virtqueue *invq; - struct virtqueue *outvq; - } *vtcon_portsx; + struct vtcon_softc_port *vtcon_ports; }; -#define VTCON_MTX(_sc) &(_sc)->vtcon_mtx -#define VTCON_LOCK_INIT(_sc, _name) \ - mtx_init(VTCON_MTX((_sc)), (_name), NULL, MTX_DEF) -#define VTCON_LOCK(_sc) mtx_lock(VTCON_MTX((_sc))) -#define VTCON_UNLOCK(_sc) mtx_unlock(VTCON_MTX((_sc))) -#define VTCON_LOCK_DESTROY(_sc) mtx_destroy(VTCON_MTX((_sc))) -#define VTCON_LOCK_ASSERT(_sc) mtx_assert(VTCON_MTX((_sc)), MA_OWNED) -#define VTCON_LOCK_ASSERT_NOTOWNED(_sc) \ - mtx_assert(VTCON_MTX((_sc)), MA_NOTOWNED) +#define VTCON_LOCK(_sc) mtx_lock(&(_sc)->vtcon_mtx) +#define VTCON_UNLOCK(_sc) mtx_unlock(&(_sc)->vtcon_mtx) +#define VTCON_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->vtcon_mtx, MA_OWNED) +#define VTCON_LOCK_ASSERT_NOTOWNED(_sc) \ + mtx_assert(&(_sc)->vtcon_mtx, MA_NOTOWNED) + +#define VTCON_CTRL_TX_LOCK(_sc) mtx_lock(&(_sc)->vtcon_ctrl_tx_mtx) +#define VTCON_CTRL_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->vtcon_ctrl_tx_mtx) #define VTCON_ASSERT_VALID_PORTID(_sc, _id) \ KASSERT((_id) >= 0 && (_id) < (_sc)->vtcon_max_ports, \ ("%s: port ID %d out of range", __func__, _id)) -#define VTCON_FEATURES 0 +#define VTCON_FEATURES VIRTIO_CONSOLE_F_MULTIPORT static struct virtio_feature_desc vtcon_feature_desc[] = { { VIRTIO_CONSOLE_F_SIZE, "ConsoleSize" }, @@ -136,62 +138,66 @@ static struct virtio_feature_desc vtcon_ }; static int vtcon_modevent(module_t, int, void *); +static void vtcon_drain_all(void); static int vtcon_probe(device_t); static int vtcon_attach(device_t); static int vtcon_detach(device_t); static int vtcon_config_change(device_t); +static void vtcon_setup_features(struct vtcon_softc *); static void vtcon_negotiate_features(struct vtcon_softc *); +static int vtcon_alloc_scports(struct vtcon_softc *); static int vtcon_alloc_virtqueues(struct vtcon_softc *); static void vtcon_read_config(struct vtcon_softc *, struct virtio_console_config *); static void vtcon_determine_max_ports(struct vtcon_softc *, struct virtio_console_config *); -static void vtcon_deinit_ports(struct vtcon_softc *); +static void vtcon_destroy_ports(struct vtcon_softc *); static void vtcon_stop(struct vtcon_softc *); -static void vtcon_ctrl_rx_vq_intr(void *); -static int vtcon_ctrl_enqueue_msg(struct vtcon_softc *, +static int vtcon_ctrl_event_enqueue(struct vtcon_softc *, struct virtio_console_control *); -static int vtcon_ctrl_add_msg(struct vtcon_softc *); -static void vtcon_ctrl_readd_msg(struct vtcon_softc *, +static int vtcon_ctrl_event_create(struct vtcon_softc *); +static void vtcon_ctrl_event_requeue(struct vtcon_softc *, struct virtio_console_control *); -static int vtcon_ctrl_populate(struct vtcon_softc *); -static void vtcon_ctrl_send_msg(struct vtcon_softc *, - struct virtio_console_control *control); -static void vtcon_ctrl_send_event(struct vtcon_softc *, uint32_t, - uint16_t, uint16_t); +static int vtcon_ctrl_event_populate(struct vtcon_softc *); +static void vtcon_ctrl_event_drain(struct vtcon_softc *); static int vtcon_ctrl_init(struct vtcon_softc *); -static void vtcon_ctrl_drain(struct vtcon_softc *); static void vtcon_ctrl_deinit(struct vtcon_softc *); static void vtcon_ctrl_port_add_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_remove_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_console_event(struct vtcon_softc *, int); static void vtcon_ctrl_port_open_event(struct vtcon_softc *, int); -static void vtcon_ctrl_process_msg(struct vtcon_softc *, +static void vtcon_ctrl_process_event(struct vtcon_softc *, struct virtio_console_control *); static void vtcon_ctrl_task_cb(void *, int); +static void vtcon_ctrl_event_intr(void *); +static void vtcon_ctrl_poll(struct vtcon_softc *, + struct virtio_console_control *control); +static void vtcon_ctrl_send_control(struct vtcon_softc *, uint32_t, + uint16_t, uint16_t); -static int vtcon_port_add_inbuf(struct vtcon_port *); -static void vtcon_port_readd_inbuf(struct vtcon_port *, void *); +static int vtcon_port_enqueue_buf(struct vtcon_port *, void *, size_t); +static int vtcon_port_create_buf(struct vtcon_port *); +static void vtcon_port_requeue_buf(struct vtcon_port *, void *); static int vtcon_port_populate(struct vtcon_port *); static void vtcon_port_destroy(struct vtcon_port *); -static int vtcon_port_create(struct vtcon_softc *, int, - struct vtcon_port **); -static void vtcon_port_drain_inbufs(struct vtcon_port *); -static void vtcon_port_teardown(struct vtcon_port *, int); +static int vtcon_port_create(struct vtcon_softc *, int); +static void vtcon_port_drain_bufs(struct virtqueue *); +static void vtcon_port_drain(struct vtcon_port *); +static void vtcon_port_teardown(struct vtcon_port *); static void vtcon_port_change_size(struct vtcon_port *, uint16_t, uint16_t); +static void vtcon_port_update_console_size(struct vtcon_softc *); static void vtcon_port_enable_intr(struct vtcon_port *); static void vtcon_port_disable_intr(struct vtcon_port *); -static void vtcon_port_intr(struct vtcon_port *); -static void vtcon_port_in_vq_intr(void *); -static void vtcon_port_put(struct vtcon_port *, void *, int); -static void vtcon_port_send_ctrl_msg(struct vtcon_port *, uint16_t, +static void vtcon_port_in(struct vtcon_port *); +static void vtcon_port_intr(void *); +static void vtcon_port_out(struct vtcon_port *, void *, int); +static void vtcon_port_submit_event(struct vtcon_port *, uint16_t, uint16_t); -static struct vtcon_port *vtcon_port_lookup_by_id(struct vtcon_softc *, int); static int vtcon_tty_open(struct tty *); static void vtcon_tty_close(struct tty *); @@ -248,9 +254,11 @@ vtcon_modevent(module_t mod, int type, v error = 0; break; case MOD_QUIESCE: + error = 0; + break; case MOD_UNLOAD: - error = vtcon_pending_free != 0 ? EBUSY : 0; - /* error = EOPNOTSUPP; */ + vtcon_drain_all(); + error = 0; break; case MOD_SHUTDOWN: error = 0; @@ -263,6 +271,20 @@ vtcon_modevent(module_t mod, int type, v return (error); } +static void +vtcon_drain_all(void) +{ + int first; + + for (first = 1; vtcon_pending_free != 0; first = 0) { + if (first != 0) { + printf("virtio_console: Waiting for all detached TTY " + "devices to have open fds closed.\n"); + } + pause("vtcondra", hz); + } +} + static int vtcon_probe(device_t dev) { @@ -285,31 +307,32 @@ vtcon_attach(device_t dev) sc = device_get_softc(dev); sc->vtcon_dev = dev; - VTCON_LOCK_INIT(sc, device_get_nameunit(dev)); - TASK_INIT(&sc->vtcon_ctrl_task, 0, vtcon_ctrl_task_cb, sc); - TAILQ_INIT(&sc->vtcon_ports); + mtx_init(&sc->vtcon_mtx, "vtconmtx", NULL, MTX_DEF); + mtx_init(&sc->vtcon_ctrl_tx_mtx, "vtconctrlmtx", NULL, MTX_DEF); virtio_set_feature_desc(dev, vtcon_feature_desc); - vtcon_negotiate_features(sc); - - if (virtio_with_feature(dev, VIRTIO_CONSOLE_F_SIZE)) - sc->vtcon_flags |= VTCON_FLAG_SIZE; - if (virtio_with_feature(dev, VIRTIO_CONSOLE_F_MULTIPORT)) - sc->vtcon_flags |= VTCON_FLAG_MULTIPORT; + vtcon_setup_features(sc); vtcon_read_config(sc, &concfg); vtcon_determine_max_ports(sc, &concfg); + error = vtcon_alloc_scports(sc); + if (error) { + device_printf(dev, "cannot allocate softc port structures\n"); + goto fail; + } + error = vtcon_alloc_virtqueues(sc); if (error) { device_printf(dev, "cannot allocate virtqueues\n"); goto fail; } - if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) + if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) { + TASK_INIT(&sc->vtcon_ctrl_task, 0, vtcon_ctrl_task_cb, sc); error = vtcon_ctrl_init(sc); - else - error = vtcon_port_create(sc, 0, NULL); + } else + error = vtcon_port_create(sc, 0); if (error) goto fail; @@ -321,7 +344,7 @@ vtcon_attach(device_t dev) vtcon_enable_interrupts(sc); - vtcon_ctrl_send_event(sc, VIRTIO_CONSOLE_BAD_ID, + vtcon_ctrl_send_control(sc, VIRTIO_CONSOLE_BAD_ID, VIRTIO_CONSOLE_DEVICE_READY, 1); fail: @@ -344,14 +367,14 @@ vtcon_detach(device_t dev) vtcon_stop(sc); VTCON_UNLOCK(sc); - taskqueue_drain(taskqueue_thread, &sc->vtcon_ctrl_task); - - if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) + if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) { + taskqueue_drain(taskqueue_thread, &sc->vtcon_ctrl_task); vtcon_ctrl_deinit(sc); + } - vtcon_deinit_ports(sc); - - VTCON_LOCK_DESTROY(sc); + vtcon_destroy_ports(sc); + mtx_destroy(&sc->vtcon_mtx); + mtx_destroy(&sc->vtcon_ctrl_tx_mtx); return (0); } @@ -360,30 +383,16 @@ static int vtcon_config_change(device_t dev) { struct vtcon_softc *sc; - struct vtcon_port *port; - uint16_t cols, rows; sc = device_get_softc(dev); /* - * With the multiport feature, all configuration changes are - * done through control virtqueue events. This is a spurious - * interrupt. + * When the multiport feature is negotiated, all configuration + * changes are done through control virtqueue events. */ - if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) - return (0); - - if (sc->vtcon_flags & VTCON_FLAG_SIZE) { - /* - * For now, assume the first (only) port is the 'console'. - * Note QEMU does not implement this feature yet. - */ - VTCON_LOCK(sc); - if ((port = vtcon_port_lookup_by_id(sc, 0)) != NULL) { - vtcon_get_console_size(sc, &cols, &rows); - vtcon_port_change_size(port, cols, rows); - } - VTCON_UNLOCK(sc); + if ((sc->vtcon_flags & VTCON_FLAG_MULTIPORT) == 0) { + if (sc->vtcon_flags & VTCON_FLAG_SIZE) + vtcon_port_update_console_size(sc); } return (0); @@ -401,6 +410,21 @@ vtcon_negotiate_features(struct vtcon_so sc->vtcon_features = virtio_negotiate_features(dev, features); } +static void +vtcon_setup_features(struct vtcon_softc *sc) +{ + device_t dev; + + dev = sc->vtcon_dev; + + vtcon_negotiate_features(sc); + + if (virtio_with_feature(dev, VIRTIO_CONSOLE_F_SIZE)) + sc->vtcon_flags |= VTCON_FLAG_SIZE; + if (virtio_with_feature(dev, VIRTIO_CONSOLE_F_MULTIPORT)) + sc->vtcon_flags |= VTCON_FLAG_MULTIPORT; +} + #define VTCON_GET_CONFIG(_dev, _feature, _field, _cfg) \ if (virtio_with_feature(_dev, _feature)) { \ virtio_read_device_config(_dev, \ @@ -417,7 +441,6 @@ vtcon_read_config(struct vtcon_softc *sc bzero(concfg, sizeof(struct virtio_console_config)); - /* Read the configuration if the feature was negotiated. */ VTCON_GET_CONFIG(dev, VIRTIO_CONSOLE_F_SIZE, cols, concfg); VTCON_GET_CONFIG(dev, VIRTIO_CONSOLE_F_SIZE, rows, concfg); VTCON_GET_CONFIG(dev, VIRTIO_CONSOLE_F_MULTIPORT, max_nr_ports, concfg); @@ -426,20 +449,36 @@ vtcon_read_config(struct vtcon_softc *sc #undef VTCON_GET_CONFIG static int +vtcon_alloc_scports(struct vtcon_softc *sc) +{ + struct vtcon_softc_port *scport; + int max, i; + + max = sc->vtcon_max_ports; + + sc->vtcon_ports = malloc(sizeof(struct vtcon_softc_port) * max, + M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->vtcon_ports == NULL) + return (ENOMEM); + + for (i = 0; i < max; i++) { + scport = &sc->vtcon_ports[i]; + scport->vcsp_sc = sc; + } + + return (0); +} + +static int vtcon_alloc_virtqueues(struct vtcon_softc *sc) { device_t dev; struct vq_alloc_info *info; - struct vtcon_port_extra *portx; + struct vtcon_softc_port *scport; int i, idx, portidx, nvqs, error; dev = sc->vtcon_dev; - sc->vtcon_portsx = malloc(sizeof(struct vtcon_port_extra) * - sc->vtcon_max_ports, M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc->vtcon_portsx == NULL) - return (ENOMEM); - nvqs = sc->vtcon_max_ports * 2; if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) nvqs += 2; @@ -448,12 +487,12 @@ vtcon_alloc_virtqueues(struct vtcon_soft if (info == NULL) return (ENOMEM); - for (i = 0, idx = 0, portidx = 0; i < nvqs / 2; i++, idx+=2) { + for (i = 0, idx = 0, portidx = 0; i < nvqs / 2; i++, idx += 2) { if (i == 1) { /* The control virtqueues are after the first port. */ VQ_ALLOC_INFO_INIT(&info[idx], 0, - vtcon_ctrl_rx_vq_intr, sc, &sc->vtcon_ctrl_rxvq, + vtcon_ctrl_event_intr, sc, &sc->vtcon_ctrl_rxvq, "%s-control rx", device_get_nameunit(dev)); VQ_ALLOC_INFO_INIT(&info[idx+1], 0, NULL, sc, &sc->vtcon_ctrl_txvq, @@ -461,14 +500,14 @@ vtcon_alloc_virtqueues(struct vtcon_soft continue; } - portx = &sc->vtcon_portsx[portidx]; + scport = &sc->vtcon_ports[portidx]; - VQ_ALLOC_INFO_INIT(&info[idx], 0, vtcon_port_in_vq_intr, - portx, &portx->invq, "%s-port%d in", - device_get_nameunit(dev), portidx); + VQ_ALLOC_INFO_INIT(&info[idx], 0, vtcon_port_intr, + scport, &scport->vcsp_invq, "%s-port%d in", + device_get_nameunit(dev), i); VQ_ALLOC_INFO_INIT(&info[idx+1], 0, NULL, - NULL, &portx->outvq, "%s-port%d out", - device_get_nameunit(dev), portidx); + NULL, &scport->vcsp_outvq, "%s-port%d out", + device_get_nameunit(dev), i); portidx++; } @@ -494,18 +533,37 @@ vtcon_determine_max_ports(struct vtcon_s } static void -vtcon_deinit_ports(struct vtcon_softc *sc) +vtcon_destroy_ports(struct vtcon_softc *sc) { - struct vtcon_port *port, *tmp; + struct vtcon_softc_port *scport; + struct vtcon_port *port; + struct virtqueue *vq; + int i; - TAILQ_FOREACH_SAFE(port, &sc->vtcon_ports, vtcport_next, tmp) { - vtcon_port_teardown(port, 1); - } + if (sc->vtcon_ports == NULL) + return; + + VTCON_LOCK(sc); + for (i = 0; i < sc->vtcon_max_ports; i++) { + scport = &sc->vtcon_ports[i]; + + port = scport->vcsp_port; + if (port != NULL) { + scport->vcsp_port = NULL; + VTCON_PORT_LOCK(port); + VTCON_UNLOCK(sc); + vtcon_port_teardown(port); + VTCON_LOCK(sc); + } - if (sc->vtcon_portsx != NULL) { - free(sc->vtcon_portsx, M_DEVBUF); - sc->vtcon_portsx = NULL; + vq = scport->vcsp_invq; + if (vq != NULL) + vtcon_port_drain_bufs(vq); } + VTCON_UNLOCK(sc); + + free(sc->vtcon_ports, M_DEVBUF); + sc->vtcon_ports = NULL; } static void @@ -516,50 +574,38 @@ vtcon_stop(struct vtcon_softc *sc) virtio_stop(sc->vtcon_dev); } -static void -vtcon_ctrl_rx_vq_intr(void *xsc) -{ - struct vtcon_softc *sc; - - sc = xsc; - - /* - * Some events require us to potentially block, but it easier - * to just defer all event handling to a seperate thread. - */ - taskqueue_enqueue(taskqueue_thread, &sc->vtcon_ctrl_task); -} - static int -vtcon_ctrl_enqueue_msg(struct vtcon_softc *sc, +vtcon_ctrl_event_enqueue(struct vtcon_softc *sc, struct virtio_console_control *control) { - struct sglist_seg segs[1]; + struct sglist_seg segs[2]; struct sglist sg; struct virtqueue *vq; - int error __unused; + int error; vq = sc->vtcon_ctrl_rxvq; - sglist_init(&sg, 1, segs); - error = sglist_append(&sg, control, sizeof(*control)); - KASSERT(error == 0 && sg.sg_nseg == 1, - ("%s: error %d adding control msg to sglist", __func__, error)); + sglist_init(&sg, 2, segs); + error = sglist_append(&sg, control, + sizeof(struct virtio_console_control)); + KASSERT(error == 0, ("%s: error %d adding control to sglist", + __func__, error)); - return (virtqueue_enqueue(vq, control, &sg, 0, 1)); + return (virtqueue_enqueue(vq, control, &sg, 0, sg.sg_nseg)); } static int -vtcon_ctrl_add_msg(struct vtcon_softc *sc) +vtcon_ctrl_event_create(struct vtcon_softc *sc) { struct virtio_console_control *control; int error; - control = malloc(sizeof(*control), M_DEVBUF, M_ZERO | M_NOWAIT); + control = malloc(sizeof(struct virtio_console_control), M_DEVBUF, + M_ZERO | M_NOWAIT); if (control == NULL) return (ENOMEM); - error = vtcon_ctrl_enqueue_msg(sc, control); + error = vtcon_ctrl_event_enqueue(sc, control); if (error) free(control, M_DEVBUF); @@ -567,20 +613,20 @@ vtcon_ctrl_add_msg(struct vtcon_softc *s } static void -vtcon_ctrl_readd_msg(struct vtcon_softc *sc, +vtcon_ctrl_event_requeue(struct vtcon_softc *sc, struct virtio_console_control *control) { int error; - bzero(control, sizeof(*control)); + bzero(control, sizeof(struct virtio_console_control)); - error = vtcon_ctrl_enqueue_msg(sc, control); + error = vtcon_ctrl_event_enqueue(sc, control); KASSERT(error == 0, ("%s: cannot requeue control buffer %d", __func__, error)); } static int -vtcon_ctrl_populate(struct vtcon_softc *sc) +vtcon_ctrl_event_populate(struct vtcon_softc *sc) { struct virtqueue *vq; int nbufs, error; @@ -589,64 +635,36 @@ vtcon_ctrl_populate(struct vtcon_softc * error = ENOSPC; for (nbufs = 0; !virtqueue_full(vq); nbufs++) { - error = vtcon_ctrl_add_msg(sc); + error = vtcon_ctrl_event_create(sc); if (error) break; } if (nbufs > 0) { virtqueue_notify(vq); - /* - * EMSGSIZE signifies the virtqueue did not have enough - * entries available to hold the last buf. This is not - * an error. - */ - if (error == EMSGSIZE) - error = 0; + error = 0; } return (error); } static void -vtcon_ctrl_send_msg(struct vtcon_softc *sc, - struct virtio_console_control *control) +vtcon_ctrl_event_drain(struct vtcon_softc *sc) { - struct sglist_seg segs[1]; - struct sglist sg; + struct virtio_console_control *control; struct virtqueue *vq; - int error; - - vq = sc->vtcon_ctrl_txvq; - KASSERT(virtqueue_empty(vq), - ("%s: virtqueue is not emtpy", __func__)); - - sglist_init(&sg, 1, segs); - error = sglist_append(&sg, control, sizeof(*control)); - KASSERT(error == 0 && sg.sg_nseg == 1, - ("%s: error %d adding control msg to sglist", __func__, error)); - - error = virtqueue_enqueue(vq, control, &sg, 1, 0); - if (error == 0) { - virtqueue_notify(vq); - virtqueue_poll(vq, NULL); - } -} + int last; -static void -vtcon_ctrl_send_event(struct vtcon_softc *sc, uint32_t portid, uint16_t event, - uint16_t value) -{ - struct virtio_console_control control; + vq = sc->vtcon_ctrl_rxvq; + last = 0; - if ((sc->vtcon_flags & VTCON_FLAG_MULTIPORT) == 0) + if (vq == NULL) return; - control.id = portid; - control.event = event; - control.value = value; - - vtcon_ctrl_send_msg(sc, &control); + VTCON_LOCK(sc); + while ((control = virtqueue_drain(vq, &last)) != NULL) + free(control, M_DEVBUF); + VTCON_UNLOCK(sc); } static int @@ -654,111 +672,101 @@ vtcon_ctrl_init(struct vtcon_softc *sc) { int error; - error = vtcon_ctrl_populate(sc); + error = vtcon_ctrl_event_populate(sc); return (error); } static void -vtcon_ctrl_drain(struct vtcon_softc *sc) -{ - struct virtio_console_control *control; - struct virtqueue *vq; - int last; - - vq = sc->vtcon_ctrl_rxvq; - last = 0; - - if (vq == NULL) - return; - - while ((control = virtqueue_drain(vq, &last)) != NULL) - free(control, M_DEVBUF); -} - -static void vtcon_ctrl_deinit(struct vtcon_softc *sc) { - vtcon_ctrl_drain(sc); + vtcon_ctrl_event_drain(sc); } static void vtcon_ctrl_port_add_event(struct vtcon_softc *sc, int id) { device_t dev; - struct vtcon_port *port; int error; dev = sc->vtcon_dev; - if (vtcon_port_lookup_by_id(sc, id) != NULL) { + /* This single thread only way for ports to be created. */ + if (sc->vtcon_ports[id].vcsp_port != NULL) { device_printf(dev, "%s: adding port %d, but already exists\n", __func__, id); return; } - error = vtcon_port_create(sc, id, &port); + error = vtcon_port_create(sc, id); if (error) { device_printf(dev, "%s: cannot create port %d: %d\n", __func__, id, error); return; } - - vtcon_port_send_ctrl_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); } static void vtcon_ctrl_port_remove_event(struct vtcon_softc *sc, int id) { device_t dev; + struct vtcon_softc_port *scport; struct vtcon_port *port; dev = sc->vtcon_dev; + scport = &sc->vtcon_ports[id]; - port = vtcon_port_lookup_by_id(sc, id); + VTCON_LOCK(sc); + port = scport->vcsp_port; if (port == NULL) { + VTCON_UNLOCK(sc); device_printf(dev, "%s: remove port %d, but does not exist\n", __func__, id); return; } - vtcon_port_teardown(port, 1); + scport->vcsp_port = NULL; + VTCON_PORT_LOCK(port); + VTCON_UNLOCK(sc); + vtcon_port_teardown(port); } static void vtcon_ctrl_port_console_event(struct vtcon_softc *sc, int id) { - device_t dev; - - dev = sc->vtcon_dev; - /* - * BMV: I don't think we need to do anything. - */ - device_printf(dev, "%s: port %d console event\n", __func__, id); + device_printf(sc->vtcon_dev, "%s: port %d console event\n", + __func__, id); } static void vtcon_ctrl_port_open_event(struct vtcon_softc *sc, int id) { device_t dev; + struct vtcon_softc_port *scport; struct vtcon_port *port; dev = sc->vtcon_dev; + scport = &sc->vtcon_ports[id]; - port = vtcon_port_lookup_by_id(sc, id); + VTCON_LOCK(sc); + port = scport->vcsp_port; if (port == NULL) { + VTCON_UNLOCK(sc); device_printf(dev, "%s: open port %d, but does not exist\n", __func__, id); return; } + VTCON_PORT_LOCK(port); + VTCON_UNLOCK(sc); vtcon_port_enable_intr(port); + VTCON_PORT_UNLOCK(port); } static void -vtcon_ctrl_process_msg(struct vtcon_softc *sc, +vtcon_ctrl_process_event(struct vtcon_softc *sc, struct virtio_console_control *control) { device_t dev; @@ -803,47 +811,120 @@ vtcon_ctrl_task_cb(void *xsc, int pendin struct vtcon_softc *sc; struct virtqueue *vq; struct virtio_console_control *control; + int detached; sc = xsc; vq = sc->vtcon_ctrl_rxvq; VTCON_LOCK(sc); - while ((sc->vtcon_flags & VTCON_FLAG_DETACHED) == 0) { + + while ((detached = (sc->vtcon_flags & VTCON_FLAG_DETACHED)) == 0) { control = virtqueue_dequeue(vq, NULL); if (control == NULL) break; VTCON_UNLOCK(sc); - vtcon_ctrl_process_msg(sc, control); + vtcon_ctrl_process_event(sc, control); VTCON_LOCK(sc); - vtcon_ctrl_readd_msg(sc, control); + vtcon_ctrl_event_requeue(sc, control); + } + + if (!detached) { + virtqueue_notify(vq); + if (virtqueue_enable_intr(vq) != 0) + taskqueue_enqueue(taskqueue_thread, + &sc->vtcon_ctrl_task); } + VTCON_UNLOCK(sc); +} - if (virtqueue_enable_intr(vq) != 0) - taskqueue_enqueue(taskqueue_thread, &sc->vtcon_ctrl_task); +static void +vtcon_ctrl_event_intr(void *xsc) +{ + struct vtcon_softc *sc; + + sc = xsc; + + /* + * Only some events require us to potentially block, but it + * easier to just defer all event handling to the taskqueue. + */ + taskqueue_enqueue(taskqueue_thread, &sc->vtcon_ctrl_task); +} + +static void +vtcon_ctrl_poll(struct vtcon_softc *sc, + struct virtio_console_control *control) +{ + struct sglist_seg segs[2]; + struct sglist sg; + struct virtqueue *vq; + int error; + + vq = sc->vtcon_ctrl_txvq; + + sglist_init(&sg, 2, segs); + error = sglist_append(&sg, control, + sizeof(struct virtio_console_control)); + KASSERT(error == 0, ("%s: error %d adding control to sglist", + __func__, error)); + + /* + * We cannot use the softc lock to serialize access to this + * virtqueue since this is called from the tty layer with the + * port lock held. Acquiring the softc would violate our lock + * ordering. + */ + VTCON_CTRL_TX_LOCK(sc); + KASSERT(virtqueue_empty(vq), + ("%s: virtqueue is not emtpy", __func__)); + error = virtqueue_enqueue(vq, control, &sg, sg.sg_nseg, 0); + if (error == 0) { + virtqueue_notify(vq); + virtqueue_poll(vq, NULL); + } + VTCON_CTRL_TX_UNLOCK(sc); +} + +static void +vtcon_ctrl_send_control(struct vtcon_softc *sc, uint32_t portid, + uint16_t event, uint16_t value) +{ + struct virtio_console_control control; + + if ((sc->vtcon_flags & VTCON_FLAG_MULTIPORT) == 0) + return; + + control.id = portid; + control.event = event; + control.value = value; + + vtcon_ctrl_poll(sc, &control); } static int -vtcon_port_enqueue_inbuf(struct vtcon_port *port, void *buf, size_t len) +vtcon_port_enqueue_buf(struct vtcon_port *port, void *buf, size_t len) { - struct sglist_seg segs[1]; + struct sglist_seg segs[2]; struct sglist sg; struct virtqueue *vq; int error; vq = port->vtcport_invq; - sglist_init(&sg, 1, segs); + sglist_init(&sg, 2, segs); error = sglist_append(&sg, buf, len); - KASSERT(error == 0 && sg.sg_nseg == 1, + KASSERT(error == 0, ("%s: error %d adding buffer to sglist", __func__, error)); - return (virtqueue_enqueue(vq, buf, &sg, 0, 1)); + error = virtqueue_enqueue(vq, buf, &sg, 0, sg.sg_nseg); + + return (error); } static int -vtcon_port_add_inbuf(struct vtcon_port *port) +vtcon_port_create_buf(struct vtcon_port *port) { void *buf; int error; @@ -852,7 +933,7 @@ vtcon_port_add_inbuf(struct vtcon_port * if (buf == NULL) return (ENOMEM); - error = vtcon_port_enqueue_inbuf(port, buf, VTCON_BULK_BUFSZ); + error = vtcon_port_enqueue_buf(port, buf, VTCON_BULK_BUFSZ); if (error) free(buf, M_DEVBUF); @@ -860,11 +941,11 @@ vtcon_port_add_inbuf(struct vtcon_port * } static void -vtcon_port_readd_inbuf(struct vtcon_port *port, void *buf) +vtcon_port_requeue_buf(struct vtcon_port *port, void *buf) { - int error __unused; + int error; - error = vtcon_port_enqueue_inbuf(port, buf, VTCON_BULK_BUFSZ); + error = vtcon_port_enqueue_buf(port, buf, VTCON_BULK_BUFSZ); KASSERT(error == 0, ("%s: cannot requeue input buffer %d", __func__, error)); } @@ -879,20 +960,14 @@ vtcon_port_populate(struct vtcon_port *p error = ENOSPC; for (nbufs = 0; !virtqueue_full(vq); nbufs++) { - error = vtcon_port_add_inbuf(port); + error = vtcon_port_create_buf(port); if (error) break; } if (nbufs > 0) { virtqueue_notify(vq); - /* - * EMSGSIZE signifies the virtqueue did not have enough - * entries available to hold the last buf. This is not - * an error. - */ - if (error == EMSGSIZE) - error = 0; + error = 0; } return (error); @@ -903,49 +978,73 @@ vtcon_port_destroy(struct vtcon_port *po { port->vtcport_sc = NULL; + port->vtcport_scport = NULL; + port->vtcport_invq = NULL; + port->vtcport_outvq = NULL; port->vtcport_id = -1; - VTCON_PORT_LOCK_DESTROY(port); + mtx_destroy(&port->vtcport_mtx); free(port, M_DEVBUF); } static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 16:59:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id AA280FFC; Mon, 3 Nov 2014 16:59:58 +0000 (UTC) Date: Mon, 3 Nov 2014 16:59:58 +0000 From: Alexey Dokuchaev To: Alexander Motin Subject: Re: svn commit: r272059 - head/sys/compat/linux Message-ID: <20141103165958.GB51291@FreeBSD.org> References: <201409240818.s8O8ICmX036091@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409240818.s8O8ICmX036091@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 16:59:58 -0000 On Wed, Sep 24, 2014 at 08:18:12AM +0000, Alexander Motin wrote: > New Revision: 272059 > URL: http://svnweb.freebsd.org/changeset/base/272059 > > Log: > Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. > > Submitted by: Dmitry Luhtionov > MFC after: 3 days > > Modified: > head/sys/compat/linux/linux_ioctl.c Looks like it is also applicable to stable/8, can it be MFCed? Thanks! ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:03:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 341C323D; Mon, 3 Nov 2014 17:03:52 +0000 (UTC) Date: Mon, 3 Nov 2014 17:03:52 +0000 From: Alexey Dokuchaev To: "Pedro F. Giffuni" Subject: Re: svn commit: r272122 - head/lib/libc/stdtime Message-ID: <20141103170352.GC51291@FreeBSD.org> References: <201409251852.s8PIqIRD033822@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201409251852.s8PIqIRD033822@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 17:03:52 -0000 On Thu, Sep 25, 2014 at 06:52:18PM +0000, Pedro F. Giffuni wrote: > New Revision: 272122 > URL: http://svnweb.freebsd.org/changeset/base/272122 > > Log: > Add strptime(3) support for %U and %W > > Add support for the missing POSIX-2001 %U and %W features: the > existing FreeBSD strptime code recognizes both directives and > validates that the week number lies in the permitted range, > but then simply discards the value. I've notivced that recently added support for %t and %n, %s format fix, and now %U and %W were never MFCed to stable/8. Anything blocks these simply looking changes there? :) ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:07:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29F2A3E3; Mon, 3 Nov 2014 17:07:03 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id C8995C63; Mon, 3 Nov 2014 17:07:02 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 87030D4A1BD; Tue, 4 Nov 2014 04:06:52 +1100 (AEDT) Date: Tue, 4 Nov 2014 04:06:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: d@delphij.net Subject: Re: svn commit: r273958 - head/sys/dev/random In-Reply-To: <54573E07.5040505@delphij.net> Message-ID: <20141104025944.F1038@besplex.bde.org> References: <201411020201.sA221unt091493@svn.freebsd.org> <720EB74E-094A-43F3-8B1C-47BC7F6FECC3@grondar.org> <1414934579.17308.248.camel@revolution.hippie.lan> <6FB65828-6A79-4BDE-A9F7-BC472BA538CE@grondar.org> <20141102192057.GB53947@kib.kiev.ua> <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <5456A47E.2030405@delphij.net> <5456A69C.6040902@delphij.net> <20141103115402.H3149@besplex.bde.org> <54573E07.5040505@delphij.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=dFdFSw2EkNAFRa9SwC4A:9 a=CjuIK1q_8ugA:10 Cc: "src-committers@freebsd.org" , Bruce Evans , Ian Lepore , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Mark R V Murray , Konstantin Belousov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 17:07:03 -0000 On Mon, 3 Nov 2014, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 11/2/14 5:13 PM, Bruce Evans wrote: >> % - % - KASSERT(random_adaptor != NULL, ("No active random >> adaptor in %s", __func__)); % } % % void >> >> Lots of style bugs (long lines, use of the __func__ obfuscation, >> and general verboseness). > > What would you recommend doing for cases like this? Do we just do > KASSERT without the __func__ and rely on ddb to provide the > information in backtrace or something else? The implementation of KASSERT() should have been that. ddb, addr2line, and similar programs can produce better results at negative costs to the source and object code sizes. See an old flamew^Wdiscussion. Similarly for lock and mutex macros. Inlining complicates things, so that full debugging info is required to recover function names and context. __func__ sometimes gives the name of the function that you want, but not always. It is not useful to know the name of a deeply nested inline function -- instead the context is usually needed. Outisde of macros, I consider use of __func__ to be an obfuscation. It is easier to write but harder to read and useless for grepping. It is useful for macros like mtx_lock_spin() for the debugging case implemented with no ddb/addr2line support, since unlike for KASSERT() the API doesn't support passing in the caller's name. (mtx_lock_spin() actually uses the weaker __FILE__ and stronger __LINE__, and never __func__.) It is also rarely useful for inline functions, since there it gives the name of the inline function but usually you want the name of the immediate caller. If you want the name of the caller several steps up, then there is nothing better than a backtrace that has not been broken by inlining. assert(3) gets this wrong in the opposite direction. With assert(), the message is generated automatically from the assertion and there is no way to keep __FILE__, __LINE__ or __func__ out of it, though the implementation could produce these virtually to minimize the runtime bloat. The only way to add some extra info is to use some hack like the comma operator to add a string literal. So the above would be written as: assert(random_adaptor != NULL); which says almost as much in 1/3 the space and 1/10 of the mess in the source code, or with a different mess: assert(("X != NULL means no X (duh)", random_adaptor != NULL)); > Speaking for long lines -- I usually use the MTA's default so the diff > won't wrap. style(9) is a little bit vague here, what should new code > appear like? > >> % @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev >> __unused, str % /* Let the entropy source do any post-read >> cleanup. */ % (random_adaptor->ra_read)(NULL, 1); % % - >> free(random_buf, M_ENTROPY); % + if (nbytes != >> uio->uio_resid && (error == ERESTART || % + error == >> EINTR) ) % + error = 0; /* Return partial read, not >> error. */ I consider MTA wrapping a bug. It destroyed the diff after a couple of rounds of quoting. Some MTAs don't like my "% " quoting for diffs. style(9) just has an 80- or 79-column limit, stated by example of not having any lines longer than that. FreeBSD broke this by mangling the example C code into a man page. man adds a 5-space left margin and also normally formats for 80 columns (or just the terminal's width?), so it isn't clear what the example is. It looks more like a 75- or 74-column limit. That is good too since it leaves space for quoting. >> Extra blank lines are sprinkled randomly. Mostly added, but one >> was removed. There is an extra blank line after the sx_slock() that >> separates it from the blocks(s) of code that it locks; the removed >> one used the same style. > > Will change the code to consistently use no blank line after > sx_slock() and before sx_sunlock() if that's correct, can you confirm? I would probably put these blank lines back, to conform to the original (non-KNF) style. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:37:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C97B322D; Mon, 3 Nov 2014 17:37:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5265FBC; Mon, 3 Nov 2014 17:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3HboTn019497; Mon, 3 Nov 2014 17:37:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3HboEK019496; Mon, 3 Nov 2014 17:37:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411031737.sA3HboEK019496@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 17:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274056 - stable/8/sys/compat/linux X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 17:37:50 -0000 Author: mav Date: Mon Nov 3 17:37:49 2014 New Revision: 274056 URL: https://svnweb.freebsd.org/changeset/base/274056 Log: MFC r272059: Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. Submitted by: Dmitry Luhtionov Modified: stable/8/sys/compat/linux/linux_ioctl.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/compat/ (props changed) Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 16:57:01 2014 (r274055) +++ stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 17:37:49 2014 (r274056) @@ -1658,13 +1658,6 @@ linux_ioctl_vfat(struct thread *td, stru * Sound related ioctls */ -struct linux_mixer_info { - char id[16]; - char name[32]; - int modify_counter; - int fillers[10]; -}; - struct linux_old_mixer_info { char id[16]; char name[32]; @@ -1752,12 +1745,8 @@ linux_ioctl_sound(struct thread *td, str /* Key on encoded length */ switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ - struct linux_mixer_info info; - bzero(&info, sizeof(info)); - strncpy(info.id, "OSS", sizeof(info.id) - 1); - strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); - copyout(&info, (void *)args->arg, sizeof(info)); - return (0); + args->cmd = SOUND_MIXER_INFO; + return (sys_ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:38:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9474336F; Mon, 3 Nov 2014 17:38:47 +0000 (UTC) Received: from mail-pd0-x235.google.com (mail-pd0-x235.google.com [IPv6:2607:f8b0:400e:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58A2DFCD; Mon, 3 Nov 2014 17:38:47 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id y10so11870245pdj.40 for ; Mon, 03 Nov 2014 09:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/Jn+8Genfq8kEheNaqu301V1ALXtOEsn/5AlplU6QP4=; b=vUvAh+raD602egzmX3Fo8yubT1ca7yt+G3ixIqi6afbqmjqusFZtNEJlKtrIntOTw2 tcbYgtWhDSVVVZaB5KG/Kvqiu+ucX/85MXxJfkFCmmQYvjhb1KEUhoJ3oThtbdoRfbi2 H5sKrppkCY+QUJcipjqx0kU402+xaYealfuvqxfk/NftLy7lC84kqLh1Kd1MvbAivkNY U4iCi0Li+IdTFxqpUrnOtXzdpuDt+/KdbNYb5f9bbUreuGVGyHxPwDI7ODOrRSeNgSzO Aca+b3HQ4Pqb/ftyBqTp9DqV450qqjTgbP8gW2lvpycCw/Z4dLVWv8JiLf+5JkTpvfP8 dBbg== X-Received: by 10.66.252.34 with SMTP id zp2mr45122879pac.64.1415036326853; Mon, 03 Nov 2014 09:38:46 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([129.253.54.225]) by mx.google.com with ESMTPSA id c1sm17694086pbu.23.2014.11.03.09.38.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 09:38:46 -0800 (PST) Sender: Alexander Motin Message-ID: <5457BD9F.4040302@FreeBSD.org> Date: Mon, 03 Nov 2014 19:38:39 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r272059 - head/sys/compat/linux References: <201409240818.s8O8ICmX036091@svn.freebsd.org> <20141103165958.GB51291@FreeBSD.org> In-Reply-To: <20141103165958.GB51291@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 17:38:47 -0000 On 03.11.2014 18:59, Alexey Dokuchaev wrote: > On Wed, Sep 24, 2014 at 08:18:12AM +0000, Alexander Motin wrote: >> New Revision: 272059 >> URL: http://svnweb.freebsd.org/changeset/base/272059 >> >> Log: >> Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one. >> >> Submitted by: Dmitry Luhtionov >> MFC after: 3 days >> >> Modified: >> head/sys/compat/linux/linux_ioctl.c > > Looks like it is also applicable to stable/8, can it be MFCed? Thanks! Done -- r274056. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 17:51:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FCE0722; Mon, 3 Nov 2014 17:51:42 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id B05E91E5; Mon, 3 Nov 2014 17:51:41 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 20F97426C75; Tue, 4 Nov 2014 04:51:33 +1100 (AEDT) Date: Tue, 4 Nov 2014 04:51:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer Subject: Re: svn commit: r274017 - head/sys/kern In-Reply-To: <54573AEE.9010602@freebsd.org> Message-ID: <20141104041847.K1605@besplex.bde.org> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=Qpqu-2hLh1yy2NhiEhkA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 17:51:42 -0000 On Mon, 3 Nov 2014, Julian Elischer wrote: > On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >> Author: mjg >> Date: Mon Nov 3 07:46:51 2014 >> New Revision: 274017 >> URL: https://svnweb.freebsd.org/changeset/base/274017 >> >> Log: >> Provide an on-stack temporary buffer for small ioctl requests. > I'm not sure I like this. We don't know how many more levels > of stack may be needed. 128 bytes is nothing. select() always used a 512-byte array of 2048 bits for similar purposes. poll() uses an array of 32 struct pollfd's similarly. (The names of these seem to have rotted. I think select() used to use the name smallbits, and this was a good name for an array of bits. Now select() uses the name s_selbits for its small array of bits, and poll() uses the name smallbits for its small array of non-bits). The struct is subject to uncontrolled bloat, unlike the bit array which is limited by its hard-coded 2048. struct pollfd actually has size just 8 on all arches, so 32 of it is small. > I know that machines are getting faster with more memory, > but the current move towards bloating out the > worries me. we started out with a single page of stack (SHARED > with the U-area!). I think we are now at several pages.. I forget, is it 8? It is still only 2 plus 1 guard page on i386. KSTACK_PAGES is a bogus option (any use of the option to change it breaks it when the options header is not included). KSTACK_GUARD_PAGES isn't a bogus option, so it can only be changed by editing the source code; then changing it only breaks things previously compiled with the old value. On amd64, it is 4 plus 1. The depth of syscalls is indeed horrifying. Similar techniques were used in Slowaris to blow out its register windows on Sparc many years ago. > I'm open to being persuaded but I think we need to have a discussion > about stack usage. We used to say that anything greater that, say > 64 bytes should probably be allocated. The top level of a syscall should be allowed to use more like a full page (leaving 1 page for everything else). Only the top level can resonably control its usage. >> Modified: >> head/sys/kern/sys_generic.c Excessive quoting not deleted. I will complain about style bugs here instead of in a reply to the original mail. >> Modified: head/sys/kern/sys_generic.c >> ============================================================================== >> --- head/sys/kern/sys_generic.c Mon Nov 3 07:18:42 2014 >> (r274016) >> +++ head/sys/kern/sys_generic.c Mon Nov 3 07:46:51 2014 >> (r274017) >> @@ -649,6 +649,7 @@ sys_ioctl(struct thread *td, struct ioct >> u_long com; >> int arg, error; >> u_int size; >> + u_char smalldata[128]; >> caddr_t data; The bogus type caddr_t is still used. >> if (uap->com > 0xffffffff) { >> @@ -680,17 +681,18 @@ sys_ioctl(struct thread *td, struct ioct >> arg = (intptr_t)uap->data; Bogus cast. intptr_t is only valid on void *, but uap->data has the bogus opaque type caddr_t. >> data = (void *)&arg; The cast is correct. Then it is assumed that the opaque type caddr_t is a pointer. If 'data; had type void *, then no assumptions would be needed here (assumptions and conversions would be needed later, since the KPI has some caddr_t mistakes built in). >> size = 0; >> - } else >> - data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); >> + } else { >> + if (size <= sizeof(smalldata)) >> + data = smalldata; >> + else >> + data = malloc((u_long)size, M_IOCTLOPS, >> M_WAITOK); Style bugs: - old: unnecessary cast to u_long. It was to support unprototyped code. - new: line too long, by blind re-indentation. >> + } >> } else >> data = (void *)&uap->data; Many more bogus casts like this. >> if (com & IOC_IN) { >> error = copyin(uap->data, data, (u_int)size); A more bogus cast to u_int. It was to support unprotyped code, but has been wrong for that for more than 20 years, since copyin()'s KPI was changed to take a size_t. >> - if (error) { >> - if (size > 0) >> - free(data, M_IOCTLOPS); >> - return (error); >> - } >> + if (error != 0) >> + goto out; >> } else if (com & IOC_OUT) { >> /* >> * Zero the buffer so the user always >> @@ -704,7 +706,8 @@ sys_ioctl(struct thread *td, struct ioct >> if (error == 0 && (com & IOC_OUT)) >> error = copyout(data, uap->data, (u_int)size); Another bogus cast for the copyin() family. >> - if (size > 0) >> +out: >> + if (size > 0 && data != (caddr_t)&smalldata) >> free(data, M_IOCTLOPS); 'size' is unsigned, so (size > 0) should be written as (size != 0). Using caddr_t requires another bogus cast here. &smalldata should be written as &smalldata[0] or simply smalldata. The address of the array is subtly different and not wanted here, but reduces to the same in the explicit conversion to caddr_t, assuming that caddr_t is char * like it is, or void *; otherwise, the subtle difference might have an effect. >> return (error); >> } Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:31:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D554E35B for ; Mon, 3 Nov 2014 18:31:12 +0000 (UTC) Received: from nm41-vm10.bullet.mail.bf1.yahoo.com (nm41-vm10.bullet.mail.bf1.yahoo.com [216.109.114.139]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6122380B for ; Mon, 3 Nov 2014 18:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1415039464; bh=+vUPkNeX8MwSFVXqo5MdBU5NjgdkGMmQ4Fx9qEKUgpc=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=O7tTmXfI1n/cKgMOUzYz3kcbIcJaFqfedF+9ZWMTwVLKIT4ib0L0XrwqcXSI6F2LIui437Ru0iJR7D54nQvzWeSYsaW640rKQZt7pp/YANK/P0t4pdDm+2QhF4fLkDyiXJIxRheXYvgRc4Gy3BO3Kc0rL+vRPWntjkUpk19zDXhLRBnbIGzprFVoXVMgGzNuT7ln2ijZqSuK1viboWoJtWXh4ehGdd55UVFxLKhGEj5EDIO9ZcfW/2YpfIS7z7RbYFfz19j9QbP8km6C1ARKoE+GEIaS5jpATPbcgZfXhYO/kAZyKAsrhvvzJ0mPTaJ+mWOzDFNY61Oef7eEdI/OGg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=TIT4NYMye05W+q8qER9b6isdhjiEK9JV5qPpt86P9Lo7ie7SRB+96lolKpKspuNIExM/7vat6b2lPEW7pYMvVx3ctVkllPlyN+ofBiqSl7/yThlzPbM5DGuCnQ6nmtRcSEce/I6J6T7nVR//fGAMNapyOpACmBfTQw1qXCyJzYPYmiOFEq6aAtsNHPzPVkgf1pF6/XSbRx3jJaXxXbLeZa0ykldm/kE4kyijCBbTKMF1Qz8uH+igPlRToSAL6eA6mLxq15jC8RoOKlsL6YF9jVnV+JiUmu9U9Be26U+zyJqzs4gpd4tEMTjBB/xUs9z7q/Y59OFARjyu7VSCPjlGQA==; Received: from [66.196.81.174] by nm41.bullet.mail.bf1.yahoo.com with NNFMP; 03 Nov 2014 18:31:04 -0000 Received: from [98.139.211.161] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 03 Nov 2014 18:31:04 -0000 Received: from [127.0.0.1] by smtp218.mail.bf1.yahoo.com with NNFMP; 03 Nov 2014 18:31:04 -0000 X-Yahoo-Newman-Id: 314158.17203.bm@smtp218.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: XLAgNHgVM1mnS4zBB81Rwocf6NIev3CapArT2tFRYG5zhGR SWQ5O14XzTUGuDKW9acBNJ980rC3Qe0te6GGgk8MDFT8x10XB8DRKRNM0O2a LHASOn701cTC7_e_fituJggcGBsID9t.YwCJ27BSoDfVIMQ0Iw43_X46vEpQ kh5mvJi67k8.nTBnc2VJY68pJqbDjJvZlE_ZlqBYqd2yyl.KDWLi0RuQEOmR ku4Yusm4PhR51vbEqxa09oTbnBHw5dEWRRlDS6XgcjL3BKqlau0yhiEid0IO vZyCzZcGSF.90iKYLQ9DXJT8eUrCheElWHfj6292zQMKeZ0ZU_NOQAgMfuDZ WkgYDp8lAoTsGqB2SR97kg3Yfp40.gbDTyI7eav60gC01JV79GYT_CHNoHQr 7JGLVo8bl0wAANu7XP2kLBGR77dca9xL0WDsHw9j9K6OjzIMCYNtoy1txJry jqGaDESjsQCcaP54O.PRgeYUP9klTvj4MGyP3UBBsZuldY.eLawBk1ei9AUt d4DXYLoJSnDusLgxXi45d6ZO7kcP9xVtKsv4qzhpFsuVZq8y.87xzswpBmM9 CZl6no_KHMtQGBTsoFTvMSM0MkKX95WtAF_8H9vngVlYlnNyzbYUwbW.vAki V7Gzt X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <5457C9E6.5000005@FreeBSD.org> Date: Mon, 03 Nov 2014 13:31:02 -0500 From: Pedro Giffuni Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r272122 - head/lib/libc/stdtime References: <201409251852.s8PIqIRD033822@svn.freebsd.org> <20141103170352.GC51291@FreeBSD.org> In-Reply-To: <20141103170352.GC51291@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 18:31:12 -0000 El 11/3/2014 12:03 PM, Alexey Dokuchaev escribió: > On Thu, Sep 25, 2014 at 06:52:18PM +0000, Pedro F. Giffuni wrote: >> New Revision: 272122 >> URL: http://svnweb.freebsd.org/changeset/base/272122 >> >> Log: >> Add strptime(3) support for %U and %W >> >> Add support for the missing POSIX-2001 %U and %W features: the >> existing FreeBSD strptime code recognizes both directives and >> validates that the week number lies in the permitted range, >> but then simply discards the value. > > I've notivced that recently added support for %t and %n, %s format fix, and > now %U and %W were never MFCed to stable/8. Anything blocks these simply > looking changes there? :) > It's rather risky to add features to branches I don't run. I am not spending more time on stable/8, sorry. Pedro. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 18:50:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FCDD760; Mon, 3 Nov 2014 18:50:26 +0000 (UTC) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD329E4; Mon, 3 Nov 2014 18:50:25 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYIADnNV1RbsIXe/2dsb2JhbABcgw5UTQvOCodHBAICgSQXAQEBAQF9hAMBAQQ6HCMQCw4GBAklDyoeBhOIRQEIyCoBAQEBAQEBAQIBAQEBAQEBFwSREAeESwEElmmCQ4RUllGDeTwvgksBAQE Received: from 222.133-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.133.222]) by relay.skynet.be with ESMTP; 03 Nov 2014 19:50:17 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id sA3IoGmm003616; Mon, 3 Nov 2014 19:50:16 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Mon, 3 Nov 2014 19:50:15 +0100 From: Tijl Coosemans To: Konstantin Belousov Subject: Re: svn commit: r274040 - in head/sys: conf dev/agp Message-ID: <20141103195015.7d78af57@kalimero.tijl.coosemans.org> In-Reply-To: <201411031149.sA3BnaNe053503@svn.freebsd.org> References: <201411031149.sA3BnaNe053503@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 18:50:26 -0000 On Mon, 3 Nov 2014 11:49:36 +0000 (UTC) Konstantin Belousov wrote: > Author: kib > Date: Mon Nov 3 11:49:35 2014 > New Revision: 274040 > URL: https://svnweb.freebsd.org/changeset/base/274040 > > Log: > agp_intel.c provides support for AGP on Intel chipsets from 440/BX to > 875. This intersects with the agp_i810.c, which supports all Intels > from i810 to Core i5/7. Both agp_intel.c and agp_i810.c are compiled > into kernel when device agp is specified in config, and agp_i810 > attach seems to be selected by chance due to linking order. I think agp_intel are the plain AGP chipsets while agp_i810 are the integrated graphics. None of the device IDs you deleted from agp_intel appear in agp_i810. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:00:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80140A77; Mon, 3 Nov 2014 19:00:35 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 5B752AE1; Mon, 3 Nov 2014 19:00:35 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9B6F45A9F25; Mon, 3 Nov 2014 19:00:29 +0000 (UTC) Date: Mon, 3 Nov 2014 19:00:29 +0000 From: Brooks Davis To: John-Mark Gurney Subject: Re: svn commit: r273955 - in head: etc/rc.d share/man/man7 Message-ID: <20141103190029.GB29192@spindle.one-eyed-alien.net> References: <201411020011.sA20BQsh038825@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <201411020011.sA20BQsh038825@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:00:35 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 02, 2014 at 12:11:26AM +0000, John-Mark Gurney wrote: > Author: jmg > Date: Sun Nov 2 00:11:25 2014 > New Revision: 273955 > URL: https://svnweb.freebsd.org/changeset/base/273955 >=20 > Log: > add an rc.d script to automatically grow the specified FS... It has > been tested on both MBR and GPT... It won't be enabled until you add > growfs_enable=3D"YES" and will only run on first boot.. Nice. I've been wanting something like this for our boards. A few comments: - It looks like the current script doesn't support specifying a file system and just finds the root dev. As a practical matter being able to specify one probably isn't useful without doing the work to extend the last partition on a device, but I could see cases where /usr or the like is on removable media an / is an mdroot or otherwise on fixed size storage. - Being able to specify a size would be useful. For example, I might want to growfs to 2GB by default and expand to the media size later if warranted. - A configurable delay during which ^C causes growfs to be skipped would be useful when testing an image. Growfs on large or very slow media is something I'd like to be able to avoid when I'm just testing. - The shell lines should probably use tab for indentation to match system style and the awk bits. -- Brooks --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRX0MwACgkQXY6L6fI4GtRklwCfRT1aTetq0Kr87b8tfMb3pwTt 2JsAoJbBpyzXvRsBHJlIsqHfyqJrYmh+ =bVWY -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:03:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B9D3BEA; Mon, 3 Nov 2014 19:03:32 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8A41FBA0; Mon, 3 Nov 2014 19:03:31 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9FC4F427506; Tue, 4 Nov 2014 06:03:29 +1100 (AEDT) Date: Tue, 4 Nov 2014 06:03:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r274017 - head/sys/kern In-Reply-To: <20141103100847.GK53947@kib.kiev.ua> Message-ID: <20141104045159.E1605@besplex.bde.org> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=PoEtwIM4494oexjmwzAA:9 a=CjuIK1q_8ugA:10 Cc: Hans Petter Selasky , Mateusz Guzik , Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:03:32 -0000 On Mon, 3 Nov 2014, Konstantin Belousov wrote: > On Mon, Nov 03, 2014 at 10:21:32AM +0100, Mateusz Guzik wrote: >> On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: >>> On 11/03/14 09:23, Julian Elischer wrote: >>>> On 11/3/14, 4:21 PM, Julian Elischer wrote: >>>>> On 11/3/14, 3:46 PM, Mateusz Guzik wrote: >>>>>> Author: mjg >>>>>> Date: Mon Nov 3 07:46:51 2014 >>>>>> New Revision: 274017 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/274017 >>>>>> >>>>>> Log: >>>>>> Provide an on-stack temporary buffer for small ioctl requests. >>>>> I'm not sure I like this. We don't know how many more levels >>>>> of stack may be needed. >>>>> I know that machines are getting faster with more memory, >>>>> but the current move towards bloating out the >>>> ... "bloating out the stack" ... >>>>> worries me. we started out with a single page of stack (SHARED >>>>> with the U-area!). I think we are now at several pages.. I forget, is >>>>> it 8? >>>>> I'm open to being persuaded but I think we need to have a discussion >>>>> about stack usage. We used to say that anything greater that, say >>>>> 64 bytes should probably be allocated. >>> >>> I think this patch can give a benefit for the USB stack and CUSE4BSD, >>> because it does frequent IOCTLs. Regarding the stack usage, maybe >>> this general purpose optimisation can be allocated from the thread >>> structure? >> >> I was considering something like that. The idea is that frequently >> allocating threads could allocate, say, 1KB from malloc and use that >> to satisfy their needs. This definitely helps offenders with longer >> lifespan, but does not help short-lived ones. > Allocating 1KB by malloc() consumes that memory for the whole > lifespan of the thread, and the memory sit unused except some > short periods. For the stack allocation which you did, at least > the memory is reused when needed (i.e. when syscalls other than > ioctl(2) are executing). Indeed, the top level of a syscall can allocate a fixed amount in the thread struct, but this is little different from allocating a fixed amount on the stack, except with in the thread struct it always costs, while on the stack it is free provided you don't expand the stack to match. This optimization is probably minor, but reminds me of other syscalls that would benefit using a single largish allocation up front: - all vfs calls that start with namei(). They allocate PATH_MAX (1K) bytes and more. An 8K stack has plently to spare after allocating 1K. However, if malloc() is used then the PATH_MAX limit shouldn't exist. Only a limit to prevent denial of service is needed. - send()/recv() begin with getsockaddr() which uses plain malloc() (not even a uma zone) to allocate a small struct. The overhead from this is significant for small packets if there is not too much bloat elsewhere. > That said, you could slightly improve the code by using > __builtin_alloc() instead of unconditionally reserving memory on stack. __builtin_alloca() > This will simultaneosly reduce the stack usage, since you only allocate > as much as needed, and also avoid stack space waste when fallback to > malloc() is required anyway. Why not just use a C99 VLA? It doesn't require any compiler magic except being a C99 compiler (I haven't seen any of those yet, but some approximate C99 for VLAs). You (kib) didn't like using alloca() when I tried to talk you into using it to get aligned structs for SSE long ago. __builtin_alloca() has more chance of forcing the alignment than VLA,s but this is fragile. FreeBSD still uses -mpreferred-stack-boundary on i386 with gcc. This option is broken (unsupported) with clang, but is less needed since clang does alignment better. A quick check shows that alloca and __builtin_alloca() but not arrays (variable or fixed size) with __aligned(16) work with gcc-4.2.1. gcc aligns the stack to a 16-byte boundary using andl with %esp on every alloca() call even without -mpreferred-stack-boundary=2, but for objects on the stack aligned using __aligned(16) it depends on its pessimization of the caller aligning things to a 16-byte boundary, and -mpreferred-stack-boundary=2 gives only 4-byte alignment. Alignments of more than 16 ae just broken in gcc, except possibly using -mpreferred-stack-boundary=5 to get 32-bit alignment, etc. Everything seems to work perfectly with clang and arrays, but not using alloca() or __builtin_alloca(): char *s = __builtin_alloca(127); This gives 16-byte alignment with gcc in cases where it works, but with clang it gives perfect misalignment (start with an aligned address and subtract 127 from it). By choosing the allocation amount to be a multiple of 16 or that plus a suitable multiple of 4, a final alignment of 16 can be arranged for clang too. char s[127]; I think all compilers align this. char s[127] __aligned(N); For N = 8, 16, 32, ..., clang generates the necessary andl with %esp to align things. For N = 4, no andl is necessary. gcc-4.2.1 is just broken for N > 4 with -mpreferred-stack-boundary=2 and for N > 16 by default, since it never does the necessary andl's. (clang also does "andl $-8,%esp" as necessary to align for int64_t and double variables, but interestingly, generates no andl for long double variables. Its default stack boundary is just 4, and that is best -- only align as required in the few functions that have 64-bit variables or __aligned() directives.) So if you need 4-byte alignment, then __builtin_alloca() is good enough for both gcc and clang. 4-byte alignment is usually enough on i386, but is less than what malloc() gives. Otherwise, using __builtin_alloca() is best for gcc-4.2.1 and using a an array or VLA with __aligned(16) is best for clang. The u_char arrays with no alignment statements for select() and now ioctl() are technically broken since they are not required to be aligned but are used to hold objects that are required to be aligned (even the select bits are accessed as fd_mask = u_long objects). They only workd because the compiler optimizes large arrays by giving them more alignment than strictly required. How do the __builtin_alloca()'s in your FP code (recently synced to i386 where alignment is more difficult by jhb) work? I think they give 16-byte alignment in all cases, but some cases seem to need 64-byte alignment and do this by hand. Old code seems to be little changed, so I think it still does 16-byte alignment by hand. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:16:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5277B1D8; Mon, 3 Nov 2014 19:16:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6B6CCB; Mon, 3 Nov 2014 19:16:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3JGR2C066330; Mon, 3 Nov 2014 19:16:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3JGQ6l066327; Mon, 3 Nov 2014 19:16:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411031916.sA3JGQ6l066327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Nov 2014 19:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274057 - in head/sys/i386: i386 isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:16:27 -0000 Author: jhb Date: Mon Nov 3 19:16:25 2014 New Revision: 274057 URL: https://svnweb.freebsd.org/changeset/base/274057 Log: Move all of the XSAVE support under #ifdef I686_CPU and fix the build without I686_CPU. Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/isa/npx.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Nov 3 17:37:49 2014 (r274056) +++ head/sys/i386/i386/machdep.c Mon Nov 3 19:16:25 2014 (r274057) @@ -670,10 +670,14 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs = td->td_frame; oonstack = sigonstack(regs->tf_esp); +#ifdef CPU_ENABLE_SSE if (cpu_max_ext_state_size > sizeof(union savefpu) && use_xsave) { xfpusave_len = cpu_max_ext_state_size - sizeof(union savefpu); xfpusave = __builtin_alloca(xfpusave_len); } else { +#else + { +#endif xfpusave_len = 0; xfpusave = NULL; } @@ -2908,7 +2912,9 @@ init386(first) unsigned long gdtmachpfn; int error, gsel_tss, metadata_missing, x, pa; struct pcpu *pc; +#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; +#endif struct callback_register event = { .type = CALLBACKTYPE_event, .address = {GSEL(GCODE_SEL, SEL_KPL), (unsigned long)Xhypervisor_callback }, @@ -3117,11 +3123,13 @@ init386(first) */ thread0.td_pcb = get_pcb_td(&thread0); bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); +#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + 1); xhdr->xstate_bv = xsave_mask; } +#endif PCPU_SET(curpcb, thread0.td_pcb); /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ @@ -3162,7 +3170,9 @@ init386(first) struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; +#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; +#endif thread0.td_kstack = proc0kstack; thread0.td_kstack_pages = KSTACK_PAGES; @@ -3417,11 +3427,13 @@ init386(first) */ thread0.td_pcb = get_pcb_td(&thread0); bzero(get_pcb_user_save_td(&thread0), cpu_max_ext_state_size); +#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(get_pcb_user_save_td(&thread0) + 1); xhdr->xstate_bv = xsave_mask; } +#endif PCPU_SET(curpcb, thread0.td_pcb); /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ @@ -3886,7 +3898,9 @@ static void get_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpusave, size_t xfpusave_len) { +#ifdef CPU_ENABLE_SSE size_t max_len, len; +#endif #ifndef DEV_NPX mcp->mc_fpformat = _MC_FPFMT_NODEV; @@ -3897,6 +3911,7 @@ get_fpcontext(struct thread *td, mcontex bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], sizeof(mcp->mc_fpstate)); mcp->mc_fpformat = npxformat(); +#ifdef CPU_ENABLE_SSE if (!use_xsave || xfpusave_len == 0) return; max_len = cpu_max_ext_state_size - sizeof(union savefpu); @@ -3909,6 +3924,7 @@ get_fpcontext(struct thread *td, mcontex mcp->mc_xfpustate_len = len; bcopy(get_pcb_user_save_td(td) + 1, xfpusave, len); #endif +#endif } static int Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Mon Nov 3 17:37:49 2014 (r274056) +++ head/sys/i386/i386/vm_machdep.c Mon Nov 3 19:16:25 2014 (r274057) @@ -106,6 +106,10 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +#if !defined(CPU_DISABLE_SSE) && defined(I686_CPU) +#define CPU_ENABLE_SSE +#endif + _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), @@ -152,14 +156,18 @@ void * alloc_fpusave(int flags) { void *res; +#ifdef CPU_ENABLE_SSE struct savefpu_ymm *sf; +#endif res = malloc(cpu_max_ext_state_size, M_DEVBUF, flags); +#ifdef CPU_ENABLE_SSE if (use_xsave) { sf = (struct savefpu_ymm *)res; bzero(&sf->sv_xstate.sx_hd, sizeof(sf->sv_xstate.sx_hd)); sf->sv_xstate.sx_hd.xstate_bv = xsave_mask; } +#endif return (res); } /* @@ -398,17 +406,21 @@ void cpu_thread_alloc(struct thread *td) { struct pcb *pcb; +#ifdef CPU_ENABLE_SSE struct xstate_hdr *xhdr; +#endif td->td_pcb = pcb = get_pcb_td(td); td->td_frame = (struct trapframe *)((caddr_t)pcb - 16) - 1; pcb->pcb_ext = NULL; pcb->pcb_save = get_pcb_user_save_pcb(pcb); +#ifdef CPU_ENABLE_SSE if (use_xsave) { xhdr = (struct xstate_hdr *)(pcb->pcb_save + 1); bzero(xhdr, sizeof(*xhdr)); xhdr->xstate_bv = xsave_mask; } +#endif } void Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Mon Nov 3 17:37:49 2014 (r274056) +++ head/sys/i386/isa/npx.c Mon Nov 3 19:16:25 2014 (r274057) @@ -212,17 +212,21 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); +#ifdef CPU_ENABLE_SSE int use_xsave; uint64_t xsave_mask; +#endif static uma_zone_t fpu_save_area_zone; static union savefpu *npx_initialstate; +#ifdef CPU_ENABLE_SSE struct xsave_area_elm_descr { u_int offset; u_int size; } *xsave_area_desc; static int use_xsaveopt; +#endif static volatile u_int npx_traps_while_probing; @@ -338,6 +342,7 @@ cleanup: return (hw_float); } +#ifdef CPU_ENABLE_SSE /* * Enable XSAVE if supported and allowed by user. * Calculate the xsave_mask. @@ -373,13 +378,15 @@ npxinit_bsp1(void) if ((cp[0] & CPUID_EXTSTATE_XSAVEOPT) != 0) use_xsaveopt = 1; } - +#endif /* + * Calculate the fpu save area size. */ static void npxinit_bsp2(void) { +#ifdef CPU_ENABLE_SSE u_int cp[4]; if (use_xsave) { @@ -392,6 +399,7 @@ npxinit_bsp2(void) do_cpuid(1, cp); cpu_feature2 = cp[2]; } else +#endif cpu_max_ext_state_size = sizeof(union savefpu); } @@ -403,19 +411,25 @@ npxinit(bool bsp) { static union savefpu dummy; register_t saveintr; +#ifdef CPU_ENABLE_SSE u_int mxcsr; +#endif u_short control; if (bsp) { if (!npx_probe()) return; +#ifdef CPU_ENABLE_SSE npxinit_bsp1(); +#endif } +#ifdef CPU_ENABLE_SSE if (use_xsave) { load_cr4(rcr4() | CR4_XSAVE); load_xcr(XCR0, xsave_mask); } +#endif /* * XCR0 shall be set up before CPU can report the save area size. @@ -459,7 +473,9 @@ static void npxinitstate(void *arg __unused) { register_t saveintr; +#ifdef CPU_ENABLE_SSE int cp[4], i, max_ext_n; +#endif if (!hw_float) return; @@ -495,6 +511,7 @@ npxinitstate(void *arg __unused) bzero(npx_initialstate->sv_87.sv_ac, sizeof(npx_initialstate->sv_87.sv_ac)); +#ifdef CPU_ENABLE_SSE /* * Create a table describing the layout of the CPU Extended * Save Area. @@ -519,6 +536,7 @@ npxinitstate(void *arg __unused) xsave_area_desc[i].size = cp[0]; } } +#endif fpu_save_area_zone = uma_zcreate("FPU_save_area", cpu_max_ext_state_size, NULL, NULL, NULL, NULL, @@ -897,9 +915,11 @@ npxsave(addr) { stop_emulating(); +#ifdef CPU_ENABLE_SSE if (use_xsaveopt) xsaveopt((char *)addr, xsave_mask); else +#endif fpusave(addr); start_emulating(); PCPU_SET(fpcurthread, NULL); @@ -972,9 +992,12 @@ int npxgetregs(struct thread *td) { struct pcb *pcb; +#ifdef CPU_ENABLE_SSE uint64_t *xstate_bv, bit; char *sa; - int max_ext_n, i, owned; + int max_ext_n, i; +#endif + int owned; if (!hw_float) return (_MC_FPOWNED_NONE); @@ -1004,6 +1027,7 @@ npxgetregs(struct thread *td) owned = _MC_FPOWNED_PCB; } critical_exit(); +#ifdef CPU_ENABLE_SSE if (use_xsave) { /* * Handle partially saved state. @@ -1026,6 +1050,7 @@ npxgetregs(struct thread *td) *xstate_bv |= bit; } } +#endif return (owned); } @@ -1040,6 +1065,7 @@ npxuserinited(struct thread *td) pcb->pcb_flags |= PCB_NPXUSERINITDONE; } +#ifdef CPU_ENABLE_SSE int npxsetxstate(struct thread *td, char *xfpustate, size_t xfpustate_size) { @@ -1077,13 +1103,16 @@ npxsetxstate(struct thread *td, char *xf return (0); } +#endif int npxsetregs(struct thread *td, union savefpu *addr, char *xfpustate, size_t xfpustate_size) { struct pcb *pcb; +#ifdef CPU_ENABLE_SSE int error; +#endif if (!hw_float) return (ENXIO); @@ -1091,12 +1120,12 @@ npxsetregs(struct thread *td, union save pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { +#ifdef CPU_ENABLE_SSE error = npxsetxstate(td, xfpustate, xfpustate_size); if (error != 0) { critical_exit(); return (error); } -#ifdef CPU_ENABLE_SSE if (!cpu_fxsr) #endif fnclex(); /* As in npxdrop(). */ @@ -1106,9 +1135,11 @@ npxsetregs(struct thread *td, union save pcb->pcb_flags |= PCB_NPXUSERINITDONE | PCB_NPXINITDONE; } else { critical_exit(); +#ifdef CPU_ENABLE_SSE error = npxsetxstate(td, xfpustate, xfpustate_size); if (error != 0) return (error); +#endif bcopy(addr, get_pcb_user_save_td(td), sizeof(*addr)); npxuserinited(td); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:20:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56DC8332; Mon, 3 Nov 2014 19:20:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42B4CCE5; Mon, 3 Nov 2014 19:20:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3JKBoB066886; Mon, 3 Nov 2014 19:20:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3JKB6f066885; Mon, 3 Nov 2014 19:20:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411031920.sA3JKB6f066885@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 3 Nov 2014 19:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274058 - stable/8/sys/compat/linux X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:20:11 -0000 Author: mav Date: Mon Nov 3 19:20:10 2014 New Revision: 274058 URL: https://svnweb.freebsd.org/changeset/base/274058 Log: Fix build breakage of r274056. Modified: stable/8/sys/compat/linux/linux_ioctl.c Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 19:16:25 2014 (r274057) +++ stable/8/sys/compat/linux/linux_ioctl.c Mon Nov 3 19:20:10 2014 (r274058) @@ -1746,7 +1746,7 @@ linux_ioctl_sound(struct thread *td, str switch ((args->cmd >> 16) & 0x1fff) { case 0x005c: { /* SOUND_MIXER_INFO */ args->cmd = SOUND_MIXER_INFO; - return (sys_ioctl(td, (struct ioctl_args *)args)); + return (ioctl(td, (struct ioctl_args *)args)); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:23:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EB4F56E; Mon, 3 Nov 2014 19:23:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B482DA7; Mon, 3 Nov 2014 19:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3JNop9070700; Mon, 3 Nov 2014 19:23:50 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3JNohL070699; Mon, 3 Nov 2014 19:23:50 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411031923.sA3JNohL070699@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 3 Nov 2014 19:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274059 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:23:50 -0000 Author: jmg Date: Mon Nov 3 19:23:49 2014 New Revision: 274059 URL: https://svnweb.freebsd.org/changeset/base/274059 Log: use tab instead of spaces like the rest of the file.. Modified: head/etc/rc.d/syscons Modified: head/etc/rc.d/syscons ============================================================================== --- head/etc/rc.d/syscons Mon Nov 3 19:20:10 2014 (r274058) +++ head/etc/rc.d/syscons Mon Nov 3 19:23:49 2014 (r274059) @@ -139,7 +139,7 @@ uk.*) echo uk;; us.iso.acc) echo us.acc;; us.pc-ctrl) echo us.ctrl;; us.iso) echo us;; - esac + esac } kbdcontrol_load_keymap() From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 19:36:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 350C39E6; Mon, 3 Nov 2014 19:36:06 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id D52B0EC5; Mon, 3 Nov 2014 19:36:05 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.60.3]) by phk.freebsd.dk (Postfix) with ESMTP id 31CE93BD2B; Mon, 3 Nov 2014 19:35:59 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id sA3JZutc079455; Mon, 3 Nov 2014 19:35:57 GMT (envelope-from phk@phk.freebsd.dk) To: Bruce Evans Subject: Re: svn commit: r274017 - head/sys/kern In-reply-to: <20141104045159.E1605@besplex.bde.org> From: "Poul-Henning Kamp" References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <79453.1415043356.1@critter.freebsd.dk> Date: Mon, 03 Nov 2014 19:35:56 +0000 Message-ID: <79454.1415043356@critter.freebsd.dk> X-Mailman-Approved-At: Mon, 03 Nov 2014 20:09:47 +0000 Cc: Hans Petter Selasky , Mateusz Guzik , Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 19:36:06 -0000 -------- In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: >This optimization is probably minor, but reminds me of other syscalls >that would benefit using a single largish allocation up front: >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > bytes and more. An 8K stack has plently to spare after allocating > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't > exist. Only a limit to prevent denial of service is needed. We should actually roll a new rev of all syscalls which take a path and have them pass strlen(path)+1 into the kernel. That would allow both precise allocation and faster copyin, followed by a check that the last byte is (still) a NUL. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:03:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1C42B83; Mon, 3 Nov 2014 21:03:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E86BA77; Mon, 3 Nov 2014 21:03:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3L3tg7018868; Mon, 3 Nov 2014 21:03:55 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3L3tmi018867; Mon, 3 Nov 2014 21:03:55 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411032103.sA3L3tmi018867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Mon, 3 Nov 2014 21:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274060 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:03:55 -0000 Author: jmg Date: Mon Nov 3 21:03:54 2014 New Revision: 274060 URL: https://svnweb.freebsd.org/changeset/base/274060 Log: switch from spaces to tabs to match style and awk... Pointed out by: brooks Modified: head/etc/rc.d/growfs Modified: head/etc/rc.d/growfs ============================================================================== --- head/etc/rc.d/growfs Mon Nov 3 19:23:49 2014 (r274059) +++ head/etc/rc.d/growfs Mon Nov 3 21:03:54 2014 (r274060) @@ -49,20 +49,20 @@ rcvar="growfs_enable" growfs_start () { - echo "Growing root partition to fill device" - rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }') - if [ x"$rootdev" = x"${rootdev%/*}" ]; then - # raw device - rawdev="$rootdev" - else - rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }') - if [ x"$rawdev" = x"" ]; then - echo "Can't figure out device for: $rootdev" - return + echo "Growing root partition to fill device" + rootdev=$(df / | tail -n 1 | awk '{ sub("/dev/", "", $1); print $1 }') + if [ x"$rootdev" = x"${rootdev%/*}" ]; then + # raw device + rawdev="$rootdev" + else + rawdev=$(glabel status | awk '$1 == "'"$rootdev"'" { print $3 }') + if [ x"$rawdev" = x"" ]; then + echo "Can't figure out device for: $rootdev" + return + fi fi - fi - sysctl -b kern.geom.conftxt | awk ' + sysctl -b kern.geom.conftxt | awk ' { lvl=$1 device[lvl] = $3 @@ -91,7 +91,7 @@ growfs_start () exit 0 } }' dev="$rawdev" - growfs -y /dev/"$rootdev" + growfs -y /dev/"$rootdev" } load_rc_config $name From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:04:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E98FCBF; Mon, 3 Nov 2014 21:04:08 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 39C33A7B; Mon, 3 Nov 2014 21:04:07 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sA3L46v1091767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Nov 2014 13:04:06 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sA3L46o1091766; Mon, 3 Nov 2014 13:04:06 -0800 (PST) (envelope-from jmg) Date: Mon, 3 Nov 2014 13:04:06 -0800 From: John-Mark Gurney To: Brooks Davis Subject: Re: svn commit: r273955 - in head: etc/rc.d share/man/man7 Message-ID: <20141103210406.GF8852@funkthat.com> References: <201411020011.sA20BQsh038825@svn.freebsd.org> <20141103190029.GB29192@spindle.one-eyed-alien.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103190029.GB29192@spindle.one-eyed-alien.net> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 03 Nov 2014 13:04:07 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:04:08 -0000 Brooks Davis wrote this message on Mon, Nov 03, 2014 at 19:00 +0000: > On Sun, Nov 02, 2014 at 12:11:26AM +0000, John-Mark Gurney wrote: > > Author: jmg > > Date: Sun Nov 2 00:11:25 2014 > > New Revision: 273955 > > URL: https://svnweb.freebsd.org/changeset/base/273955 > > > > Log: > > add an rc.d script to automatically grow the specified FS... It has > > been tested on both MBR and GPT... It won't be enabled until you add > > growfs_enable="YES" and will only run on first boot.. > > Nice. I've been wanting something like this for our boards. A few > comments: > > - It looks like the current script doesn't support specifying a file > system and just finds the root dev. As a practical matter being able > to specify one probably isn't useful without doing the work to extend > the last partition on a device, but I could see cases where /usr or the > like is on removable media an / is an mdroot or otherwise on fixed size > storage. This wouldn't be hard to fix, but is complicated by the fact that I'm using awk to do this work, so if /usr is not mounted yet, the script won't work... Hmm... I think that this is the bug that is referenced in the comment.. > - Being able to specify a size would be useful. For example, I might want > to growfs to 2GB by default and expand to the media size later if > warranted. This shouldn't be too hard to add... Just adding an arg to the resize command... > - A configurable delay during which ^C causes growfs to be skipped would > be useful when testing an image. Growfs on large or very slow media is > something I'd like to be able to avoid when I'm just testing. So, by default, this doesn't run, and I believe also, because of the firstboot keyword, only when the firstboot file is present... We might want to have an option to override that so that it runs on every boot.. > - The shell lines should probably use tab for indentation to match system > style and the awk bits. Hmm.. yeh.. I based it on another script that had this style, though I ended up gutting it, but ended keeping the style... I'll fix this up... looks like nsswitch has a similar problem... I've fixed this in r274060... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:21:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 060941A0; Mon, 3 Nov 2014 21:21:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E625BBCF; Mon, 3 Nov 2014 21:21:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3LL8As026950; Mon, 3 Nov 2014 21:21:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3LL8DX026949; Mon, 3 Nov 2014 21:21:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411032121.sA3LL8DX026949@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 21:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274061 - head/contrib/netbsd-tests/lib/libc/db 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:21:09 -0000 Author: ngie Date: Mon Nov 3 21:21:08 2014 New Revision: 274061 URL: https://svnweb.freebsd.org/changeset/base/274061 Log: Port t_db.sh to FreeBSD - The blocksize on FreeBSD is 32kB, not 64kB - Add some detection for MK_DICT == no; /nonexistent is echoed along with atf_skip to ensure that the test will fail if dict(..) is called in the non-final stage of the pipeline Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/db/t_db.sh Modified: head/contrib/netbsd-tests/lib/libc/db/t_db.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/db/t_db.sh Mon Nov 3 21:03:54 2014 (r274060) +++ head/contrib/netbsd-tests/lib/libc/db/t_db.sh Mon Nov 3 21:21:08 2014 (r274061) @@ -41,6 +41,18 @@ dict() fi } +# Begin FreeBSD +dict() +{ + if [ -f /usr/share/dict/words ]; then + echo /usr/share/dict/words + else + echo /nonexistent + atf_skip "Test requires dict/words" + fi +} +# End FreeBSD + SEVEN_SEVEN="abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg" atf_test_case small_btree @@ -887,7 +899,15 @@ r k1234 EOF + # Begin FreeBSD + if true; then + atf_check "$(prog)" -i bsize=32768 hash in + else + # End FreeBSD atf_check "$(prog)" -i bsize=65536 hash in + # Begin FreeBSD + fi + # End FreeBSD } atf_init_test_cases() From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:26:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7ACB42C; Mon, 3 Nov 2014 21:26:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3C50C8A; Mon, 3 Nov 2014 21:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3LQCFw030120; Mon, 3 Nov 2014 21:26:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3LQC1m030119; Mon, 3 Nov 2014 21:26:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411032126.sA3LQC1m030119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 21:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274062 - head/contrib/netbsd-tests/lib/libc/inet 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:26:12 -0000 Author: ngie Date: Mon Nov 3 21:26:11 2014 New Revision: 274062 URL: https://svnweb.freebsd.org/changeset/base/274062 Log: inet_network on FreeBSD returns NULL when provided "0x" to inet_network Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c Modified: head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c Mon Nov 3 21:21:08 2014 (r274061) +++ head/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c Mon Nov 3 21:26:11 2014 (r274062) @@ -144,7 +144,11 @@ ATF_TC_BODY(inet_network_err, tc) H_REQUIRE(".", 0xffffffff); H_REQUIRE("1.", 0xffffffff); H_REQUIRE(".1", 0xffffffff); +#if defined(__FreeBSD__) || defined(__APPLE__) + H_REQUIRE("0x", 0x0); +#else H_REQUIRE("0x", 0xffffffff); +#endif H_REQUIRE("", 0xffffffff); H_REQUIRE(" ", 0xffffffff); H_REQUIRE("bar", 0xffffffff); From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:45:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 494459A5; Mon, 3 Nov 2014 21:45:24 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 35ACBE87; Mon, 3 Nov 2014 21:45:24 +0000 (UTC) Received: from AlfredMacbookAir.local (unknown [129.253.54.225]) by elvis.mu.org (Postfix) with ESMTPSA id 47E8C341F84E; Mon, 3 Nov 2014 13:45:22 -0800 (PST) Message-ID: <5457F771.3010509@freebsd.org> Date: Mon, 03 Nov 2014 13:45:21 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> In-Reply-To: <201411030746.sA37kpPu037113@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:45:24 -0000 Isn't there a problem where the stack can be swapped out? I seem to recall a problem where a swapped out process was causing problems due to a buffer passed being stack allocated and that process being swapped out... If this is not the case then please disregard. -Alfred On 11/2/14, 11:46 PM, Mateusz Guzik wrote: > Author: mjg > Date: Mon Nov 3 07:46:51 2014 > New Revision: 274017 > URL: https://svnweb.freebsd.org/changeset/base/274017 > > Log: > Provide an on-stack temporary buffer for small ioctl requests. > > Modified: > head/sys/kern/sys_generic.c > > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Mon Nov 3 07:18:42 2014 (r274016) > +++ head/sys/kern/sys_generic.c Mon Nov 3 07:46:51 2014 (r274017) > @@ -649,6 +649,7 @@ sys_ioctl(struct thread *td, struct ioct > u_long com; > int arg, error; > u_int size; > + u_char smalldata[128]; > caddr_t data; > > if (uap->com > 0xffffffff) { > @@ -680,17 +681,18 @@ sys_ioctl(struct thread *td, struct ioct > arg = (intptr_t)uap->data; > data = (void *)&arg; > size = 0; > - } else > - data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + } else { > + if (size <= sizeof(smalldata)) > + data = smalldata; > + else > + data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + } > } else > data = (void *)&uap->data; > if (com & IOC_IN) { > error = copyin(uap->data, data, (u_int)size); > - if (error) { > - if (size > 0) > - free(data, M_IOCTLOPS); > - return (error); > - } > + if (error != 0) > + goto out; > } else if (com & IOC_OUT) { > /* > * Zero the buffer so the user always > @@ -704,7 +706,8 @@ sys_ioctl(struct thread *td, struct ioct > if (error == 0 && (com & IOC_OUT)) > error = copyout(data, uap->data, (u_int)size); > > - if (size > 0) > +out: > + if (size > 0 && data != (caddr_t)&smalldata) > free(data, M_IOCTLOPS); > return (error); > } > From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 21:49:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83977C1C; Mon, 3 Nov 2014 21:49:07 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAA3EEB8; Mon, 3 Nov 2014 21:49:06 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D3FAD1FE022; Mon, 3 Nov 2014 22:49:04 +0100 (CET) Message-ID: <5457F85C.3040807@selasky.org> Date: Mon, 03 Nov 2014 22:49:16 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Alfred Perlstein , Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274017 - head/sys/kern References: <201411030746.sA37kpPu037113@svn.freebsd.org> <5457F771.3010509@freebsd.org> In-Reply-To: <5457F771.3010509@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 21:49:07 -0000 On 11/03/14 22:45, Alfred Perlstein wrote: > + u_char smalldata[128]; You should make sure the smalldata is properly aligned, hence on ARM it might cause aligment faults, if fields inside the IOCTL are not accessed with proper alignment. --HPS From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:17:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60BD94D7; Mon, 3 Nov 2014 22:17:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C89A26C; Mon, 3 Nov 2014 22:17:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3MHQvs056710; Mon, 3 Nov 2014 22:17:26 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3MHQSj056709; Mon, 3 Nov 2014 22:17:26 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411032217.sA3MHQSj056709@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Mon, 3 Nov 2014 22:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274063 - head/sys/dev/virtio/console 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 22:17:26 -0000 Author: bryanv Date: Mon Nov 3 22:17:25 2014 New Revision: 274063 URL: https://svnweb.freebsd.org/changeset/base/274063 Log: Create the tty device after the port is completely initialized This fixes a race with a tty open before the host is the ready. MFC after: 1 month Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Mon Nov 3 21:26:11 2014 (r274062) +++ head/sys/dev/virtio/console/virtio_console.c Mon Nov 3 22:17:25 2014 (r274063) @@ -1048,17 +1048,17 @@ vtcon_port_create(struct vtcon_softc *sc return (error); } - tty_makedev(port->vtcport_tty, NULL, "%s%r.%r", VTCON_TTY_PREFIX, - device_get_unit(dev), id); - VTCON_LOCK(sc); VTCON_PORT_LOCK(port); - vtcon_port_enable_intr(port); scport->vcsp_port = port; + vtcon_port_enable_intr(port); vtcon_port_submit_event(port, VIRTIO_CONSOLE_PORT_READY, 1); VTCON_PORT_UNLOCK(port); VTCON_UNLOCK(sc); + tty_makedev(port->vtcport_tty, NULL, "%s%r.%r", VTCON_TTY_PREFIX, + device_get_unit(dev), id); + return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:19:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D72C6F3; Mon, 3 Nov 2014 22:19:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59E7628C; Mon, 3 Nov 2014 22:19:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3MJjPC057022; Mon, 3 Nov 2014 22:19:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3MJjT5057021; Mon, 3 Nov 2014 22:19:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201411032219.sA3MJjT5057021@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 3 Nov 2014 22:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274064 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 22:19:45 -0000 Author: bdrewery Date: Mon Nov 3 22:19:44 2014 New Revision: 274064 URL: https://svnweb.freebsd.org/changeset/base/274064 Log: Remove MAINTAINER line for binutils. It has not been maintained by obrien since 2008. Approved by: core Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Nov 3 22:17:25 2014 (r274063) +++ head/MAINTAINERS Mon Nov 3 22:19:44 2014 (r274064) @@ -78,7 +78,6 @@ inetd dwmalone Recommends pre-commit re contrib/smbfs bp Open for in-tree committs. In case of functional changes pre-commit review requested. contrib/pf glebius Pre-commit review recommended. -binutils obrien Insists on BU blocked from unapproved commits file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 22:37:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA7B1AEE; Mon, 3 Nov 2014 22:37:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC3F1666; Mon, 3 Nov 2014 22:37:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3MbBZ3065991; Mon, 3 Nov 2014 22:37:11 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3MbANj065983; Mon, 3 Nov 2014 22:37:10 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411032237.sA3MbANj065983@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Mon, 3 Nov 2014 22:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274065 - in head/sys: amd64/conf conf i386/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 22:37:12 -0000 Author: bryanv Date: Mon Nov 3 22:37:10 2014 New Revision: 274065 URL: https://svnweb.freebsd.org/changeset/base/274065 Log: Add VirtIO console to the x86 NOTES and files Requested by: jhb Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Nov 3 22:19:44 2014 (r274064) +++ head/sys/amd64/conf/NOTES Mon Nov 3 22:37:10 2014 (r274065) @@ -492,6 +492,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device device virtio_random # VirtIO Entropy device +device virtio_console # VirtIO Console device device hyperv # HyperV drivers Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Nov 3 22:19:44 2014 (r274064) +++ head/sys/conf/files.amd64 Mon Nov 3 22:37:10 2014 (r274065) @@ -455,6 +455,7 @@ dev/virtio/block/virtio_blk.c optional dev/virtio/balloon/virtio_balloon.c optional virtio_balloon dev/virtio/scsi/virtio_scsi.c optional virtio_scsi dev/virtio/random/virtio_random.c optional virtio_random +dev/virtio/console/virtio_console.c optional virtio_console isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Nov 3 22:19:44 2014 (r274064) +++ head/sys/conf/files.i386 Mon Nov 3 22:37:10 2014 (r274065) @@ -402,6 +402,7 @@ dev/virtio/block/virtio_blk.c optional dev/virtio/balloon/virtio_balloon.c optional virtio_balloon dev/virtio/scsi/virtio_scsi.c optional virtio_scsi dev/virtio/random/virtio_random.c optional virtio_random +dev/virtio/console/virtio_console.c optional virtio_console i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Nov 3 22:19:44 2014 (r274064) +++ head/sys/i386/conf/NOTES Mon Nov 3 22:37:10 2014 (r274065) @@ -815,6 +815,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device device virtio_random # VirtIO Entropy device +device virtio_console # VirtIO Console device device hyperv # HyperV drivers From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 23:36:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0350D4DA; Mon, 3 Nov 2014 23:36:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2F9BC6F; Mon, 3 Nov 2014 23:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3NagRI094506; Mon, 3 Nov 2014 23:36:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3Nafdn094499; Mon, 3 Nov 2014 23:36:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411032336.sA3Nafdn094499@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 23:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274066 - head/contrib/netbsd-tests/lib/libc/ssp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 23:36:43 -0000 Author: ngie Date: Mon Nov 3 23:36:41 2014 New Revision: 274066 URL: https://svnweb.freebsd.org/changeset/base/274066 Log: Port lib/libc/ssp to FreeBSD In most cases, the buffers and data were resized, but when dealing with the helpers, some of the code was adjusted to fail more reliably Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_memset.c head/contrib/netbsd-tests/lib/libc/ssp/h_read.c head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c head/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_memset.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_memset.c Mon Nov 3 22:37:10 2014 (r274065) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_memset.c Mon Nov 3 23:36:41 2014 (r274066) @@ -41,5 +41,9 @@ main(int argc, char *argv[]) char b[10]; size_t len = atoi(argv[1]); (void)memset(b, 0, len); +#ifdef __FreeBSD__ + return b[0]; /* keeps optimizer from zapping the call to memset() */ +#else return 0; +#endif } Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_read.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Mon Nov 3 22:37:10 2014 (r274065) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Mon Nov 3 23:36:41 2014 (r274066) @@ -36,12 +36,30 @@ __RCSID("$NetBSD: h_read.c,v 1.1 2010/12 #include #include +#ifdef __FreeBSD__ +#include + +int +main(int argc, char *argv[]) +{ + char b[MAXPATHLEN]; + int fd, n; + size_t len = atoi(argv[1]); + + fd = open("/dev/zero", O_RDONLY); + if ((n = read(fd, b, len)) == -1) + abort(); + (void)printf("%s\n", b); + return (0); +} +#else int main(int argc, char *argv[]) { char b[MAXPATHLEN]; size_t len = atoi(argv[1]); - (void)read(0, b, len); + (void)printf("%s\n", b); return 0; } +#endif Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 3 22:37:10 2014 (r274065) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c Mon Nov 3 23:36:41 2014 (r274066) @@ -36,12 +36,31 @@ __RCSID("$NetBSD: h_readlink.c,v 1.1 201 #include #include +#ifdef __FreeBSD__ +#include +#include +#endif + int main(int argc, char *argv[]) { +#ifdef __FreeBSD__ + char b[512], *sl; + int n; + size_t len = atoi(argv[1]); + sl = malloc(len); + memset(sl, 'a', len); + sl[len - 1] = 0; + unlink("symlink"); + if (symlink(sl, "symlink") == -1) + err(1, "symlink()"); + n = readlink("symlink", b, len); + unlink("symlink"); +#else char b[MAXPATHLEN]; size_t len = atoi(argv[1]); (void)readlink("/", b, len); +#endif (void)printf("%s\n", b); return 0; } Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c Mon Nov 3 22:37:10 2014 (r274065) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c Mon Nov 3 23:36:41 2014 (r274066) @@ -39,7 +39,13 @@ main(int argc, char *argv[]) { char b[10]; size_t len = atoi(argv[1]); +#ifdef __FreeBSD__ + char c[] = "01234567890123456789"; + c[len] = 0; + (void)snprintf(b, len, "%s", c); +#else (void)snprintf(b, len, "%s", "0123456789"); +#endif (void)printf("%s\n", b); return 0; } Modified: head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Mon Nov 3 22:37:10 2014 (r274065) +++ head/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh Mon Nov 3 23:36:41 2014 (r274066) @@ -34,7 +34,15 @@ h_pass() h_fail() { echo "Executing command [ $2$1 ]" + # Begin FreeBSD + if true; then + eval $2 atf_check -s signal -o ignore -e ignore $1 + else + # End FreeBSD eval $2 atf_check -s signal:6 -o ignore -e ignore $1 + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case sprintf @@ -47,7 +55,15 @@ sprintf_body() prog="$(atf_get_srcdir)/h_sprintf" h_pass "$prog ok" + # Begin FreeBSD + if true; then + h_fail "$prog 0123456789ab" + else + # End FreeBSD h_fail "$prog 0123456789" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case vsprintf @@ -60,7 +76,15 @@ vsprintf_body() prog="$(atf_get_srcdir)/h_vsprintf" h_pass "$prog ok" + # Begin FreeBSD + if true; then + h_fail "$prog 0123456789ab" + else + # End FreeBSD h_fail "$prog 0123456789" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case snprintf @@ -73,7 +97,15 @@ snprintf_body() prog="$(atf_get_srcdir)/h_snprintf" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case vsnprintf @@ -86,7 +118,15 @@ vsnprintf_body() prog="$(atf_get_srcdir)/h_vsnprintf" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case gets @@ -99,7 +139,15 @@ gets_body() prog="$(atf_get_srcdir)/h_gets" h_pass "$prog" "echo ok |" + # Begin FreeBSD + if true; then + h_fail "$prog" "echo 0123456789ab |" + else + # End FreeBSD h_fail "$prog" "echo 0123456789 |" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case fgets @@ -112,7 +160,15 @@ fgets_body() prog="$(atf_get_srcdir)/h_fgets" h_pass "$prog 10" "echo ok |" + # Begin FreeBSD + if true; then + h_fail "$prog 13" "echo 0123456789abc |" + else + # End FreeBSD h_fail "$prog 11" "echo busted |" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case memcpy @@ -125,7 +181,15 @@ memcpy_body() prog="$(atf_get_srcdir)/h_memcpy" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case memmove @@ -138,7 +202,15 @@ memmove_body() prog="$(atf_get_srcdir)/h_memmove" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case memset @@ -151,7 +223,15 @@ memset_body() prog="$(atf_get_srcdir)/h_memset" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case strcpy @@ -164,7 +244,15 @@ strcpy_body() prog="$(atf_get_srcdir)/h_strcpy" h_pass "$prog 0123456" + # Begin FreeBSD + if true; then + h_fail "$prog 0123456789ab" + else + # End FreeBSD h_fail "$prog 0123456789" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case stpcpy @@ -177,7 +265,15 @@ stpcpy_body() prog="$(atf_get_srcdir)/h_stpcpy" h_pass "$prog 0123456" + # Begin FreeBSD + if true; then + h_fail "$prog 0123456789ab" + else + # End FreeBSD h_fail "$prog 0123456789" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case strcat @@ -203,7 +299,15 @@ strncpy_body() prog="$(atf_get_srcdir)/h_strncpy" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case stpncpy @@ -216,7 +320,15 @@ stpncpy_body() prog="$(atf_get_srcdir)/h_stpncpy" h_pass "$prog 10" + # Begin FreeBSD + if true; then + h_fail "$prog 13" + else + # End FreeBSD h_fail "$prog 11" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case strncat @@ -228,8 +340,16 @@ strncat_body() { prog="$(atf_get_srcdir)/h_strncat" + # Begin FreeBSD h_pass "$prog 8" + if true; then + h_fail "$prog 11" + else + # End FreeBSD h_fail "$prog 9" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case raw @@ -242,7 +362,15 @@ raw_body() prog="$(atf_get_srcdir)/h_raw" h_pass "$prog 9" + # Begin FreeBSD + if true; then + h_fail "$prog 12" + else + # End FreeBSD h_fail "$prog 10" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case read @@ -255,7 +383,15 @@ read_body() prog="$(atf_get_srcdir)/h_read" h_pass "$prog 1024" "echo foo |" + # Begin FreeBSD + if true; then + h_fail "$prog 1027" "echo bar |" + else + # End FreeBSD h_fail "$prog 1025" "echo bar |" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case readlink @@ -267,8 +403,17 @@ readlink_body() { prog="$(atf_get_srcdir)/h_readlink" + # Begin FreeBSD + if true; then + h_pass "$prog 512" + h_fail "$prog 523" + else + # End FreeBSD h_pass "$prog 1024" h_fail "$prog 1025" + # Begin FreeBSD + fi + # End FreeBSD } atf_test_case getcwd @@ -281,7 +426,13 @@ getcwd_body() prog="$(atf_get_srcdir)/h_getcwd" h_pass "$prog 1024" + # Begin FreeBSD + if false; then + # End FreeBSD h_fail "$prog 1025" + # Begin FreeBSD + fi + # End FreeBSD } atf_init_test_cases() From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 23:37:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6185621; Mon, 3 Nov 2014 23:37:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92305C7C; Mon, 3 Nov 2014 23:37:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3NbqfL094686; Mon, 3 Nov 2014 23:37:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3NbqPw094685; Mon, 3 Nov 2014 23:37:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411032337.sA3NbqPw094685@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 3 Nov 2014 23:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274067 - head/contrib/netbsd-tests/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 23:37:52 -0000 Author: ngie Date: Mon Nov 3 23:37:51 2014 New Revision: 274067 URL: https://svnweb.freebsd.org/changeset/base/274067 Log: rpc_control on FreeBSD is a public-ish API (not prefixed with __), not private like NetBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Modified: head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Mon Nov 3 23:36:41 2014 (r274066) +++ head/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Mon Nov 3 23:37:51 2014 (r274067) @@ -47,6 +47,10 @@ reply(caddr_t replyp, struct netbuf * ra return 0; } +#ifdef __FreeBSD__ +#define __rpc_control rpc_control +#endif + extern bool __rpc_control(int, void *); static void From owner-svn-src-all@FreeBSD.ORG Mon Nov 3 23:43:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C4627A2; Mon, 3 Nov 2014 23:43:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D3B0D23; Mon, 3 Nov 2014 23:43:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA3Nhfxj098787; Mon, 3 Nov 2014 23:43:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA3NhfgC098785; Mon, 3 Nov 2014 23:43:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411032343.sA3NhfgC098785@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Mon, 3 Nov 2014 23:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274068 - head/usr.sbin/sysrc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 23:43:42 -0000 Author: dteske Date: Mon Nov 3 23:43:41 2014 New Revision: 274068 URL: https://svnweb.freebsd.org/changeset/base/274068 Log: Add key+=append syntax to sysrc(8). Reviewed by: shurd MFC after: 3 days X-MFC-to: stable/10 stable/9 Modified: head/usr.sbin/sysrc/sysrc head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Mon Nov 3 23:37:51 2014 (r274067) +++ head/usr.sbin/sysrc/sysrc Mon Nov 3 23:43:41 2014 (r274068) @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.1 Jul-18,2014" +SYSRC_VERSION="6.2 Nov-3,2014" # # Options @@ -80,7 +80,7 @@ die() # usage() { - f_err "Usage: %s [OPTIONS] name[=value] ...\n" "$pgm" + f_err "Usage: %s [OPTIONS] name[[+]=value] ...\n" "$pgm" f_err "Try \`%s --help' for more information.\n" "$pgm" die } @@ -94,7 +94,7 @@ help() local optfmt="\t%-11s%s\n" local envfmt="\t%-17s%s\n" - f_err "Usage: %s [OPTIONS] name[=value] ...\n" "$pgm" + f_err "Usage: %s [OPTIONS] name[[+]=value] ...\n" "$pgm" f_err "OPTIONS:\n" f_err "$optfmt" "-a" \ @@ -529,6 +529,11 @@ status=$SUCCESS while [ $# -gt 0 ]; do NAME="${1%%=*}" + case "$NAME" in + *+) mode=APPEND NAME="${NAME%+}" ;; + *) mode=ASSIGN + esac + [ "$DESCRIBE" ] && \ echo "$NAME: $( f_sysrc_desc "$NAME" )" @@ -593,14 +598,25 @@ while [ $# -gt 0 ]; do # if [ ! "$SHOW_VALUE" ]; then echo "$NAME" - f_sysrc_set "$NAME" "${1#*}" + case "$mode" in + APPEND) + before=$( f_sysrc_get "$NAME" ) + f_sysrc_set "$NAME" "$before${1#*=}" + ;; + *) + f_sysrc_set "$NAME" "${1#*=}" + esac else if [ "$SHOW_FILE" ]; then before=$( f_sysrc_find "$NAME" ) else before=$( f_sysrc_get "$NAME" ) fi - if f_sysrc_set "$NAME" "${1#*=}"; then + if case "$mode" in + APPEND) f_sysrc_set "$NAME" "$before${1#*=}" ;; + *) f_sysrc_set "$NAME" "${1#*=}" + esac + then if [ "$SHOW_FILE" ]; then after=$( f_sysrc_find "$NAME" ) else Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Mon Nov 3 23:37:51 2014 (r274067) +++ head/usr.sbin/sysrc/sysrc.8 Mon Nov 3 23:43:41 2014 (r274068) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jul 18, 2014 +.Dd November 3, 2014 .Dt SYSRC 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Op Fl cdDeFhinNqvx .Op Fl f Ar file .Op Fl j Ar jail | Fl R Ar dir -.Ar name Ns Op = Ns Ar value +.Ar name Ns Op Ns Oo + Oc Ns = Ns Ar value .Ar ... .Nm .Op Fl cdDeFhinNqvx @@ -135,6 +135,10 @@ It shares the `-e' and `-n' options and also has the same .Ql name[=value] syntax for making queries/assignments. +In addition +.Pq unlike Xr sysctl 8 , +.Ql name+=value +is supported for appending values. .Pp However, while .Xr sysctl 8 From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:04:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABFB9D9C; Tue, 4 Nov 2014 00:04:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987FAEFC; Tue, 4 Nov 2014 00:04:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA404bTs009405; Tue, 4 Nov 2014 00:04:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA404bWV009404; Tue, 4 Nov 2014 00:04:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040004.sA404bWV009404@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 00:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274072 - head/contrib/netbsd-tests/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 00:04:37 -0000 Author: ngie Date: Tue Nov 4 00:04:36 2014 New Revision: 274072 URL: https://svnweb.freebsd.org/changeset/base/274072 Log: Finish off lib/libc/stdlib/t_strtod.c port by checking for "y" twice on FreeBSD, and always assume long long double exists on FreeBSD Submitted by: pho Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Tue Nov 4 00:02:23 2014 (r274071) +++ head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Tue Nov 4 00:04:36 2014 (r274072) @@ -54,6 +54,10 @@ static const char * const inf_strings[] const char *nan_string = "NaN(x)y"; #endif +#ifdef __FreeBSD__ +#define __HAVE_LONG_DOUBLE +#endif + ATF_TC(strtod_basic); ATF_TC_HEAD(strtod_basic, tc) { @@ -221,7 +225,9 @@ ATF_TC_BODY(strtold_nan, tc) volatile long double ld = strtold(nan_string, &end); ATF_REQUIRE(isnan(ld) != 0); -#if !defined(__FreeBSD__) +#ifdef __FreeBSD__ + ATF_REQUIRE(strcmp(end, "y") == 0); +#else ATF_REQUIRE(__isnanl(ld) != 0); #endif ATF_REQUIRE(strcmp(end, "y") == 0); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:10:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37E09FB7; Tue, 4 Nov 2014 00:10:35 +0000 (UTC) Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED40AF37; Tue, 4 Nov 2014 00:10:34 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id p10so12427649pdj.19 for ; Mon, 03 Nov 2014 16:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=hClAPN4VXw1V3gkcSVG01Vg/LOVOoVax88C1JRxSiSc=; b=FnD4O0M0zDmeO1riHxk/2JOjdRG7LIO5TDuO26t+oxKOtC7WSp+Ag3NDR0s5/NnAZC vW4j0Ch6QK9llwU15RaARJMjfyWVd9XGM/QTqoU7bgQunvDaMrm59OFie4mgO3ONjJIs LCIenhWD7KLdU8g1rskuFAHXMLwxq3ZTGYujEApWMiffYh/RIep4vLeZV2XRCn9xUEax zMWmTKv+IPddx98GRCzUTb2dQPeSRmPNQlcSfE5PlRmoXgYtgHv9NHRynsEIWxbFRUGJ nmmodBXbJ4aNdTxBa0aI4UYDNPE2oVSMC+UXGWhkxEGHHlrjzv4ssFus19eikQ+YOVBZ TWjg== X-Received: by 10.68.195.68 with SMTP id ic4mr46913721pbc.44.1415059834497; Mon, 03 Nov 2014 16:10:34 -0800 (PST) Received: from [192.168.192.204] ([129.253.54.225]) by mx.google.com with ESMTPSA id z9sm18225398pdp.73.2014.11.03.16.10.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 16:10:33 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_C51CB857-1152-40C8-85CA-F4C52D3AD4AC"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274072 - head/contrib/netbsd-tests/lib/libc/stdlib From: Garrett Cooper In-Reply-To: <201411040004.sA404bWV009404@svn.freebsd.org> Date: Mon, 3 Nov 2014 16:10:30 -0800 Message-Id: <59235063-20D2-4EAD-A1CA-485658D2B8A5@gmail.com> References: <201411040004.sA404bWV009404@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 00:10:35 -0000 --Apple-Mail=_C51CB857-1152-40C8-85CA-F4C52D3AD4AC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 3, 2014, at 16:04, Garrett Cooper wrote: > Author: ngie > Date: Tue Nov 4 00:04:36 2014 > New Revision: 274072 > URL: https://svnweb.freebsd.org/changeset/base/274072 >=20 > Log: > Finish off lib/libc/stdlib/t_strtod.c port by checking for "y" twice = on > FreeBSD, and always assume long long double exists on FreeBSD Slight typo=85 long long double -> long double --Apple-Mail=_C51CB857-1152-40C8-85CA-F4C52D3AD4AC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUWBl3AAoJEMZr5QU6S73eTeEIAJF35wmHJ8UjVA7dof71PC0x kbV1HSxxJ18c+wNqGKPHyN5MHchayZMu/FLyq5K5GXZSB2IKlQVOTtLMHO8752++ vQ17aaqreOQTcAh4UkDhjQQLr59NbylUrui5dYH4O7fAiSn0rllKvXlxEMRaL+Kr 4yPX1KYnRnNYnmP76M4nPN00ZcUSdRUsmKOItnriVV3xBHpGpY22pMx1bfRG92bK 2OFE/RjVpmR8BR84jFZQAEY1N9Nxxv5GQEh/8XiNDvjdy8dqdvZx4w/Q5n7UwDOD LdzNFisM32QYHs+/blMiatqUhpKJkHLQqtI1/D0QwT9xFUXSF1CAPcvwLjG9BmE= =Puxa -----END PGP SIGNATURE----- --Apple-Mail=_C51CB857-1152-40C8-85CA-F4C52D3AD4AC-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:14:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B9511A5; Tue, 4 Nov 2014 00:14:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2495CFDC; Tue, 4 Nov 2014 00:14:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA40En4K014242; Tue, 4 Nov 2014 00:14:49 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA40EccY014176; Tue, 4 Nov 2014 00:14:38 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411040014.sA40EccY014176@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 4 Nov 2014 00:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274073 - in head/usr.sbin/bsdconfig: . console console/include diskmgmt diskmgmt/include docsinstall docsinstall/include dot dot/include examples include includes includes/include mous... 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 00:14:49 -0000 Author: dteske Date: Tue Nov 4 00:14:38 2014 New Revision: 274073 URL: https://svnweb.freebsd.org/changeset/base/274073 Log: Follow-up to r255036; remove beforeinstall directives from bsdconfig(8) Makefile's, fixing concurrent installworld (`make -j17 installworld'). Thanks to: delphij, emaste Reviewed by: delphij MFC after: 3 days X-MFC-to: stable/10, stable/9 Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/bsdconfig/console/Makefile head/usr.sbin/bsdconfig/console/include/Makefile head/usr.sbin/bsdconfig/diskmgmt/Makefile head/usr.sbin/bsdconfig/diskmgmt/include/Makefile head/usr.sbin/bsdconfig/docsinstall/Makefile head/usr.sbin/bsdconfig/docsinstall/include/Makefile head/usr.sbin/bsdconfig/dot/Makefile head/usr.sbin/bsdconfig/dot/include/Makefile head/usr.sbin/bsdconfig/examples/Makefile head/usr.sbin/bsdconfig/include/Makefile head/usr.sbin/bsdconfig/includes/Makefile head/usr.sbin/bsdconfig/includes/include/Makefile head/usr.sbin/bsdconfig/mouse/Makefile head/usr.sbin/bsdconfig/mouse/include/Makefile head/usr.sbin/bsdconfig/networking/Makefile head/usr.sbin/bsdconfig/networking/include/Makefile head/usr.sbin/bsdconfig/networking/share/Makefile head/usr.sbin/bsdconfig/packages/Makefile head/usr.sbin/bsdconfig/packages/include/Makefile head/usr.sbin/bsdconfig/password/Makefile head/usr.sbin/bsdconfig/password/include/Makefile head/usr.sbin/bsdconfig/password/share/Makefile head/usr.sbin/bsdconfig/security/Makefile head/usr.sbin/bsdconfig/security/include/Makefile head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/media/Makefile head/usr.sbin/bsdconfig/share/packages/Makefile head/usr.sbin/bsdconfig/startup/Makefile head/usr.sbin/bsdconfig/startup/include/Makefile head/usr.sbin/bsdconfig/startup/share/Makefile head/usr.sbin/bsdconfig/timezone/Makefile head/usr.sbin/bsdconfig/timezone/include/Makefile head/usr.sbin/bsdconfig/timezone/share/Makefile head/usr.sbin/bsdconfig/ttys/Makefile head/usr.sbin/bsdconfig/ttys/include/Makefile head/usr.sbin/bsdconfig/usermgmt/Makefile head/usr.sbin/bsdconfig/usermgmt/include/Makefile head/usr.sbin/bsdconfig/usermgmt/share/Makefile Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -25,9 +25,4 @@ SCRIPTS= bsdconfig MAN= bsdconfig.8 -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - mkdir -p ${DESTDIR}${SCRIPTSDIR} - mkdir -p ${DESTDIR}${MANDIR}8 - .include Modified: head/usr.sbin/bsdconfig/console/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/console/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/console/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= console font keymap repeat saver screenmap ttys -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/console/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/console/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/console/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/diskmgmt/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/diskmgmt/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= diskmgmt -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/diskmgmt/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/diskmgmt/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/050.diskmgmt/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/docsinstall/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/docsinstall/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= docsinstall -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/docsinstall/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/docsinstall/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/020.docsinstall/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/dot/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/dot/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/dot/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= dot -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/dot/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/dot/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/dot/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/dot/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/examples/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/examples/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -6,7 +6,4 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/includ FILES= bsdconfig.hlp media.hlp messages.subr network_device.hlp \ options.hlp tcp.hlp usage.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/includes/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/includes/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/includes/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= includes -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/includes/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/includes/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/includes/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/includes/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/mouse/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/mouse/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/mouse/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= disable enable flags mouse port type -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/mouse/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/mouse/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/mouse/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/110.mouse/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/networking/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/networking/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= defaultrouter devices hostname nameservers networking -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/networking/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/networking/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/networking/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/networking/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/networki FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ netmask.subr resolv.subr routing.subr services.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/packages/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/packages/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/packages/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= packages -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/packages/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/packages/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/packages/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/password/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/password/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= password -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/password/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/password/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/password/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/password/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/password FILES= password.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/security/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/security/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/security/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= kern_securelevel security -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/security/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/security/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/security/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/130.security/include FILES= messages.subr securelevel.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -9,7 +9,4 @@ FILES= common.subr device.subr dialog.s mustberoot.subr script.subr strings.subr struct.subr \ sysrc.subr variable.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/share/media/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/media/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/share/media/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -7,7 +7,4 @@ FILES= any.subr cdrom.subr common.subr floppy.subr ftp.subr http.subr httpproxy.subr network.subr \ nfs.subr options.subr tcpip.subr ufs.subr usb.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/share/packages/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/packages FILES= categories.subr index.subr musthavepkg.subr packages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/startup/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/startup/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/startup/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= misc rcadd rcconf rcdelete rcedit rcvar startup -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/startup/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/startup/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/startup/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/140.startup/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/startup/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/startup/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/startup FILES= rcconf.subr rcedit.subr rcvar.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/timezone/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/timezone/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/timezone/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= timezone -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/timezone/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/timezone/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/timezone/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/090.timezone/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/timezone/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/timezone/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/timezone FILES= continents.subr countries.subr iso3166.subr menus.subr \ zones.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/ttys/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/ttys/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/ttys/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= ttys -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/ttys/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/ttys/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/ttys/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/150.ttys/include FILES= messages.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/usermgmt/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/usermgmt/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -10,7 +10,4 @@ FILES= INDEX USAGE SCRIPTSDIR= ${FILESDIR} SCRIPTS= groupadd groupdel groupedit useradd userdel useredit usermgmt -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/usermgmt/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/include/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/usermgmt/include/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/070.usermgmt/include FILES= messages.subr usermgmt.hlp -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include Modified: head/usr.sbin/bsdconfig/usermgmt/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/Makefile Tue Nov 4 00:04:36 2014 (r274072) +++ head/usr.sbin/bsdconfig/usermgmt/share/Makefile Tue Nov 4 00:14:38 2014 (r274073) @@ -5,7 +5,4 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt FILES= group.subr group_input.subr user.subr user_input.subr -beforeinstall: - mkdir -p ${DESTDIR}${FILESDIR} - .include From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:19:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3ED73F9; Tue, 4 Nov 2014 00:19:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8647E6B; Tue, 4 Nov 2014 00:19:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA40JB5o014848; Tue, 4 Nov 2014 00:19:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA40JBMg014847; Tue, 4 Nov 2014 00:19:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040019.sA40JBMg014847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 00:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274074 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 00:19:11 -0000 Author: ngie Date: Tue Nov 4 00:19:10 2014 New Revision: 274074 URL: https://svnweb.freebsd.org/changeset/base/274074 Log: Add Makefile snippet to ease porting NetBSD testcases to FreeBSD from contrib/netbsd-tests This Makefile snippet handles polluting testcases with -lnetbsd, specific headers for ATF version differences, and does necessary rewriting for the testcases to match the format discussed on the TestSuite wiki page (t_ -> _test) One must define SRCTOP (inspired by projects/bmake), OBJTOP, and TESTSRC (e.g. contrib/netbsd-tests/lib/libc/gen) to use the Makefile snippet Test programs are specific either via NETBSD_ATF_TESTS_C or NETBSD_ATF_TESTS_SH C++ analogs aren't currently implemented. The imported testcases will be cleaned up to use this Makefile snippet pseudo "API". Added: head/share/mk/netbsd-tests.test.mk (contents, props changed) Added: head/share/mk/netbsd-tests.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/netbsd-tests.test.mk Tue Nov 4 00:19:10 2014 (r274074) @@ -0,0 +1,49 @@ +# $FreeBSD$ + +.if !target(__netbsd_tests.test.mk__) +__netbsd_tests.test.mk__: + +.if !defined(OBJTOP) +.error "Please define OBJTOP to the absolute path of the top of the object tree" +.endif + +.if !defined(SRCTOP) +.error "Please define SRCTOP to the absolute path of the top of the source tree" +.endif + +.if !defined(TESTSRC) +.error "Please define TESTSRC to the absolute path of the test sources, e.g. contrib/netbsd-tests/lib/libc/stdio" +.endif + +.PATH: ${TESTSRC} + +LIBNETBSD_SRCDIR= ${SRCTOP}/lib/libnetbsd +LIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd + +.for t in ${NETBSD_ATF_TESTS_C} +# XXX: needed for atf-c/config.h after v0.2.1 upgrade. See NetBSD PR # +# misc/49356 for more details +CFLAGS.$t+= -I${SRCTOP}/contrib/atf +CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests +LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} + +DPADD.$t+= ${LIBNETBSD} +LDADD.$t+= -lnetbsd + +SRCS.$t?= ${t:C/^/t_/:C/_test$//g}.c +.endfor + +ATF_TESTS_C+= ${NETBSD_ATF_TESTS_C} + +# A C++ analog isn't provided because there aren't any C++ testcases in +# contrib/netbsd-tests + +.for t in ${NETBSD_ATF_TESTS_SH} +ATF_TESTS_SH_SRC_$t?= ${t:C/^/t_/:C/_test$//g}.sh +.endfor + +ATF_TESTS_SH+= ${NETBSD_ATF_TESTS_SH} + +.endif + +# vim: syntax=make From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 00:56:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3618291F; Tue, 4 Nov 2014 00:56:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F25F5E7; Tue, 4 Nov 2014 00:56:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA40uY6X033169; Tue, 4 Nov 2014 00:56:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA40uQTp033127; Tue, 4 Nov 2014 00:56:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040056.sA40uQTp033127@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 00:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274075 - in head: etc/mtree lib/libc lib/libc/tests lib/libc/tests/c063 lib/libc/tests/db lib/libc/tests/gen lib/libc/tests/gen/execve lib/libc/tests/gen/posix_spawn lib/libc/tests/has... 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 00:56:34 -0000 Author: ngie Date: Tue Nov 4 00:56:25 2014 New Revision: 274075 URL: https://svnweb.freebsd.org/changeset/base/274075 Log: Add reachover Makefiles for contrib/netbsd-tests/lib/libc; this adds approximately 500 new testcases Various TODOs have been sprinkled around the Makefiles for items that even need to be ported (missing features), testcases have issues with building/linking, or issues at runtime. A variant of this code has been tested extensively on amd64 and i386 10-STABLE/11-CURRENT for several months without issue. It builds on other architectures, but the code will remain off until I have prove it works on virtual hardware or real hardware on other architectures In collaboration with: pho, Casey Peel Sponsored by: EMC / Isilon Storage Division Added: head/lib/libc/Makefile.amd64 (contents, props changed) head/lib/libc/Makefile.i386 (contents, props changed) head/lib/libc/tests/ head/lib/libc/tests/Makefile (contents, props changed) head/lib/libc/tests/Makefile.netbsd-tests (contents, props changed) head/lib/libc/tests/c063/ head/lib/libc/tests/c063/Makefile (contents, props changed) head/lib/libc/tests/db/ head/lib/libc/tests/db/Makefile (contents, props changed) head/lib/libc/tests/gen/ head/lib/libc/tests/gen/Makefile (contents, props changed) head/lib/libc/tests/gen/execve/ head/lib/libc/tests/gen/execve/Makefile (contents, props changed) head/lib/libc/tests/gen/posix_spawn/ head/lib/libc/tests/gen/posix_spawn/Makefile (contents, props changed) head/lib/libc/tests/hash/ head/lib/libc/tests/hash/Makefile (contents, props changed) head/lib/libc/tests/inet/ head/lib/libc/tests/inet/Makefile (contents, props changed) head/lib/libc/tests/locale/ head/lib/libc/tests/locale/Makefile (contents, props changed) head/lib/libc/tests/net/ head/lib/libc/tests/net/Makefile (contents, props changed) head/lib/libc/tests/net/getaddrinfo/ head/lib/libc/tests/net/getaddrinfo/Makefile (contents, props changed) head/lib/libc/tests/regex/ head/lib/libc/tests/regex/Makefile (contents, props changed) head/lib/libc/tests/rpc/ head/lib/libc/tests/rpc/Makefile (contents, props changed) head/lib/libc/tests/setjmp/ head/lib/libc/tests/setjmp/Makefile (contents, props changed) head/lib/libc/tests/ssp/ head/lib/libc/tests/ssp/Makefile (contents, props changed) head/lib/libc/tests/stdio/ head/lib/libc/tests/stdio/Makefile (contents, props changed) head/lib/libc/tests/stdlib/ head/lib/libc/tests/stdlib/Makefile (contents, props changed) head/lib/libc/tests/string/ head/lib/libc/tests/string/Makefile (contents, props changed) head/lib/libc/tests/sys/ head/lib/libc/tests/sys/Makefile (contents, props changed) head/lib/libc/tests/termios/ head/lib/libc/tests/termios/Makefile (contents, props changed) head/lib/libc/tests/time/ head/lib/libc/tests/time/Makefile (contents, props changed) head/lib/libc/tests/tls/ head/lib/libc/tests/tls/Makefile (contents, props changed) head/lib/libc/tests/tls/dso/ head/lib/libc/tests/tls/dso/Makefile (contents, props changed) head/lib/libc/tests/tls_dso/ head/lib/libc/tests/tls_dso/Makefile (contents, props changed) head/lib/libc/tests/ttyio/ head/lib/libc/tests/ttyio/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libc/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Nov 4 00:19:10 2014 (r274074) +++ head/etc/mtree/BSD.tests.dist Tue Nov 4 00:56:25 2014 (r274075) @@ -89,6 +89,56 @@ test-programs .. .. + libc + c063 + .. + db + .. + gen + execve + .. + posix_spawn + .. + .. + hash + data + .. + .. + inet + .. + locale + .. + net + getaddrinfo + data + .. + .. + .. + regex + data + .. + .. + ssp + .. + stdio + .. + stdlib + .. + string + .. + sys + .. + time + .. + tls + dso + .. + .. + termios + .. + ttyio + .. + .. libcrypt .. libmp Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Nov 4 00:19:10 2014 (r274074) +++ head/lib/libc/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -158,6 +158,8 @@ libkern.${LIBC_ARCH}:: ${KMSRCS} cp -fp ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif +.include + .include # Disable warnings in contributed sources. Added: head/lib/libc/Makefile.amd64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/Makefile.amd64 Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/libc/Makefile.i386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/Makefile.i386 Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + Added: head/lib/libc/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc + +SUBDIR= tls_dso + +TESTS_SUBDIRS= c063 +TESTS_SUBDIRS+= db +TESTS_SUBDIRS+= gen +TESTS_SUBDIRS+= hash +TESTS_SUBDIRS+= inet +TESTS_SUBDIRS+= net +TESTS_SUBDIRS+= regex +TESTS_SUBDIRS+= stdio +TESTS_SUBDIRS+= stdlib +TESTS_SUBDIRS+= string +TESTS_SUBDIRS+= sys +TESTS_SUBDIRS+= termios +TESTS_SUBDIRS+= tls +TESTS_SUBDIRS+= ttyio + +.if ${MK_LOCALES} != "no" +TESTS_SUBDIRS+= locale +.endif + +.if ${MK_SSP} != "no" +TESTS_SUBDIRS+= ssp +.endif + +.include Added: head/lib/libc/tests/Makefile.netbsd-tests ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/Makefile.netbsd-tests Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +OBJTOP?= ${.OBJDIR:H:H:H:H} +SRCTOP?= ${.CURDIR:H:H:H:H} +TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/lib/libc/${.CURDIR:T} + +.include Added: head/lib/libc/tests/c063/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/c063/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/c063 + +#TODO: t_o_search, t_utimensat + +NETBSD_ATF_TESTS_C= t_faccessat +NETBSD_ATF_TESTS_C+= t_fchmodat +NETBSD_ATF_TESTS_C+= t_fchownat +NETBSD_ATF_TESTS_C+= t_fexecve +NETBSD_ATF_TESTS_C+= t_fstatat +NETBSD_ATF_TESTS_C+= t_linkat +NETBSD_ATF_TESTS_C+= t_mkdirat +NETBSD_ATF_TESTS_C+= t_mkfifoat +NETBSD_ATF_TESTS_C+= t_mknodat +NETBSD_ATF_TESTS_C+= t_openat +NETBSD_ATF_TESTS_C+= t_readlinkat +NETBSD_ATF_TESTS_C+= t_renameat +NETBSD_ATF_TESTS_C+= t_symlinkat +NETBSD_ATF_TESTS_C+= t_unlinkat + +CFLAGS+= -D_INCOMPLETE_XOPEN_C063 + +.include Added: head/lib/libc/tests/db/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/db/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/db + +BINDIR= ${TESTSDIR} + +PROGS= h_db + +FILESDIR= ${TESTSDIR} + +FILES= README + +NETBSD_ATF_TESTS_SH+= db_test + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/gen/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,58 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/gen + +# TODO: t_closefrom, t_cpuset, t_fmtcheck, t_randomid, t_sleep +# TODO: t_siginfo (fixes require further inspection) +# TODO: t_sethostname_test (consistently screws up the hostname) + +NETBSD_ATF_TESTS_C= alarm_test +NETBSD_ATF_TESTS_C+= assert_test +NETBSD_ATF_TESTS_C+= basedirname_test +NETBSD_ATF_TESTS_C+= dir_test +NETBSD_ATF_TESTS_C+= floatunditf_test +NETBSD_ATF_TESTS_C+= fnmatch_test +NETBSD_ATF_TESTS_C+= fpclassify_test +NETBSD_ATF_TESTS_C+= fpsetmask_test +NETBSD_ATF_TESTS_C+= fpsetround_test +NETBSD_ATF_TESTS_C+= ftok_test +NETBSD_ATF_TESTS_C+= getcwd_test +NETBSD_ATF_TESTS_C+= getgrent_test +NETBSD_ATF_TESTS_C+= glob_test +NETBSD_ATF_TESTS_C+= humanize_number_test +NETBSD_ATF_TESTS_C+= isnan_test +NETBSD_ATF_TESTS_C+= nice_test +NETBSD_ATF_TESTS_C+= pause_test +NETBSD_ATF_TESTS_C+= raise_test +NETBSD_ATF_TESTS_C+= realpath_test +NETBSD_ATF_TESTS_C+= setdomainname_test +NETBSD_ATF_TESTS_C+= sethostname_test +NETBSD_ATF_TESTS_C+= sleep_test +NETBSD_ATF_TESTS_C+= syslog_test +NETBSD_ATF_TESTS_C+= time_test +NETBSD_ATF_TESTS_C+= ttyname_test +NETBSD_ATF_TESTS_C+= vis_test + +.include "../Makefile.netbsd-tests" + +LDADD.humanize_number_test+= -lutil +DPADD.humanize_number_test+= ${LIBUTIL} + +LDADD.fpclassify_test+= -lm +DPADD.fpclassify_test+= ${LIBM} +LDADD.fpsetround_test+= -lm +DPADD.fpsetround_test+= ${LIBM} +LDADD.siginfo_test+= -lm +DPADD.siginfo_test+= ${LIBM} + +LDADD.nice_test+= -lpthread +DPADD.nice_test+= ${LIBPTHREAD} +LDADD.syslog_test+= -lpthread +DPADD.syslog_test+= ${LIBPTHREAD} + +TESTS_SUBDIRS= execve +TESTS_SUBDIRS+= posix_spawn + +.include Added: head/lib/libc/tests/gen/execve/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/execve/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T} + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/gen/execve + +NETBSD_ATF_TESTS_C= execve_test + +.include "../../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/gen/posix_spawn/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/gen/posix_spawn/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/gen/${.CURDIR:T} + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/gen/posix_spawn + +BINDIR= ${TESTSDIR} + +# TODO: t_spawnattr (fix from pho@ needs additional review) +NETBSD_ATF_TESTS_C= fileactions_test +NETBSD_ATF_TESTS_C+= spawn_test + +PROGS= h_fileactions +PROGS+= h_spawn +PROGS+= h_spawnattr + +SCRIPTS= h_nonexec +SCRIPTS+= h_zero + +.include "../../Makefile.netbsd-tests" + +h_zero: + dd if=/dev/zero of=h_zero bs=1k count=2 + chmod a+x h_zero + +CLEANFILES+= h_zero + +WARNS?=3 + +.include Added: head/lib/libc/tests/hash/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/hash/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/hash + +NETBSD_ATF_TESTS_C= sha2_test + +NETBSD_ATF_TESTS_SH= hash_test + +BINDIR= ${TESTSDIR} + +PROGS+= h_hash + +FILESDIR= ${TESTSDIR}/data + +FILES+= data/md5test-in +FILES+= data/md5test-out +FILES+= data/sha1test-in +FILES+= data/sha1test-out +FILES+= data/sha1test2-out + +DPADD+= ${LIBMD} +LDADD+= -lmd +DPADD.sha2_test+= ${LIBCRYPTO} +LDADD.sha2_test+= -lcrypto + +CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh/openbsd-compat +CFLAGS.sha2_test+= -I${.CURDIR}/../../../../crypto/openssh + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/inet/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/inet/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/inet + +NETBSD_ATF_TESTS_C= inet_network_test + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/locale/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/locale/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/locale + +NETBSD_ATF_TESTS_C= io_test +NETBSD_ATF_TESTS_C+= mbrtowc_test +NETBSD_ATF_TESTS_C+= mbstowcs_test +NETBSD_ATF_TESTS_C+= mbsnrtowcs_test +NETBSD_ATF_TESTS_C+= mbtowc_test +NETBSD_ATF_TESTS_C+= wcscspn_test +NETBSD_ATF_TESTS_C+= wcspbrk_test +NETBSD_ATF_TESTS_C+= wcsspn_test +NETBSD_ATF_TESTS_C+= wcstod_test +NETBSD_ATF_TESTS_C+= wctomb_test + +CFLAGS.t_wctomb.c+= -Wno-stack-protector + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/net/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/net/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/net + +BINDIR= ${TESTSDIR} + +NETBSD_ATF_TESTS_C= getprotoent_test +NETBSD_ATF_TESTS_C+= ether_aton_test + +SRCS.t_ether_aton= aton_ether_subr.c t_ether_aton.c + +aton_ether_subr.c: gen_ether_subr ${.CURDIR:H:H:H:H}/sys/net/if_ethersubr.c + ${HOST_SH} ${.ALLSRC} ${.TARGET} + +# TODO: hostent_test +NETBSD_ATF_TESTS_SH= nsdispatch_test +NETBSD_ATF_TESTS_SH+= protoent_test +NETBSD_ATF_TESTS_SH+= servent_test + +PROGS= h_nsd_recurse +PROGS+= h_protoent +PROGS+= h_servent +PROGS+= h_dns_server + +DPADD.h_nsd_recurse+= ${LIBPTHREAD} +LDADD.h_nsd_recurse+= -lpthread + +CLEANFILES+= aton_ether_subr.c + +.include "../Makefile.netbsd-tests" + +# TODO: the testcases needs to be ported to FreeBSD +#TESTS_SUBDIRS= getaddrinfo +FILES= hosts +FILES+= resolv.conf + +.include Added: head/lib/libc/tests/net/getaddrinfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/net/getaddrinfo/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/net/${.CURDIR:T} + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/net/getaddrinfo + +BINDIR= ${TESTSDIR} + +.error "This testcase needs to be ported to FreeBSD (the output from getaddrinfo_test differs from NetBSD)" + +NETBSD_ATF_TESTS_SH= getaddrinfo_test + +PROGS= h_gai + +FILESDIR= ${TESTSDIR}/data + +FILES= basics_v4.exp basics_v4v6.exp +FILES+= no_host_v4.exp no_host_v4v6.exp +FILES+= no_serv_v4.exp no_serv_v4v6.exp +FILES+= sock_raw_v4.exp sock_raw_v4v6.exp +FILES+= spec_fam_v4.exp spec_fam_v4v6.exp +FILES+= scoped.exp +FILES+= unsup_fam.exp + +.include "../../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/regex/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/regex/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,59 @@ +# $FreeBSD$ + +.include + +BINDIR= ${TESTSDIR} + +TESTSDIR= ${TESTSBASE}/lib/libc/regex + +IMPLEMENTATION?= -DREGEX_SPENCER + +CFLAGS.h_regex+=-I${TESTSRC} -I${.CURDIR:H:H}/regex +PROGS+= h_regex +SRCS.h_regex= main.c split.c debug.c + +NETBSD_ATF_TESTS_SH= regex_test + +FILESDIR= ${TESTSDIR}/data +FILES+= README +FILES+= data/anchor.in +FILES+= data/backref.in +FILES+= data/basic.in +FILES+= data/bracket.in +FILES+= data/c_comments.in +FILES+= data/complex.in +FILES+= data/error.in +FILES+= data/meta.in +FILES+= data/nospec.in +FILES+= data/paren.in +FILES+= data/regress.in +FILES+= data/repet_bounded.in +FILES+= data/repet_multi.in +FILES+= data/repet_ordinary.in +FILES+= data/startend.in +FILES+= data/subexp.in +FILES+= data/subtle.in +FILES+= data/word_bound.in +FILES+= data/zero.in +#FILES+= data/att/README +FILES+= data/att/basic.dat +FILES+= data/att/categorization.dat +FILES+= data/att/forcedassoc.dat +FILES+= data/att/leftassoc.dat +FILES+= data/att/nullsubexpr.dat +FILES+= data/att/repetition.dat +FILES+= data/att/rightassoc.dat + +NETBSD_ATF_TESTS_C= exhaust_test +NETBSD_ATF_TESTS_C+= regex_att_test + +.for t in ${NETBSD_ATF_TESTS_C} +CFLAGS.$t+= -I${TESTSRC} ${IMPLEMENTATION} +.endfor + +.include "../Makefile.netbsd-tests" + +DPADD.regex_att_test+= ${LIBUTIL} +LDADD.regex_att_test+= -lutil + +.include Added: head/lib/libc/tests/rpc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/rpc/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/rpc +SRCS.xdr_test= ${RPCSRC:.x=_xdr.c} t_xdr.c ${RPCSRC:.x=.h} + +NETBSD_ATF_TESTS_C= rpc_test +NETBSD_ATF_TESTS_C+= xdr_test + +RPCSRC= h_testbits.x +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C + +h_testbits.h: ${RPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} + +h_testbits_xdr.c: ${RPCSRC} h_testbits.h + ${RPCGEN} ${.ALLSRC:M*.x} + +CLEANFILES+= ${RPCSRC:.x=.h} ${RPCSRC:.x=.c} h_testbits_xdr.c +CFLAGS+= -I${.OBJDIR} +DPSRCS+= h_testbits.h + +LDADD+= -lrpcsvc -lutil +DPADD+= ${LIBRPCSVC} ${LIBUTIL} + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/setjmp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/setjmp/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/setjmp + +NETBSD_ATF_TESTS_C= t_setjmp +NETBSD_ATF_TESTS_C+= t_threadjmp + +DPADD.t_threadjmp+= ${LIBPTHREAD} +LDADD.t_threadjmp+= -lpthread + +WARNS?= 4 + +.include Added: head/lib/libc/tests/ssp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/ssp/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/ssp + +NO_WERROR= +WARNS?= 2 + +CFLAGS.h_raw+= -fstack-protector-all -Wstack-protector +.if ${COMPILER_TYPE} == "clang" +CFLAGS.h_raw+= -fsanitize=bounds +.elif ${COMPILER_TYPE} == "gcc" +CFLAGS.h_raw+= --param ssp-buffer-size=1 +DPADD+= ${LIBSSP} +LDADD+= -lssp +.endif + +NETBSD_ATF_TESTS_SH= ssp_test + +BINDIR= ${TESTSDIR} + +PROGS= h_fgets +PROGS+= h_gets +PROGS+= h_getcwd +PROGS+= h_memcpy +PROGS+= h_memmove +PROGS+= h_memset +PROGS+= h_raw +PROGS+= h_read +PROGS+= h_readlink +PROGS+= h_snprintf +PROGS+= h_sprintf +PROGS+= h_stpcpy +PROGS+= h_stpncpy +PROGS+= h_strcat +PROGS+= h_strcpy +PROGS+= h_strncat +PROGS+= h_strncpy +PROGS+= h_vsnprintf +PROGS+= h_vsprintf + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/stdio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdio/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +TESTSDIR= ${TESTSBASE}/lib/libc/stdio + +NETBSD_ATF_TESTS_C= clearerr_test +NETBSD_ATF_TESTS_C+= fflush_test +NETBSD_ATF_TESTS_C+= fmemopen_test +NETBSD_ATF_TESTS_C+= fopen_test +NETBSD_ATF_TESTS_C+= fputc_test +NETBSD_ATF_TESTS_C+= mktemp_test +NETBSD_ATF_TESTS_C+= popen_test +NETBSD_ATF_TESTS_C+= printf_test +NETBSD_ATF_TESTS_C+= scanf_test + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,44 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/stdlib + +# TODO: t_getenv_thread, t_mi_vector_hash +NETBSD_ATF_TESTS_C= abs_test +NETBSD_ATF_TESTS_C+= atoi_test +NETBSD_ATF_TESTS_C+= div_test +NETBSD_ATF_TESTS_C+= getenv_test +NETBSD_ATF_TESTS_C+= exit_test +NETBSD_ATF_TESTS_C+= hsearch_test +NETBSD_ATF_TESTS_C+= posix_memalign_test +NETBSD_ATF_TESTS_C+= random_test +NETBSD_ATF_TESTS_C+= strtod_test +NETBSD_ATF_TESTS_C+= strtol_test +NETBSD_ATF_TESTS_C+= system_test + +# TODO: need to come up with a correct explanation of what the patch pho does +# with h_atexit +#ATF_TESTS_SH= atexit_test +NETBSD_ATF_TESTS_SH= getopt_test + +.include "../Makefile.netbsd-tests" + +BINDIR= ${TESTSDIR} + +# TODO: see comment above +#PROGS+= h_atexit +PROGS+= h_getopt h_getopt_long + +.for t in h_getopt h_getopt_long +CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests +LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} + +DPADD.$t+= ${LIBNETBSD} ${LIBUTIL} +LDADD.$t+= -lnetbsd -lutil +.endfor + +DPADD.strtod_test+= ${LIBM} +LDADD.strtod_test+= -lm + +.include Added: head/lib/libc/tests/string/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/string/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,33 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/string + +# TODO: popcount, stresep + +NETBSD_ATF_TESTS_C+= memchr +NETBSD_ATF_TESTS_C+= memcpy +NETBSD_ATF_TESTS_C+= memmem +NETBSD_ATF_TESTS_C+= memset +NETBSD_ATF_TESTS_C+= strcat +NETBSD_ATF_TESTS_C+= strchr +NETBSD_ATF_TESTS_C+= strcmp +NETBSD_ATF_TESTS_C+= strcpy +NETBSD_ATF_TESTS_C+= strcspn +NETBSD_ATF_TESTS_C+= strerror +NETBSD_ATF_TESTS_C+= strlen +NETBSD_ATF_TESTS_C+= strpbrk +NETBSD_ATF_TESTS_C+= strrchr +NETBSD_ATF_TESTS_C+= strspn +NETBSD_ATF_TESTS_C+= swab + +.include "../Makefile.netbsd-tests" + +LDADD.memchr+= -lmd +DPADD.memchr+= ${LIBMD} + +LDADD.memcpy+= -lmd +DPADD.memcpy+= ${LIBMD} + +.include Added: head/lib/libc/tests/sys/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,85 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/sys + +# TODO: clone, lwp_create, lwp_ctl, posix_fadvise, recvmmsg, +# swapcontext +NETBSD_ATF_TESTS_C+= access_test +NETBSD_ATF_TESTS_C+= chroot_test +NETBSD_ATF_TESTS_C+= clock_gettime_test +NETBSD_ATF_TESTS_C+= connect_test +NETBSD_ATF_TESTS_C+= dup_test +NETBSD_ATF_TESTS_C+= fsync_test +NETBSD_ATF_TESTS_C+= getcontext_test +NETBSD_ATF_TESTS_C+= getgroups_test +NETBSD_ATF_TESTS_C+= getitimer_test +NETBSD_ATF_TESTS_C+= getlogin_test +NETBSD_ATF_TESTS_C+= getpid_test +NETBSD_ATF_TESTS_C+= getrusage_test +NETBSD_ATF_TESTS_C+= getsid_test +NETBSD_ATF_TESTS_C+= gettimeofday_test +NETBSD_ATF_TESTS_C+= issetugid_test +NETBSD_ATF_TESTS_C+= kevent_test +NETBSD_ATF_TESTS_C+= kill_test +NETBSD_ATF_TESTS_C+= link_test +NETBSD_ATF_TESTS_C+= listen_test +NETBSD_ATF_TESTS_C+= mincore_test +NETBSD_ATF_TESTS_C+= mkdir_test +NETBSD_ATF_TESTS_C+= mkfifo_test +NETBSD_ATF_TESTS_C+= mknod_test +NETBSD_ATF_TESTS_C+= mlock_test +NETBSD_ATF_TESTS_C+= mmap_test +NETBSD_ATF_TESTS_C+= mprotect_test +NETBSD_ATF_TESTS_C+= msgctl_test +NETBSD_ATF_TESTS_C+= msgget_test +NETBSD_ATF_TESTS_C+= msgrcv_test +NETBSD_ATF_TESTS_C+= msgsnd_test +NETBSD_ATF_TESTS_C+= msync_test +NETBSD_ATF_TESTS_C+= nanosleep_test +NETBSD_ATF_TESTS_C+= pipe_test +NETBSD_ATF_TESTS_C+= pipe2_test +NETBSD_ATF_TESTS_C+= poll_test +NETBSD_ATF_TESTS_C+= revoke_test +NETBSD_ATF_TESTS_C+= select_test +NETBSD_ATF_TESTS_C+= setrlimit_test +NETBSD_ATF_TESTS_C+= setuid_test +NETBSD_ATF_TESTS_C+= sigaction_test +NETBSD_ATF_TESTS_C+= sigqueue_test +NETBSD_ATF_TESTS_C+= sigtimedwait_test +NETBSD_ATF_TESTS_C+= socketpair_test +NETBSD_ATF_TESTS_C+= stat_test +NETBSD_ATF_TESTS_C+= timer_create_test +NETBSD_ATF_TESTS_C+= truncate_test +NETBSD_ATF_TESTS_C+= ucontext_test +NETBSD_ATF_TESTS_C+= umask_test +NETBSD_ATF_TESTS_C+= unlink_test +NETBSD_ATF_TESTS_C+= write_test + +DPADD.getpid_test+= ${LIBPTHREAD} +LDADD.getpid_test+= -lpthread +DPADD.timer_create_test+= ${LIBRT} +LDADD.timer_create_test+= -lrt + +.include "../Makefile.netbsd-tests" + +.if ${COMPILER_TYPE} == "gcc" +WARNS?= 3 +.else +WARNS?= 4 +.endif + +FILESGROUPS= FILES truncate_test_FILES + +truncate_test_FILES= truncate_test.root_owned +truncate_test_FILESDIR= ${TESTSDIR} +truncate_test_FILESMODE= 0600 +truncate_test_FILESOWNER= root +truncate_test_FILESGRP= wheel + +CLEANFILES= truncate_test.root_owned +truncate_test.root_owned: + dd if=/dev/null bs=1 count=1 of=${.TARGET} + +.include Added: head/lib/libc/tests/termios/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/termios/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/termios + +NETBSD_ATF_TESTS_C= tcsetpgrp_test + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/time/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/time/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/time + +NETBSD_ATF_TESTS_C= mktime_test +NETBSD_ATF_TESTS_C+= strptime_test + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/tls/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/tls/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/tls +.if !defined(NO_PIC) +SUBDIR+= dso +.endif + +# TODO: doesn't link properly (for some odd reason it's trying to link in +# libatf.so) +#NETBSD_ATF_TESTS_C= tls_static_test +.if !defined(NO_PIC) +NETBSD_ATF_TESTS_C+= tls_dlopen_test +NETBSD_ATF_TESTS_C+= tls_dynamic_test +.endif + +.include "../Makefile.netbsd-tests" + +DSODIR= ${.OBJDIR}/../tls_dso + +DPADD.tls_static_test+= ${LIBPTHREAD} +LDADD.tls_static_test+= -lpthread +LDFLAGS.tls_static_test+= -static +SRCS.tls_static_test= t_tls_static.c t_tls_static_helper.c + +DPADD.tls_dynamic_test+= ${LIBPTHREAD} ${DSODIR}/libh_tls_dynamic.so +LDADD.tls_dynamic_test+= -lpthread -lh_tls_dynamic +LDFLAGS.tls_dynamic_test+= -Wl,-rpath,${TESTSDIR} -L${DSODIR} + +DPADD.tls_dlopen_test+= ${LIBPTHREAD} +LDADD.tls_dlopen_test+= -lpthread +LDFLAGS.tls_dlopen_test+= -Wl,-rpath,${TESTSDIR} -Wl,-export-dynamic + +.include Added: head/lib/libc/tests/tls/dso/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/tls/dso/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +OBJTOP= ${.OBJDIR:H:H:H:H:H} +SRCTOP= ${.CURDIR:H:H:H:H:H} +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/lib/libc/tls/${.CURDIR:T} + +LIB= h_tls_dlopen +SHLIB_NAME= h_tls_dlopen.so +SRCS= h_tls_dlopen.c + +MAN= + +LIBDIR= ${TESTSBASE}/lib/libc/tls +SHLIB_MAJOR= 1 + +.include "../../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/tls_dso/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/tls_dso/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.include + +LIB= h_tls_dynamic +SRCS= h_tls_dynamic.c + +LIBDIR= ${TESTSBASE}/lib/libc/tls +SHLIBDIR= ${TESTSBASE}/lib/libc/tls +SHLIB_MAJOR= 1 + +WITHOUT_STATIC= +WITHOUT_PROFILE= +WITHOUT_PIC= + +MAN= + +.include "../Makefile.netbsd-tests" + +.include Added: head/lib/libc/tests/ttyio/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/ttyio/Makefile Tue Nov 4 00:56:25 2014 (r274075) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/lib/libc/ttyio + +# TODO: ptm_test +NETBSD_ATF_TESTS_C= ttyio_test + +DPADD.ttyio_test+= ${LIBUTIL} +LDADD.ttyio_test+= -lutil + +.include "../Makefile.netbsd-tests" + +.include From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 01:06:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7595FBE9; Tue, 4 Nov 2014 01:06:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56C736CC; Tue, 4 Nov 2014 01:06:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA416Yu1037929; Tue, 4 Nov 2014 01:06:34 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA416Y6M037928; Tue, 4 Nov 2014 01:06:34 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201411040106.sA416Y6M037928@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Tue, 4 Nov 2014 01:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274076 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 01:06:34 -0000 Author: tychon Date: Tue Nov 4 01:06:33 2014 New Revision: 274076 URL: https://svnweb.freebsd.org/changeset/base/274076 Log: Improve the ability to cancel an in-flight request by using an interrupt, via SIGCONT, to force the read or write system call to return prematurely. Reviewed by: grehan Modified: head/usr.sbin/bhyve/block_if.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Tue Nov 4 00:56:25 2014 (r274075) +++ head/usr.sbin/bhyve/block_if.c Tue Nov 4 01:06:33 2014 (r274076) @@ -43,9 +43,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + #include "bhyverun.h" +#include "mevent.h" #include "block_if.h" #define BLOCKIF_SIG 0xb109b109 @@ -60,7 +64,9 @@ enum blockop { enum blockstat { BST_FREE, - BST_INUSE + BST_PEND, + BST_BUSY, + BST_DONE }; struct blockif_elem { @@ -68,6 +74,7 @@ struct blockif_elem { struct blockif_req *be_req; enum blockop be_op; enum blockstat be_status; + pthread_t be_tid; }; struct blockif_ctxt { @@ -81,13 +88,25 @@ struct blockif_ctxt { pthread_cond_t bc_cond; int bc_closing; - /* Request elements and free/inuse queues */ + /* Request elements and free/pending/busy queues */ TAILQ_HEAD(, blockif_elem) bc_freeq; - TAILQ_HEAD(, blockif_elem) bc_inuseq; + TAILQ_HEAD(, blockif_elem) bc_pendq; + TAILQ_HEAD(, blockif_elem) bc_busyq; u_int bc_req_count; struct blockif_elem bc_reqs[BLOCKIF_MAXREQ]; }; +static pthread_once_t blockif_once = PTHREAD_ONCE_INIT; + +struct blockif_sig_elem { + pthread_mutex_t bse_mtx; + pthread_cond_t bse_cond; + int bse_pending; + struct blockif_sig_elem *bse_next; +}; + +static struct blockif_sig_elem *blockif_bse_head; + static int blockif_enqueue(struct blockif_ctxt *bc, struct blockif_req *breq, enum blockop op) @@ -101,10 +120,10 @@ blockif_enqueue(struct blockif_ctxt *bc, assert(be->be_status == BST_FREE); TAILQ_REMOVE(&bc->bc_freeq, be, be_link); - be->be_status = BST_INUSE; + be->be_status = BST_PEND; be->be_req = breq; be->be_op = op; - TAILQ_INSERT_TAIL(&bc->bc_inuseq, be, be_link); + TAILQ_INSERT_TAIL(&bc->bc_pendq, be, be_link); bc->bc_req_count++; @@ -112,26 +131,38 @@ blockif_enqueue(struct blockif_ctxt *bc, } static int -blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem *el) +blockif_dequeue(struct blockif_ctxt *bc, struct blockif_elem **bep) { struct blockif_elem *be; if (bc->bc_req_count == 0) return (ENOENT); - be = TAILQ_FIRST(&bc->bc_inuseq); + be = TAILQ_FIRST(&bc->bc_pendq); assert(be != NULL); - assert(be->be_status == BST_INUSE); - *el = *be; + assert(be->be_status == BST_PEND); + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + be->be_status = BST_BUSY; + be->be_tid = bc->bc_btid; + TAILQ_INSERT_TAIL(&bc->bc_busyq, be, be_link); + + *bep = be; - TAILQ_REMOVE(&bc->bc_inuseq, be, be_link); + return (0); +} + +static void +blockif_complete(struct blockif_ctxt *bc, struct blockif_elem *be) +{ + assert(be->be_status == BST_DONE); + + TAILQ_REMOVE(&bc->bc_busyq, be, be_link); + be->be_tid = 0; be->be_status = BST_FREE; be->be_req = NULL; TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - - bc->bc_req_count--; - return (0); + bc->bc_req_count--; } static void @@ -163,6 +194,8 @@ blockif_proc(struct blockif_ctxt *bc, st break; } + be->be_status = BST_DONE; + (*br->br_callback)(br, err); } @@ -170,16 +203,17 @@ static void * blockif_thr(void *arg) { struct blockif_ctxt *bc; - struct blockif_elem req; + struct blockif_elem *be; bc = arg; for (;;) { pthread_mutex_lock(&bc->bc_mtx); - while (!blockif_dequeue(bc, &req)) { + while (!blockif_dequeue(bc, &be)) { pthread_mutex_unlock(&bc->bc_mtx); - blockif_proc(bc, &req); + blockif_proc(bc, be); pthread_mutex_lock(&bc->bc_mtx); + blockif_complete(bc, be); } pthread_cond_wait(&bc->bc_cond, &bc->bc_mtx); pthread_mutex_unlock(&bc->bc_mtx); @@ -195,6 +229,38 @@ blockif_thr(void *arg) return (NULL); } +static void +blockif_sigcont_handler(int signal, enum ev_type type, void *arg) +{ + struct blockif_sig_elem *bse; + + for (;;) { + /* + * Process the entire list even if not intended for + * this thread. + */ + do { + bse = blockif_bse_head; + if (bse == NULL) + return; + } while (!atomic_cmpset_ptr((uintptr_t *)&blockif_bse_head, + (uintptr_t)bse, + (uintptr_t)bse->bse_next)); + + pthread_mutex_lock(&bse->bse_mtx); + bse->bse_pending = 0; + pthread_cond_signal(&bse->bse_cond); + pthread_mutex_unlock(&bse->bse_mtx); + } +} + +static void +blockif_init(void) +{ + mevent_add(SIGCONT, EVF_SIGNAL, blockif_sigcont_handler, NULL); + (void) signal(SIGCONT, SIG_IGN); +} + struct blockif_ctxt * blockif_open(const char *optstr, const char *ident) { @@ -206,6 +272,8 @@ blockif_open(const char *optstr, const c int extra, fd, i, sectsz; int nocache, sync, ro; + pthread_once(&blockif_once, blockif_init); + nocache = 0; sync = 0; ro = 0; @@ -280,7 +348,8 @@ blockif_open(const char *optstr, const c pthread_mutex_init(&bc->bc_mtx, NULL); pthread_cond_init(&bc->bc_cond, NULL); TAILQ_INIT(&bc->bc_freeq); - TAILQ_INIT(&bc->bc_inuseq); + TAILQ_INIT(&bc->bc_pendq); + TAILQ_INIT(&bc->bc_busyq); bc->bc_req_count = 0; for (i = 0; i < BLOCKIF_MAXREQ; i++) { bc->bc_reqs[i].be_status = BST_FREE; @@ -357,23 +426,76 @@ blockif_cancel(struct blockif_ctxt *bc, assert(bc->bc_magic == BLOCKIF_SIG); pthread_mutex_lock(&bc->bc_mtx); - TAILQ_FOREACH(be, &bc->bc_inuseq, be_link) { + /* + * Check pending requests. + */ + TAILQ_FOREACH(be, &bc->bc_pendq, be_link) { + if (be->be_req == breq) + break; + } + if (be != NULL) { + /* + * Found it. + */ + TAILQ_REMOVE(&bc->bc_pendq, be, be_link); + be->be_status = BST_FREE; + be->be_req = NULL; + TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); + bc->bc_req_count--; + pthread_mutex_unlock(&bc->bc_mtx); + + return (0); + } + + /* + * Check in-flight requests. + */ + TAILQ_FOREACH(be, &bc->bc_busyq, be_link) { if (be->be_req == breq) break; } if (be == NULL) { + /* + * Didn't find it. + */ pthread_mutex_unlock(&bc->bc_mtx); return (EINVAL); } - TAILQ_REMOVE(&bc->bc_inuseq, be, be_link); - be->be_status = BST_FREE; - be->be_req = NULL; - TAILQ_INSERT_TAIL(&bc->bc_freeq, be, be_link); - bc->bc_req_count--; + /* + * Interrupt the processing thread to force it return + * prematurely via it's normal callback path. + */ + while (be->be_status == BST_BUSY) { + struct blockif_sig_elem bse, *old_head; + + pthread_mutex_init(&bse.bse_mtx, NULL); + pthread_cond_init(&bse.bse_cond, NULL); + + bse.bse_pending = 1; + + do { + old_head = blockif_bse_head; + bse.bse_next = old_head; + } while (!atomic_cmpset_ptr((uintptr_t *)&blockif_bse_head, + (uintptr_t)old_head, + (uintptr_t)&bse)); + + pthread_kill(be->be_tid, SIGCONT); + + pthread_mutex_lock(&bse.bse_mtx); + while (bse.bse_pending) + pthread_cond_wait(&bse.bse_cond, &bse.bse_mtx); + pthread_mutex_unlock(&bse.bse_mtx); + } + pthread_mutex_unlock(&bc->bc_mtx); - return (0); + /* + * The processing thread has been interrupted. Since it's not + * clear if the callback has been invoked yet, return EBUSY. + */ + return (EBUSY); } int From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 01:57:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 797A3411; Tue, 4 Nov 2014 01:57:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8BEBB0; Tue, 4 Nov 2014 01:57:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA41vWYN060950; Tue, 4 Nov 2014 01:57:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA41vVeN060944; Tue, 4 Nov 2014 01:57:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040157.sA41vVeN060944@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 01:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274077 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 01:57:32 -0000 Author: ngie Date: Tue Nov 4 01:57:31 2014 New Revision: 274077 URL: https://svnweb.freebsd.org/changeset/base/274077 Log: As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when generating files from various sources instead of calling cat ${.ALLSRC} | sed The perl case was skipped because it's not being used in the tree at this time Modified: head/share/mk/atf.test.mk head/share/mk/plain.test.mk head/share/mk/tap.test.mk Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Tue Nov 4 01:06:33 2014 (r274076) +++ head/share/mk/atf.test.mk Tue Nov 4 01:57:31 2014 (r274077) @@ -113,8 +113,12 @@ ATF_TESTS_SH_SED_${_T}?= # empty ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${ATF_TESTS_SH_SRC_${_T}} echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp +.if empty(ATF_TESTS_SH_SED_${_T}) + cat ${.ALLSRC:N*Makefile*} >>${.TARGET}.tmp +.else cat ${.ALLSRC:N*Makefile*} \ | sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor Modified: head/share/mk/plain.test.mk ============================================================================== --- head/share/mk/plain.test.mk Tue Nov 4 01:06:33 2014 (r274076) +++ head/share/mk/plain.test.mk Tue Nov 4 01:57:31 2014 (r274077) @@ -57,8 +57,12 @@ CLEANFILES+= ${_T} ${_T}.tmp PLAIN_TESTS_SH_SED_${_T}?= # empty PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}} +.if empty(PLAIN_TESTS_SH_SED_${_T}) + cat ${.ALLSRC:N*Makefile*} >${.TARGET}.tmp +.else cat ${.ALLSRC:N*Makefile*} \ | sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor Modified: head/share/mk/tap.test.mk ============================================================================== --- head/share/mk/tap.test.mk Tue Nov 4 01:06:33 2014 (r274076) +++ head/share/mk/tap.test.mk Tue Nov 4 01:57:31 2014 (r274077) @@ -86,7 +86,11 @@ CLEANFILES+= ${_T} ${_T}.tmp TAP_TESTS_SH_SED_${_T}?= # empty TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh ${_T}: ${TAP_TESTS_SH_SRC_${_T}} +.if empty(TAP_TESTS_SH_SED_${_T}) + cat ${.ALLSRC} >${.TARGET}.tmp +.else cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp +.endif chmod +x ${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} .endfor From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 02:00:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97F33649; Tue, 4 Nov 2014 02:00:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84988BC6; Tue, 4 Nov 2014 02:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4208Vl061615; Tue, 4 Nov 2014 02:00:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4208VQ061614; Tue, 4 Nov 2014 02:00:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040200.sA4208VQ061614@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 02:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274078 - head/lib/libnetbsd/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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 02:00:08 -0000 Author: ngie Date: Tue Nov 4 02:00:07 2014 New Revision: 274078 URL: https://svnweb.freebsd.org/changeset/base/274078 Log: Commit missing header for sys/time.h compat on NetBSD to unbreak the amd64/i386 build Pointyhat to: me (forgot to svn add it sooner) Added: head/lib/libnetbsd/sys/time.h (contents, props changed) Added: head/lib/libnetbsd/sys/time.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnetbsd/sys/time.h Tue Nov 4 02:00:07 2014 (r274078) @@ -0,0 +1,65 @@ +/* $FreeBSD$ */ + +/* + * Copyright (c) 1982, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)time.h 8.5 (Berkeley) 5/4/95 + */ + +#ifndef _LIBNETBSD_SYS_TIME_H_ +#define _LIBNETBSD_SYS_TIME_H_ + +#include_next + +/* Operations on timespecs. */ +#define timespecclear(tsp) (tsp)->tv_sec = (time_t)((tsp)->tv_nsec = 0L) +#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) +#define timespeccmp(tsp, usp, cmp) \ + (((tsp)->tv_sec == (usp)->tv_sec) ? \ + ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ + ((tsp)->tv_sec cmp (usp)->tv_sec)) +#define timespecadd(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ + if ((vsp)->tv_nsec >= 1000000000L) { \ + (vsp)->tv_sec++; \ + (vsp)->tv_nsec -= 1000000000L; \ + } \ + } while (/* CONSTCOND */ 0) +#define timespecsub(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ + if ((vsp)->tv_nsec < 0) { \ + (vsp)->tv_sec--; \ + (vsp)->tv_nsec += 1000000000L; \ + } \ + } while (/* CONSTCOND */ 0) + +#endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 05:02:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABB0EC9C; Tue, 4 Nov 2014 05:02:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93A82E69; Tue, 4 Nov 2014 05:02:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA452RRw050249; Tue, 4 Nov 2014 05:02:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA452N2d050227; Tue, 4 Nov 2014 05:02:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411040502.sA452N2d050227@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 05:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274079 - in head: contrib/netbsd-tests/include contrib/netbsd-tests/lib/libc/gen contrib/netbsd-tests/lib/libc/stdlib contrib/netbsd-tests/lib/libc/sys contrib/netbsd-tests/lib/libc/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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 05:02:27 -0000 Author: ngie Date: Tue Nov 4 05:02:22 2014 New Revision: 274079 URL: https://svnweb.freebsd.org/changeset/base/274079 Log: Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after atf-c/config.h was removed from the build Pointyhat to: me (again, for not running make delete-old after running test builds) Modified: head/contrib/netbsd-tests/include/t_paths.c head/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c head/contrib/netbsd-tests/lib/libc/gen/t_isnan.c head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c head/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c head/contrib/netbsd-tests/lib/libc/time/t_mktime.c head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c head/contrib/netbsd-tests/lib/libm/t_ldexp.c head/contrib/netbsd-tests/lib/libm/t_log.c head/contrib/netbsd-tests/lib/libm/t_precision.c head/contrib/netbsd-tests/lib/libpthread/t_mutex.c head/contrib/netbsd-tests/lib/libpthread/t_sem.c head/share/mk/bsd.progs.mk head/share/mk/netbsd-tests.test.mk Modified: head/contrib/netbsd-tests/include/t_paths.c ============================================================================== --- head/contrib/netbsd-tests/include/t_paths.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/include/t_paths.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_paths.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $"); +__RCSID("$NetBSD: t_paths.c,v 1.14 2014/11/04 00:20:19 justin Exp $"); #include #include @@ -42,7 +42,6 @@ __RCSID("$NetBSD: t_paths.c,v 1.13 2014/ #include #include -#include #define PATH_DEV __BIT(0) /* A device node */ #define PATH_DIR __BIT(1) /* A directory */ Modified: head/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_floatunditf.c,v 1.5 2014/02/02 08:16:22 martin Exp $ */ +/* $NetBSD: t_floatunditf.c,v 1.6 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -27,7 +27,6 @@ */ #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fpsetmask.c,v 1.13 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_fpsetmask.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 1995 The NetBSD Foundation, Inc. @@ -29,7 +29,6 @@ #include #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libc/gen/t_isnan.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_isnan.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/gen/t_isnan.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_isnan.c,v 1.4 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_isnan.c,v 1.5 2014/11/04 00:20:19 justin Exp $ */ /* * This file is in the Public Domain. @@ -10,7 +10,6 @@ #include #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_siginfo.c,v 1.23 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_siginfo.c,v 1.24 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -27,7 +27,6 @@ */ #include -#include #if defined(__NetBSD__) #include Modified: head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $ */ +/* $NetBSD: t_strtod.c,v 1.32 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ /* Public domain, Otto Moerbeek , 2006. */ #include -__RCSID("$NetBSD: t_strtod.c,v 1.31 2012/09/26 07:24:38 jruoho Exp $"); +__RCSID("$NetBSD: t_strtod.c,v 1.32 2014/11/04 00:20:19 justin Exp $"); #include #include @@ -41,7 +41,6 @@ __RCSID("$NetBSD: t_strtod.c,v 1.31 2012 #include #include -#include #if defined(__i386__) || defined(__amd64__) || defined(__sparc__) #include Modified: head/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sigaction.c,v 1.2 2012/11/07 16:51:16 pgoyette Exp $ */ +/* $NetBSD: t_sigaction.c,v 1.3 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2010\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sigaction.c,v 1.2 2012/11/07 16:51:16 pgoyette Exp $"); +__RCSID("$NetBSD: t_sigaction.c,v 1.3 2014/11/04 00:20:19 justin Exp $"); #include @@ -40,7 +40,6 @@ __RCSID("$NetBSD: t_sigaction.c,v 1.2 20 #include #include -#include #ifdef __NetBSD__ #include "../../../h_macros.h" Modified: head/contrib/netbsd-tests/lib/libc/time/t_mktime.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/time/t_mktime.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libc/time/t_mktime.c Tue Nov 4 05:02:22 2014 (r274079) @@ -72,12 +72,7 @@ ATF_TC_BODY(mktime_negyear, tc) errno = 0; t = mktime(&tms); -#if defined(__FreeBSD__) - /* Open Group says "and may set errno to indicate the error" */ - ATF_REQUIRE(t == (time_t)-1); -#else ATF_REQUIRE_ERRNO(0, t != (time_t)-1); -#endif } ATF_TC(timegm_epoch); Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_backtrace.c,v 1.15 2014/05/01 03:46:11 joerg Exp $ */ +/* $NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,10 +29,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_backtrace.c,v 1.15 2014/05/01 03:46:11 joerg Exp $"); +__RCSID("$NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $"); #include -#include #include #include #include Modified: head/contrib/netbsd-tests/lib/libm/t_ldexp.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_ldexp.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libm/t_ldexp.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ldexp.c,v 1.13 2014/03/12 21:40:07 martin Exp $ */ +/* $NetBSD: t_ldexp.c,v 1.14 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,12 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_ldexp.c,v 1.13 2014/03/12 21:40:07 martin Exp $"); +__RCSID("$NetBSD: t_ldexp.c,v 1.14 2014/11/04 00:20:19 justin Exp $"); #include #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libm/t_log.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_log.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libm/t_log.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_log.c,v 1.11 2014/03/03 10:39:08 martin Exp $ */ +/* $NetBSD: t_log.c,v 1.12 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,10 +29,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_log.c,v 1.11 2014/03/03 10:39:08 martin Exp $"); +__RCSID("$NetBSD: t_log.c,v 1.12 2014/11/04 00:20:19 justin Exp $"); #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libm/t_precision.c ============================================================================== --- head/contrib/netbsd-tests/lib/libm/t_precision.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libm/t_precision.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_precision.c,v 1.1 2013/11/11 11:10:45 joerg Exp $ */ +/* $NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -29,10 +29,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_precision.c,v 1.1 2013/11/11 11:10:45 joerg Exp $"); +__RCSID("$NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $"); #include -#include #include #include Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mutex.c,v 1.6 2014/02/09 21:26:07 jmmv Exp $ */ +/* $NetBSD: t_mutex.c,v 1.7 2014/11/04 00:20:19 justin Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_mutex.c,v 1.6 2014/02/09 21:26:07 jmmv Exp $"); +__RCSID("$NetBSD: t_mutex.c,v 1.7 2014/11/04 00:20:19 justin Exp $"); #include #include @@ -37,7 +37,6 @@ __RCSID("$NetBSD: t_mutex.c,v 1.6 2014/0 #include #include -#include #include "h_common.h" Modified: head/contrib/netbsd-tests/lib/libpthread/t_sem.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_sem.c Tue Nov 4 02:00:07 2014 (r274078) +++ head/contrib/netbsd-tests/lib/libpthread/t_sem.c Tue Nov 4 05:02:22 2014 (r274079) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sem.c,v 1.7 2012/03/09 19:46:37 joerg Exp $ */ +/* $NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $ */ /* * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. @@ -86,7 +86,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008, 2010\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sem.c,v 1.7 2012/03/09 19:46:37 joerg Exp $"); +__RCSID("$NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $"); #include #include @@ -99,7 +99,6 @@ __RCSID("$NetBSD: t_sem.c,v 1.7 2012/03/ #include #include -#include #include "h_common.h" Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Tue Nov 4 02:00:07 2014 (r274078) +++ head/share/mk/bsd.progs.mk Tue Nov 4 05:02:22 2014 (r274079) @@ -42,7 +42,7 @@ PROG ?= $t .if defined(PROG) # just one of many -PROG_OVERRIDE_VARS += BINDIR MAN SRCS +PROG_OVERRIDE_VARS += BINDIR DPSRCS MAN SRCS PROG_VARS += CFLAGS CPPFLAGS CXXFLAGS DPADD DPLIBS LDADD LDFLAGS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) @@ -75,6 +75,12 @@ UPDATE_DEPENDFILE = NO .endif .endif +# The non-recursive call to bsd.progs.mk will handle FILES; NUL out +# FILESGROUPS so recursive calls don't duplicate the work +.ifdef _RECURSING_PROGS +FILESGROUPS= +.endif + # handle being called [bsd.]progs.mk .include Modified: head/share/mk/netbsd-tests.test.mk ============================================================================== --- head/share/mk/netbsd-tests.test.mk Tue Nov 4 02:00:07 2014 (r274078) +++ head/share/mk/netbsd-tests.test.mk Tue Nov 4 05:02:22 2014 (r274079) @@ -21,9 +21,6 @@ LIBNETBSD_SRCDIR= ${SRCTOP}/lib/libnetbs LIBNETBSD_OBJDIR= ${OBJTOP}/lib/libnetbsd .for t in ${NETBSD_ATF_TESTS_C} -# XXX: needed for atf-c/config.h after v0.2.1 upgrade. See NetBSD PR # -# misc/49356 for more details -CFLAGS.$t+= -I${SRCTOP}/contrib/atf CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 05:41:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98CF63AD; Tue, 4 Nov 2014 05:41:50 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DC95219; Tue, 4 Nov 2014 05:41:49 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x13so12718101wgg.33 for ; Mon, 03 Nov 2014 21:41:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=4MzNrU7qXZvL6GEMDm+tXCCCaqKYQHMH9/APEqCrq3U=; b=RPKOmRNkLWLi02TG1pLSRoBJez4HveoVlNkNLRBiGK4JczitmffYDX2ielz34AK3o+ RilxyLV1Ko1O6ZI7A0dgJ4DSibS3R20mPlhDUDPAnOPwR1MX/u8gMCYFxKqJ0GJ7J1q5 82uupuuKcaQspAGDdQUfiGeoa9C8VMbvVbfk4drJOfw0EanDHySmPdy0jNE+Cz6ANxKt dLCkKVlzk2cobsv27CU/NF9UbhGxIQW9Kvos+DPjnqsIqLQJo6rk9TpSgrXNSIbtS6pv uZ5TpnfMfHuT7yBiqXEXGcFtYMfGOJqTlpbdhUhvACQVyR8p70DPpRDbn/i2DNf38cAv u/0A== X-Received: by 10.180.82.170 with SMTP id j10mr21503553wiy.35.1415079707917; Mon, 03 Nov 2014 21:41:47 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id v10sm7271281wiy.21.2014.11.03.21.41.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 21:41:47 -0800 (PST) Date: Tue, 4 Nov 2014 06:41:44 +0100 From: Mateusz Guzik To: Poul-Henning Kamp Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104054144.GB4032@dft-labs.eu> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> <79454.1415043356@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <79454.1415043356@critter.freebsd.dk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Hans Petter Selasky , src-committers@freebsd.org, jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 05:41:50 -0000 re-sent with trimmed cc On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: > -------- > In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: > > >This optimization is probably minor, but reminds me of other syscalls > >that would benefit using a single largish allocation up front: > >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > > bytes and more. An 8K stack has plently to spare after allocating > > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't > > exist. Only a limit to prevent denial of service is needed. > > We should actually roll a new rev of all syscalls which take a path > and have them pass strlen(path)+1 into the kernel. > > That would allow both precise allocation and faster copyin, followed > by a check that the last byte is (still) a NUL. > I think we can speed up things on amd64 no problem without affecting userspace. amd64's copyinstr (and most likely all others) copy byte by byte. What we can do is copy word size and fall back to byte by byte on page fault. Ten on each iteration check if 0 was encountered. Maybe there will be a way of doing it in even in C without much hassle. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 07:44:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 136F39F8; Tue, 4 Nov 2014 07:44:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E823EEFE; Tue, 4 Nov 2014 07:44:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA47iOem025027; Tue, 4 Nov 2014 07:44:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA47iOkn025026; Tue, 4 Nov 2014 07:44:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411040744.sA47iOkn025026@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Nov 2014 07:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274080 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 07:44:25 -0000 Author: mav Date: Tue Nov 4 07:44:24 2014 New Revision: 274080 URL: https://svnweb.freebsd.org/changeset/base/274080 Log: Improve error handling around duplicate lun and port enable. This fixes kernel panic if port enabled twice and then disabled. MFC after: 1 week Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Nov 4 05:02:22 2014 (r274079) +++ head/sys/cam/ctl/scsi_ctl.c Tue Nov 4 07:44:24 2014 (r274080) @@ -1796,6 +1796,7 @@ ctlfe_online(void *arg) struct cam_path *path; cam_status status; struct ctlfe_lun_softc *lun_softc; + struct cam_periph *periph; bus_softc = (struct ctlfe_softc *)arg; @@ -1821,13 +1822,17 @@ ctlfe_online(void *arg) } xpt_path_lock(path); + periph = cam_periph_find(path, "ctl"); + if (periph != NULL) { + /* We've already got a periph, no need to alloc a new one. */ + xpt_path_unlock(path); + xpt_free_path(path); + free(lun_softc, M_CTLFE); + return; + } lun_softc->parent_softc = bus_softc; lun_softc->flags |= CTLFE_LUN_WILDCARD; - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - status = cam_periph_alloc(ctlferegister, ctlfeoninvalidate, ctlfecleanup, @@ -1843,14 +1848,17 @@ ctlfe_online(void *arg) const struct cam_status_entry *entry; entry = cam_fetch_status_entry(status); - printf("%s: CAM error %s (%#x) returned from " "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); + free(lun_softc, M_CTLFE); + } else { + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); + ctlfe_onoffline(arg, /*online*/ 1); } - ctlfe_onoffline(arg, /*online*/ 1); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1924,11 +1932,7 @@ ctlfe_lun_enable(void *arg, struct ctl_i free(softc, M_CTLFE); return (0); } - softc->parent_softc = bus_softc; - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); status = cam_periph_alloc(ctlferegister, ctlfeoninvalidate, @@ -1941,6 +1945,21 @@ ctlfe_lun_enable(void *arg, struct ctl_i 0, softc); + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(status); + printf("%s: CAM error %s (%#x) returned from " + "cam_periph_alloc()\n", __func__, (entry != NULL) ? + entry->status_text : "Unknown", status); + free(softc, M_CTLFE); + } else { + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); + ctlfe_onoffline(arg, /*online*/ 1); + } + xpt_path_unlock(path); xpt_free_path(path); return (0); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 07:50:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7CBBBBD; Tue, 4 Nov 2014 07:50:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3BBAF25; Tue, 4 Nov 2014 07:50:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA47oLSu026498; Tue, 4 Nov 2014 07:50:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA47oLB9026497; Tue, 4 Nov 2014 07:50:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411040750.sA47oLB9026497@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Nov 2014 07:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274081 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 07:50:21 -0000 Author: mav Date: Tue Nov 4 07:50:20 2014 New Revision: 274081 URL: https://svnweb.freebsd.org/changeset/base/274081 Log: Fix residual copy/paste in r274080. MFC after: 1 week Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Nov 4 07:44:24 2014 (r274080) +++ head/sys/cam/ctl/scsi_ctl.c Tue Nov 4 07:50:20 2014 (r274081) @@ -1957,7 +1957,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i mtx_lock(&bus_softc->lun_softc_mtx); STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 07:50:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E1BDD00; Tue, 4 Nov 2014 07:50:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E91AF2D; Tue, 4 Nov 2014 07:50:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA47oorZ027063; Tue, 4 Nov 2014 07:50:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA47onOm027052; Tue, 4 Nov 2014 07:50:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411040750.sA47onOm027052@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 4 Nov 2014 07:50: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: r274082 - in stable/10: etc/mtree lib/libutil usr.sbin/pw usr.sbin/pw/tests 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 07:50:51 -0000 Author: bapt Date: Tue Nov 4 07:50:48 2014 New Revision: 274082 URL: https://svnweb.freebsd.org/changeset/base/274082 Log: MFC: 272445,272578,273772,273779,273782,273786,273787,273791 Add a test for bug 191427 where pw(8) will go into an infinite loop Add some tests for modifying groups When a group is renamed then the group has been invalidated for sure. In that case get the group information using the new name. Fix a regression in pw usermod -G list The user was perperly adding the to different groups from "list" but was not removed from the other groups it could have belong to. Do not delete the group wheel when bad argument is passed to pw groupdel -g Check that the -g argument is actually a number, if not report an error. This argument is converted without checking with atoi(3) later so without this check it converts any alpha entries into 0 meaning it deletes the group wheel Ensure pw userdel -u do not try to remove root Check the uid passed is actually a number as early as possible Fix renaming a group via the gr_copy function Add a regression test to pw(8) because the bug was discovered via using: pw groupmod PR: 193704 [1], 185666 [2], 90114 [3], 187189 [4] Submitted by: Marc de la Gueronniere [4] Reported by: az [1], sub.mesa@gmail.com [2], bkoenig@cs.tu-berlin.de [3], mcdouga9@egr.msu.edu [4] Added: stable/10/usr.sbin/pw/tests/ - copied from r272445, head/usr.sbin/pw/tests/ stable/10/usr.sbin/pw/tests/pw_modify.sh - copied, changed from r272578, head/usr.sbin/pw/tests/pw_modify.sh Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libutil/gr_util.c stable/10/usr.sbin/pw/Makefile stable/10/usr.sbin/pw/pw_group.c stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/Makefile stable/10/usr.sbin/pw/tests/pw_delete.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/etc/mtree/BSD.tests.dist Tue Nov 4 07:50:48 2014 (r274082) @@ -273,6 +273,8 @@ .. newsyslog .. + pw + .. sa .. .. Modified: stable/10/lib/libutil/gr_util.c ============================================================================== --- stable/10/lib/libutil/gr_util.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/lib/libutil/gr_util.c Tue Nov 4 07:50:48 2014 (r274082) @@ -170,14 +170,21 @@ gr_copy(int ffd, int tfd, const struct g size_t len; int eof, readlen; - sgr = gr; + if (old_gr == NULL && gr == NULL) + return(-1); + + sgr = old_gr; + /* deleting a group */ if (gr == NULL) { line = NULL; - if (old_gr == NULL) + } else { + if ((line = gr_make(gr)) == NULL) return (-1); - sgr = old_gr; - } else if ((line = gr_make(gr)) == NULL) - return (-1); + } + + /* adding a group */ + if (sgr == NULL) + sgr = gr; eof = 0; len = 0; Modified: stable/10/usr.sbin/pw/Makefile ============================================================================== --- stable/10/usr.sbin/pw/Makefile Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/Makefile Tue Nov 4 07:50:48 2014 (r274082) @@ -1,14 +1,20 @@ # $FreeBSD$ +.include + PROG= pw MAN= pw.conf.5 pw.8 SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ grupd.c pwupd.c fileupd.c psdate.c \ bitmap.c cpdir.c rm_r.c -WARNS?= 2 +WARNS?= 3 DPADD= ${LIBCRYPT} ${LIBUTIL} LDADD= -lcrypt -lutil +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: stable/10/usr.sbin/pw/pw_group.c ============================================================================== --- stable/10/usr.sbin/pw/pw_group.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/pw_group.c Tue Nov 4 07:50:48 2014 (r274082) @@ -51,6 +51,7 @@ int pw_group(struct userconf * cnf, int mode, struct cargs * args) { int rc; + struct carg *a_newname = getarg(args, 'l'); struct carg *a_name = getarg(args, 'n'); struct carg *a_gid = getarg(args, 'g'); struct carg *arg; @@ -66,6 +67,11 @@ pw_group(struct userconf * cnf, int mode NULL }; + if (a_gid != NULL) { + if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) + errx(EX_USAGE, "-g expects a number"); + } + if (mode == M_LOCK || mode == M_UNLOCK) errx(EX_USAGE, "'lock' command is not available for groups"); @@ -140,8 +146,8 @@ pw_group(struct userconf * cnf, int mode if (a_gid) grp->gr_gid = (gid_t) atoi(a_gid->val); - if ((arg = getarg(args, 'l')) != NULL) - grp->gr_name = pw_checkname((u_char *)arg->val, 0); + if (a_newname != NULL) + grp->gr_name = pw_checkname((u_char *)a_newname->val, 0); } else { if (a_name == NULL) /* Required */ errx(EX_DATAERR, "group name required"); @@ -270,8 +276,10 @@ pw_group(struct userconf * cnf, int mode warn("group update"); return EX_IOERR; } + + arg = a_newname != NULL ? a_newname : a_name; /* grp may have been invalidated */ - if ((grp = GETGRNAM(a_name->val)) == NULL) + if ((grp = GETGRNAM(arg->val)) == NULL) errx(EX_SOFTWARE, "group disappeared during update"); pw_log(cnf, mode, W_GROUP, "%s(%ld)", grp->gr_name, (long) grp->gr_gid); Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Tue Nov 4 07:50:20 2014 (r274081) +++ stable/10/usr.sbin/pw/pw_user.c Tue Nov 4 07:50:48 2014 (r274082) @@ -321,6 +321,9 @@ pw_user(struct userconf * cnf, int mode, (a_uid = a_name)->ch = 'u'; a_name = NULL; } + } else { + if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) + errx(EX_USAGE, "-u expects a number"); } /* @@ -751,7 +754,25 @@ pw_user(struct userconf * cnf, int mode, */ if (mode == M_ADD || getarg(args, 'G') != NULL) { - int i; + int i, j; + /* First remove the user from all group */ + SETGRENT(); + while ((grp = GETGRENT()) != NULL) { + char group[MAXLOGNAME]; + if (grp->gr_mem == NULL) + continue; + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (strcmp(grp->gr_mem[i] , pwd->pw_name) != 0) + continue; + for (j = i; grp->gr_mem[j] != NULL ; j++) + grp->gr_mem[j] = grp->gr_mem[j+1]; + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } + } + ENDGRENT(); + + /* now add to group where needed */ for (i = 0; cnf->groups[i] != NULL; i++) { grp = GETGRNAM(cnf->groups[i]); grp = gr_add(grp, pwd->pw_name); Modified: stable/10/usr.sbin/pw/tests/Makefile ============================================================================== --- head/usr.sbin/pw/tests/Makefile Thu Oct 2 19:53:37 2014 (r272445) +++ stable/10/usr.sbin/pw/tests/Makefile Tue Nov 4 07:50:48 2014 (r274082) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/usr.sbin/pw -ATF_TESTS_SH= pw_delete +ATF_TESTS_SH= pw_delete pw_modify FILES= group helper_functions.shin master.passwd FILESDIR= ${TESTSDIR} Modified: stable/10/usr.sbin/pw/tests/pw_delete.sh ============================================================================== --- head/usr.sbin/pw/tests/pw_delete.sh Thu Oct 2 19:53:37 2014 (r272445) +++ stable/10/usr.sbin/pw/tests/pw_delete.sh Tue Nov 4 07:50:48 2014 (r274082) @@ -18,7 +18,30 @@ rmuser_seperate_group_body() { pw -V ${HOME} userdel test || atf_fail "delete the user" } +atf_test_case group_do_not_delete_wheel_if_group_unkown +group_do_not_delete_wheel_if_group_unkown_head() { + atf_set "descr" "Make sure we do not consider as gid 0 an unknown group" +} + +group_do_not_delete_wheel_if_group_unkown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel + atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x pw -V ${HOME} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x pw -V ${HOME} groupshow wheel +} + +atf_test_case user_do_not_try_to_delete_root_if_user_unkown +user_do_not_try_to_delete_root_if_user_unkown_head() { + atf_set "descr" "Make sure not to try to remove root if deleteing an unknown user" +} + +user_do_not_try_to_delete_root_if_user_unkown_body() { + populate_etc_skel + atf_check -e inline:"pw: -u expects a number\n" -s exit:64 -x pw -V ${HOME} userdel -u plop +} atf_init_test_cases() { atf_add_test_case rmuser_seperate_group + atf_add_test_case group_do_not_delete_wheel_if_group_unkown + atf_add_test_case user_do_not_try_to_delete_root_if_user_unkown } Copied and modified: stable/10/usr.sbin/pw/tests/pw_modify.sh (from r272578, head/usr.sbin/pw/tests/pw_modify.sh) ============================================================================== --- head/usr.sbin/pw/tests/pw_modify.sh Mon Oct 6 00:16:23 2014 (r272578, copy source) +++ stable/10/usr.sbin/pw/tests/pw_modify.sh Tue Nov 4 07:50:48 2014 (r274082) @@ -27,8 +27,54 @@ groupmod_invalid_user_body() { atf_check -s exit:0 pw -V ${HOME} groupmod test -d foo } +atf_test_case groupmod_bug_193704 +groupmod_bug_193704_head() { + atf_set "descr" "Regression test for the #193704 bug" +} +groupmod_bug_193704_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd test + atf_check -s exit:0 -x pw -V ${HOME} groupmod test -l newgroupname + atf_check -s exit:65 -e match:"^pw: unknown group" -x pw -V ${HOME} groupshow test +} + +atf_test_case usermod_bug_185666 +usermod_bug_185666_head() { + atf_set "descr" "Regression test for the #185666 bug" +} + +usermod_bug_185666_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} useradd testuser + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup + atf_check -o inline:"testuser:*:1001:\n" -x pw -V${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:testuser\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:\n" -x pw -V${HOME} groupshow testgroup2 + atf_check -s exit:0 -x pw -V ${HOME} usermod testuser -G testgroup2 + atf_check -o inline:"testuser:*:1001:\n" -x pw -V ${HOME} groupshow testuser + atf_check -o inline:"testgroup:*:1002:\n" -x pw -V ${HOME} groupshow testgroup + atf_check -o inline:"testgroup2:*:1003:testuser\n" -x pw -V ${HOME} groupshow testgroup2 +} + +atf_test_case do_not_duplicate_group_on_gid_change +do_not_duplicate_group_on_gid_change_head() { + atf_set "descr" "Do not duplicate group on gid change" +} + +do_not_duplicate_group_on_gid_change_body() { + populate_etc_skel + atf_check -s exit:0 -x pw -V ${HOME} groupadd testgroup + atf_check -s exit:0 -x pw -V ${HOME} groupmod testgroup -g 12345 + # use grep to see if the entry has not be duplicated + atf_check -o inline:"testgroup:*:12345:\n" -s exit:0 -x grep "^testgroup" ${HOME}/group +} atf_init_test_cases() { atf_add_test_case groupmod_user atf_add_test_case groupmod_invalid_user + atf_add_test_case groupmod_bug_193704 + atf_add_test_case usermod_bug_185666 + atf_add_test_case do_not_duplicate_group_on_gid_change } From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 08:22:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C42F1568; Tue, 4 Nov 2014 08:22:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0AA4373; Tue, 4 Nov 2014 08:22:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA48M9NX044709; Tue, 4 Nov 2014 08:22:09 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA48M9lu044708; Tue, 4 Nov 2014 08:22:09 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411040822.sA48M9lu044708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 4 Nov 2014 08:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274083 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 08:22:09 -0000 Author: jmg Date: Tue Nov 4 08:22:08 2014 New Revision: 274083 URL: https://svnweb.freebsd.org/changeset/base/274083 Log: convert .Nm to proper .Xr's... Modified: head/share/man/man4/tap.4 Modified: head/share/man/man4/tap.4 ============================================================================== --- head/share/man/man4/tap.4 Tue Nov 4 07:50:48 2014 (r274082) +++ head/share/man/man4/tap.4 Tue Nov 4 08:22:08 2014 (r274083) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd January 26, 2012 +.Dd November 4, 2014 .Dt TAP 4 .Os .Sh NAME @@ -18,19 +18,19 @@ described as the network interface analo that is, .Nm does for network interfaces what the -.Nm pty +.Xr pty 4 driver does for terminals. .Pp The .Nm driver, like the -.Nm pty +.Xr pty 4 driver, provides two interfaces: an interface like the usual facility it is simulating (an Ethernet network interface in the case of .Nm , or a terminal for -.Nm pty ) , +.Xr pty 4 ) , and a character-special device .Dq control interface. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:21:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86940840; Tue, 4 Nov 2014 09:21:45 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E699EAC; Tue, 4 Nov 2014 09:21:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA49LdZl065470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2014 11:21:39 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA49LdZl065470 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA49LcnY065469; Tue, 4 Nov 2014 11:21:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2014 11:21:38 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <20141104092138.GO53947@kib.kiev.ua> References: <29A795E1-19E2-49E4-9653-143D3F6F3F12@grondar.org> <20141102194625.GC53947@kib.kiev.ua> <751CD860-95B9-4F68-AE69-976B42823AD0@grondar.org> <54568E41.8030305@delphij.net> <20141102201331.GE53947@kib.kiev.ua> <545693B4.8030602@delphij.net> <1414961583.1200.27.camel@revolution.hippie.lan> <20141103113629.I3149@besplex.bde.org> <20141103091954.GJ53947@kib.kiev.ua> <20141104024151.M1038@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141104024151.M1038@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: "src-committers@freebsd.org" , d@delphij.net, Ian Lepore , "svn-src-all@freebsd.org" , Mark R V Murray , "svn-src-head@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 09:21:45 -0000 On Tue, Nov 04, 2014 at 02:59:17AM +1100, Bruce Evans wrote: > On Mon, 3 Nov 2014, Konstantin Belousov wrote: > > > On Mon, Nov 03, 2014 at 11:53:26AM +1100, Bruce Evans wrote: > >> On Sun, 2 Nov 2014, Ian Lepore wrote: > >> > >>> On Sun, 2014-11-02 at 12:27 -0800, Xin Li wrote: > >>>> -----BEGIN PGP SIGNED MESSAGE----- > >>>> Hash: SHA512 > >>>> > >>>> Hi, Mark, > >>>> > >>>> I'd like to propose the attached patch for review. It replaces > >>>> tsleep's with sx_sleep's, then checks the return value and quit the loop. > >>> > >>> It still doesn't handle the partial read/write case Kostik mentioned, > >>> but there are plenty of other drivers that don't get that right. > >> > >> Returning an error for a partial read is good enough for random devices, > >> since there is no problem with discarding the input. Upper layers are > >> still broken, so this (discarding the input is what happens automatically > >> except for ERESTART, EINTR and EWOULDBLOCK. > > But usermode buffer is already partially accessed and modified. > > Yes, I am picky about it after vn_io_fault() work. > > Urk. For some reason I was thinking that the uio modifications were > in a kernel buffer, so they could be backed out of easily. > > But surely the user buffer is indeterminate after a read error? Even > after success, the region beyond the part read should be specified as > indeterminate. I do not agree with this statement. > Consider an implementation that asks the hardware to > DMA into part of the read buffer beyond a (possibly null) region already > successfully read. If the DMA fails, you might not know how far it > got. The best you can do to recover is to back out of the failed part > of the read only. Possibly zero the part that failed for security. > For further complications, consider a similar implementations but > with multiple DMA channels writing in indeterminate order. This is theoretical. I am not aware of such driver. > > If (part of) the buffer is not allowed to be indeterminate after a > success or failure, then both the success and the failure cases are > broken in the FreeBSD implementation (apart from not handling short > I/O's correctly). In the failure case, not backing out of partial > I/O's leaves a trashed buffer. In the success case, if it is > implemented by a partial backout, the part not backed out of is still > trashed. I am not sure I follow. There are two aspects of the buffer validity issue. One is the correctness of the file pointer (in other words, the report of number of bytes read or written). This includes the correct return of the short i/o count instead of error. Another is the guarantee of the state of the buffer part after the file pointer. I do not believe there is any statement about this in POSIX, nor most applications depend on the state, but some are. E.g., cyclic buffer used by sound or video recording functioning might depend on such guarantees. Overall, both issues determine the quality of implementation, and I prefer to implement them if not too costly. For the /dev/random, which does byte-streaming using uiomove(9), both are trivially implementable, so there is no reason not to do everything correctly. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:26:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CBF29E1; Tue, 4 Nov 2014 09:26:03 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA20ED3; Tue, 4 Nov 2014 09:26:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA49Pw7U066540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2014 11:25:58 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA49Pw7U066540 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA49PwDc066539; Tue, 4 Nov 2014 11:25:58 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2014 11:25:58 +0200 From: Konstantin Belousov To: Alfred Perlstein Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104092558.GP53947@kib.kiev.ua> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <5457F771.3010509@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5457F771.3010509@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 09:26:03 -0000 On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: > Isn't there a problem where the stack can be swapped out? > > I seem to recall a problem where a swapped out process was causing > problems due to a buffer passed being stack allocated and that process > being swapped out... > > If this is not the case then please disregard. Sure, stack can be swapped out, but buffer passing is usually not a problem. At least, I am not aware of cases. In fact, many compat layers do exactly this, allocate the native-ABI structure on the stack, copyin the foreighn-ABI structure in pieces into the native-ABI one, and pass native to kern_foo() implementations. So I think you worries are not realized. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:56:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F12142E; Tue, 4 Nov 2014 09:56:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF5A29B; Tue, 4 Nov 2014 09:56:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA49ux74087417; Tue, 4 Nov 2014 09:56:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA49uxYn087416; Tue, 4 Nov 2014 09:56:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411040956.sA49uxYn087416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Nov 2014 09:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274084 - head/sys/dev/agp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 09:56:59 -0000 Author: kib Date: Tue Nov 4 09:56:58 2014 New Revision: 274084 URL: https://svnweb.freebsd.org/changeset/base/274084 Log: Revert agp_intel.c part of the r274040 for now. There is a confusion on my part about north bridge/GPU pci ids and use of aperture. Leave the agp_intel.c out of static compilation on amd64, it makes the things consistent with agp.ko. Pointed out by: tijl Sponsored by: The FreeBSD Foundation MFC after: 13 days Modified: head/sys/dev/agp/agp_intel.c Modified: head/sys/dev/agp/agp_intel.c ============================================================================== --- head/sys/dev/agp/agp_intel.c Tue Nov 4 08:22:08 2014 (r274083) +++ head/sys/dev/agp/agp_intel.c Tue Nov 4 09:56:58 2014 (r274084) @@ -76,6 +76,35 @@ agp_intel_match(device_t dev) return ("Intel 82443GX host to PCI bridge"); case 0x71a18086: return ("Intel 82443GX host to AGP bridge"); + case 0x11308086: + return ("Intel 82815 (i815 GMCH) host to PCI bridge"); + case 0x25008086: + case 0x25018086: + return ("Intel 82820 host to AGP bridge"); + case 0x35758086: + return ("Intel 82830 host to AGP bridge"); + case 0x1a218086: + return ("Intel 82840 host to AGP bridge"); + case 0x1a308086: + return ("Intel 82845 host to AGP bridge"); + case 0x25308086: + return ("Intel 82850 host to AGP bridge"); + case 0x33408086: + return ("Intel 82855 host to AGP bridge"); + case 0x25318086: + return ("Intel 82860 host to AGP bridge"); + case 0x25708086: + return ("Intel 82865 host to AGP bridge"); + case 0x255d8086: + return ("Intel E7205 host to AGP bridge"); + case 0x25508086: + return ("Intel E7505 host to AGP bridge"); + case 0x25788086: + return ("Intel 82875P host to AGP bridge"); + case 0x25608086: + return ("Intel 82845G host to AGP bridge"); + case 0x35808086: + return ("Intel 82855GM host to AGP bridge"); } return (NULL); @@ -129,6 +158,31 @@ agp_intel_commit_gatt(device_t dev) /* Enable aperture accesses. */ switch (type) { + case 0x25008086: /* i820 */ + case 0x25018086: /* i820 */ + pci_write_config(dev, AGP_INTEL_I820_RDCR, + (pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) + | (1 << 1)), 1); + break; + case 0x1a308086: /* i845 */ + case 0x25608086: /* i845G */ + case 0x33408086: /* i855 */ + case 0x35808086: /* i855GM */ + case 0x25708086: /* i865 */ + case 0x25788086: /* i875P */ + pci_write_config(dev, AGP_INTEL_I845_AGPM, + (pci_read_config(dev, AGP_INTEL_I845_AGPM, 1) + | (1 << 1)), 1); + break; + case 0x1a218086: /* i840 */ + case 0x25308086: /* i850 */ + case 0x25318086: /* i860 */ + case 0x255d8086: /* E7205 */ + case 0x25508086: /* E7505 */ + pci_write_config(dev, AGP_INTEL_MCHCFG, + (pci_read_config(dev, AGP_INTEL_MCHCFG, 2) + | (1 << 9)), 2); + break; default: /* Intel Generic (maybe) */ pci_write_config(dev, AGP_INTEL_NBXCFG, (pci_read_config(dev, AGP_INTEL_NBXCFG, 4) @@ -137,6 +191,22 @@ agp_intel_commit_gatt(device_t dev) /* Clear errors. */ switch (type) { + case 0x1a218086: /* i840 */ + pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0xc000, 2); + break; + case 0x25008086: /* i820 */ + case 0x25018086: /* i820 */ + case 0x1a308086: /* i845 */ + case 0x25608086: /* i845G */ + case 0x25308086: /* i850 */ + case 0x33408086: /* i855 */ + case 0x25318086: /* i860 */ + case 0x25708086: /* i865 */ + case 0x25788086: /* i875P */ + case 0x255d8086: /* E7205 */ + case 0x25508086: /* E7505 */ + pci_write_config(dev, AGP_INTEL_I8XX_ERRSTS, 0x00ff, 2); + break; default: /* Intel Generic (maybe) */ pci_write_config(dev, AGP_INTEL_ERRSTS + 1, 7, 1); } @@ -197,6 +267,31 @@ agp_intel_detach(device_t dev) /* Disable aperture accesses. */ switch (pci_get_devid(dev)) { + case 0x25008086: /* i820 */ + case 0x25018086: /* i820 */ + reg = pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1); + printf("%s: set RDCR to %02x\n", __func__, reg & 0xff); + pci_write_config(dev, AGP_INTEL_I820_RDCR, reg, 1); + break; + case 0x1a308086: /* i845 */ + case 0x25608086: /* i845G */ + case 0x33408086: /* i855 */ + case 0x35808086: /* i855GM */ + case 0x25708086: /* i865 */ + case 0x25788086: /* i875P */ + reg = pci_read_config(dev, AGP_INTEL_I845_AGPM, 1) & ~(1 << 1); + printf("%s: set AGPM to %02x\n", __func__, reg & 0xff); + pci_write_config(dev, AGP_INTEL_I845_AGPM, reg, 1); + break; + case 0x1a218086: /* i840 */ + case 0x25308086: /* i850 */ + case 0x25318086: /* i860 */ + case 0x255d8086: /* E7205 */ + case 0x25508086: /* E7505 */ + reg = pci_read_config(dev, AGP_INTEL_MCHCFG, 2) & ~(1 << 9); + printf("%s: set MCHCFG to %x04\n", __func__, reg & 0xffff); + pci_write_config(dev, AGP_INTEL_MCHCFG, reg, 2); + break; default: /* Intel Generic (maybe) */ reg = pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9); printf("%s: set NBXCFG to %08x\n", __func__, reg); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 09:58:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F05D593; Tue, 4 Nov 2014 09:58:04 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C44CC2CC; Tue, 4 Nov 2014 09:58:03 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA49vvP3073277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2014 11:57:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA49vvP3073277 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA49vvVH073276; Tue, 4 Nov 2014 11:57:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2014 11:57:57 +0200 From: Konstantin Belousov To: Tijl Coosemans Subject: Re: svn commit: r274040 - in head/sys: conf dev/agp Message-ID: <20141104095757.GQ53947@kib.kiev.ua> References: <201411031149.sA3BnaNe053503@svn.freebsd.org> <20141103195015.7d78af57@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141103195015.7d78af57@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 09:58:04 -0000 On Mon, Nov 03, 2014 at 07:50:15PM +0100, Tijl Coosemans wrote: > On Mon, 3 Nov 2014 11:49:36 +0000 (UTC) Konstantin Belousov wrote: > > Author: kib > > Date: Mon Nov 3 11:49:35 2014 > > New Revision: 274040 > > URL: https://svnweb.freebsd.org/changeset/base/274040 > > > > Log: > > agp_intel.c provides support for AGP on Intel chipsets from 440/BX to > > 875. This intersects with the agp_i810.c, which supports all Intels > > from i810 to Core i5/7. Both agp_intel.c and agp_i810.c are compiled > > into kernel when device agp is specified in config, and agp_i810 > > attach seems to be selected by chance due to linking order. > > I think agp_intel are the plain AGP chipsets while agp_i810 are the > integrated graphics. None of the device IDs you deleted from agp_intel > appear in agp_i810. Hm, I am not aware of any i810 variants without IGP. The commit above sit in my local drm branch for long time, and was based on actual report by user who did experienced problems due to the agp_intel taking over aperture, instead of agp_i810. I see your point, and for now I reverted the pciid part of the change, 274084. I still think that removing agp_intel.c from amd64 static agp compilation is right thing to do. AFAIR EMT64-capable Pentium 4 (Prescotts ? I do not remember anymore) were compatible with 865/875 series, but it hardly matters. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:18:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88432B32; Tue, 4 Nov 2014 10:18:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69C4C75B; Tue, 4 Nov 2014 10:18:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4AI4F4097191; Tue, 4 Nov 2014 10:18:04 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4AI3b0097186; Tue, 4 Nov 2014 10:18:03 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411041018.sA4AI3b0097186@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Tue, 4 Nov 2014 10:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274085 - in head: . 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:18:04 -0000 Author: dumbbell Date: Tue Nov 4 10:18:03 2014 New Revision: 274085 URL: https://svnweb.freebsd.org/changeset/base/274085 Log: Enable vt(4) by default vt(4) is a new console driver which brings features such as: o Support for Unicode and double-width characters o Integration with the KMS kernel video drivers o Support for UEFI You may need to update your console settings in /etc/rc.conf, most probably the keymap. During boot, /etc/rc.d/syscons will indicate what you need to do. vt(4) still has issues and lacks some features compared to syscons(4). See the wiki for up-to-date information: https://wiki.freebsd.org/Newcons If you want to keep using syscons(4), you can do so by adding the following line to /boot/loader.conf: kern.vty=sc Differential Revision: https://reviews.freebsd.org/D1005 Discussed with: emaste@, nwhitehorn@, ray@ Relnotes: yes Modified: head/UPDATING head/sys/kern/kern_cons.c head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Nov 4 09:56:58 2014 (r274084) +++ head/UPDATING Tue Nov 4 10:18:03 2014 (r274085) @@ -31,6 +31,24 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20141104: + vt(4), the new console driver, is enabled by default. It brings + support for Unicode and double-width characters, as well as + support for UEFI and integration with the KMS kernel video + drivers. + + You may need to update your console settings in /etc/rc.conf, + most probably the keymap. During boot, /etc/rc.d/syscons will + indicate what you need to do. + + vt(4) still has issues and lacks some features compared to + syscons(4). See the wiki for up-to-date information: + https://wiki.freebsd.org/Newcons + + If you want to keep using syscons(4), you can do so by adding + the following line to /boot/loader.conf: + kern.vty=sc + 20141102: pjdfstest has been integrated into kyua as an opt-in test suite. Please see share/doc/pjdfstest/README for a more details on how to Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Tue Nov 4 09:56:58 2014 (r274084) +++ head/sys/kern/kern_cons.c Tue Nov 4 10:18:03 2014 (r274085) @@ -689,10 +689,10 @@ vty_enabled(unsigned vty) vty_selected = vty_prefer; break; } -#if defined(DEV_SC) - vty_selected = VTY_SC; -#elif defined(DEV_VT) +#if defined(DEV_VT) vty_selected = VTY_VT; +#elif defined(DEV_SC) + vty_selected = VTY_SC; #endif } while (0); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Nov 4 09:56:58 2014 (r274084) +++ head/sys/sys/param.h Tue Nov 4 10:18:03 2014 (r274085) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100042 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100043 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:21:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC744CAC; Tue, 4 Nov 2014 10:21:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B866780A; Tue, 4 Nov 2014 10:21:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4ALZcW001203; Tue, 4 Nov 2014 10:21:35 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4ALZ4m001202; Tue, 4 Nov 2014 10:21:35 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411041021.sA4ALZ4m001202@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 4 Nov 2014 10:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274086 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:21:35 -0000 Author: melifaro Date: Tue Nov 4 10:21:34 2014 New Revision: 274086 URL: https://svnweb.freebsd.org/changeset/base/274086 Log: Put "break" after err() to please coverity. Reported by: Coverity CID: 1250795 Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Tue Nov 4 10:18:03 2014 (r274085) +++ head/sbin/route/route.c Tue Nov 4 10:21:34 2014 (r274086) @@ -1536,6 +1536,7 @@ rtmsg(int cmd, int flags, int fib) switch (errno) { case EPERM: err(1, "writing to routing socket"); + break; case ESRCH: warnx("route has not been found"); break; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:25:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D04B8E9E; Tue, 4 Nov 2014 10:25:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC584840; Tue, 4 Nov 2014 10:25:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4APq1Y001823; Tue, 4 Nov 2014 10:25:52 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4APqxA001822; Tue, 4 Nov 2014 10:25:52 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411041025.sA4APqxA001822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 4 Nov 2014 10:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274087 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:25:52 -0000 Author: melifaro Date: Tue Nov 4 10:25:52 2014 New Revision: 274087 URL: https://svnweb.freebsd.org/changeset/base/274087 Log: Remove unused variable. Found by: Coverity CID: 1245739 Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Tue Nov 4 10:21:34 2014 (r274086) +++ head/sys/netpfil/ipfw/ip_fw_table.c Tue Nov 4 10:25:52 2014 (r274087) @@ -1824,7 +1824,6 @@ create_table(struct ip_fw_chain *ch, ip_ char *tname, *aname; struct tid_info ti; struct namedobj_instance *ni; - struct table_config *tc; if (sd->valsize != sizeof(*oh) + sizeof(ipfw_xtable_info)) return (EINVAL); @@ -1853,7 +1852,7 @@ create_table(struct ip_fw_chain *ch, ip_ ni = CHAIN_TO_NI(ch); IPFW_UH_RLOCK(ch); - if ((tc = find_table(ni, &ti)) != NULL) { + if (find_table(ni, &ti) != NULL) { IPFW_UH_RUNLOCK(ch); return (EEXIST); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:31:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 299DDED; Tue, 4 Nov 2014 10:31:43 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D4A906; Tue, 4 Nov 2014 10:31:42 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA4AVaCp081045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Nov 2014 12:31:36 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA4AVaCp081045 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA4AVaMd081044; Tue, 4 Nov 2014 12:31:36 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Nov 2014 12:31:36 +0200 From: Konstantin Belousov To: Bruce Evans Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104103136.GS53947@kib.kiev.ua> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141104045159.E1605@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: Hans Petter Selasky , Mateusz Guzik , Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:31:43 -0000 On Tue, Nov 04, 2014 at 06:03:29AM +1100, Bruce Evans wrote: > Why not just use a C99 VLA? It doesn't require any compiler magic except > being a C99 compiler (I haven't seen any of those yet, but some approximate > C99 for VLAs). I use this in delayed signal delivery code in libthr. > > You (kib) didn't like using alloca() when I tried to talk you into using > it to get aligned structs for SSE long ago. __builtin_alloca() has more > chance of forcing the alignment than VLA,s but this is fragile. FreeBSD > still uses -mpreferred-stack-boundary on i386 with gcc. This option is > broken (unsupported) with clang, but is less needed since clang does > alignment better. You did convinced me to use alloca for transient copy of extended FPU state in signal code. > How do the __builtin_alloca()'s in your FP code (recently synced to i386 > where alignment is more difficult by jhb) work? I think they give > 16-byte alignment in all cases, but some cases seem to need 64-byte > alignment and do this by hand. Old code seems to be little changed, > so I think it still does 16-byte alignment by hand. It does not require any alignment. All FPU accesses (storing and loading the state) happen to the properly aligned save area below the pcb for userspace state. Apart from handling alignment, it is also required (or hard to make any other way) to make XSAVEOPT optimization working. The allocated buffer is used only to put together the scattered pieces before copyout or after copyin. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:45:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 243B66F6; Tue, 4 Nov 2014 10:45:34 +0000 (UTC) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id DC43CA4C; Tue, 4 Nov 2014 10:45:32 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep16-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20141104102829.OJU20314.viefep16-int.chello.at@edge04.upcmail.net>; Tue, 4 Nov 2014 11:28:29 +0100 Received: from mole.fafoe.narf.at ([80.109.238.242]) by edge04.upcmail.net with edge id BNUU1p01U5EV2AQ01NUUsa; Tue, 04 Nov 2014 11:28:29 +0100 X-SourceIP: 80.109.238.242 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 2B1446D47D; Tue, 4 Nov 2014 11:28:29 +0100 (CET) Date: Tue, 4 Nov 2014 11:28:29 +0100 From: Stefan Farfeleder To: "Alexander V. Chernikov" Subject: Re: svn commit: r274086 - head/sbin/route Message-ID: <20141104102828.GB1215@mole.fafoe.narf.at> References: <201411041021.sA4ALZ4m001202@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411041021.sA4ALZ4m001202@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:45:34 -0000 On Tue, Nov 04, 2014 at 10:21:35AM +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Tue Nov 4 10:21:34 2014 > New Revision: 274086 > URL: https://svnweb.freebsd.org/changeset/base/274086 > > Log: > Put "break" after err() to please coverity. > > Reported by: Coverity > CID: 1250795 > Shouldn't Coverity understand that err doesn't return? Stefan From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 10:55:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F32298F2; Tue, 4 Nov 2014 10:55:01 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C3BF7B39; Tue, 4 Nov 2014 10:55:01 +0000 (UTC) Received: from c116.sec.cl.cam.ac.uk (c116.sec.cl.cam.ac.uk [128.232.18.116]) (authenticated bits=0) by theravensnest.org (8.14.9/8.14.9) with ESMTP id sA4AsuwA060332 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 4 Nov 2014 10:54:58 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274086 - head/sbin/route From: David Chisnall In-Reply-To: <20141104102828.GB1215@mole.fafoe.narf.at> Date: Tue, 4 Nov 2014 10:54:56 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411041021.sA4ALZ4m001202@svn.freebsd.org> <20141104102828.GB1215@mole.fafoe.narf.at> To: Stefan Farfeleder X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Alexander V. Chernikov" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:55:02 -0000 On 4 Nov 2014, at 10:28, Stefan Farfeleder wrote: > Shouldn't Coverity understand that err doesn't return? err() is marked as __dead2, which expands to = __attribute__((__noreturn__)). If Coverity doesn't know that = __attribute__((__noreturn__)) functions don't return, then that's a = Coverity bug and they should fix it (if we're not expanding __dead3 to = __attribute__((__noreturn__)) for Coverity, then that's a sys/cdefs.h = bug and should be fixed there). =20 Putting a break after a noreturn function makes the code less readable = and will cause errors in non-buggy static analysers (dead code warning - = why do you have a break on an unreachable line?). David From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 11:29:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B7FDF58; Tue, 4 Nov 2014 11:29:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07C31F4B; Tue, 4 Nov 2014 11:29:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4BTnnG030601; Tue, 4 Nov 2014 11:29:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4BTnwX030600; Tue, 4 Nov 2014 11:29:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411041129.sA4BTnwX030600@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 4 Nov 2014 11:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274088 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 11:29:50 -0000 Author: hselasky Date: Tue Nov 4 11:29:49 2014 New Revision: 274088 URL: https://svnweb.freebsd.org/changeset/base/274088 Log: Simplify logic a bit. Ensure data buffer is properly aligned, especially for platforms where unaligned access is not allowed. Make it possible to override the small buffer size. A simple continuous read string test using libusb showed a reduction in CPU usage from roughly 10% to less than 1% using a dual-core GHz CPU, when the malloc() operation was skipped for small buffers. MFC after: 2 weeks Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 2014 (r274087) +++ head/sys/kern/sys_generic.c Tue Nov 4 11:29:49 2014 (r274088) @@ -646,10 +646,13 @@ struct ioctl_args { int sys_ioctl(struct thread *td, struct ioctl_args *uap) { +#ifndef SYS_IOCTL_SMALL_SIZE +#define SYS_IOCTL_SMALL_SIZE 128 +#endif + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); u_long com; int arg, error; u_int size; - u_char smalldata[128]; caddr_t data; if (uap->com > 0xffffffff) { @@ -682,10 +685,10 @@ sys_ioctl(struct thread *td, struct ioct data = (void *)&arg; size = 0; } else { - if (size <= sizeof(smalldata)) - data = smalldata; - else + if (size > SYS_IOCTL_SMALL_SIZE) data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); + else + data = smalldata; } } else data = (void *)&uap->data; @@ -707,7 +710,7 @@ sys_ioctl(struct thread *td, struct ioct error = copyout(data, uap->data, (u_int)size); out: - if (size > 0 && data != (caddr_t)&smalldata) + if (size > SYS_IOCTL_SMALL_SIZE) free(data, M_IOCTLOPS); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 11:40:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDB061AF; Tue, 4 Nov 2014 11:40:46 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE7D07C; Tue, 4 Nov 2014 11:40:45 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x13so13265127wgg.19 for ; Tue, 04 Nov 2014 03:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=i0oCl0wya2LMO+2iQPVV84Un+GRoLHI+56pXJQlZBuI=; b=Cll9ubGJvvinqS9DzIXw6yWIfIXdKoBrbnH2i6wDqyV1KZ+atxnIgUR4RQo4Jz0J1S g35OnHwNWr6WbXTmDPRee+j6CXDauhpLDHDZ8ZHv4vPMF7fE8I9USQqHVY3ZY3GdNlz2 OAxHAlvF51mfo6gVx+HvGjoueL52i6hsODMuYKEHTqcZ6gdGV3uHD4fJ+YNUIsgkbeaZ v87CgYIQ8zDNVDt/QDhYT386sWsYruiDOC+Gdo6afPbxmvWve/Weg2nXBWAMHCl9YwCE 9klNEDGxtr8c+IHbY2D8YnGbR35pmMTEST2FprWTDOxA+ynvQriB70Dr90TOfLdt/ZOo 4vHA== X-Received: by 10.180.23.98 with SMTP id l2mr23124747wif.51.1415101244192; Tue, 04 Nov 2014 03:40:44 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id k10sm231962wjb.28.2014.11.04.03.40.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 03:40:43 -0800 (PST) Date: Tue, 4 Nov 2014 12:40:41 +0100 From: Mateusz Guzik To: Hans Petter Selasky Subject: Re: svn commit: r274088 - head/sys/kern Message-ID: <20141104114041.GA21297@dft-labs.eu> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201411041129.sA4BTnwX030600@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 11:40:47 -0000 On Tue, Nov 04, 2014 at 11:29:49AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Nov 4 11:29:49 2014 > New Revision: 274088 > URL: https://svnweb.freebsd.org/changeset/base/274088 > > Log: > Simplify logic a bit. Ensure data buffer is properly aligned, > especially for platforms where unaligned access is not allowed. Make > it possible to override the small buffer size. > > A simple continuous read string test using libusb showed a reduction > in CPU usage from roughly 10% to less than 1% using a dual-core GHz > CPU, when the malloc() operation was skipped for small buffers. > > MFC after: 2 weeks > > Modified: > head/sys/kern/sys_generic.c > > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 2014 (r274087) > +++ head/sys/kern/sys_generic.c Tue Nov 4 11:29:49 2014 (r274088) > @@ -646,10 +646,13 @@ struct ioctl_args { > int > sys_ioctl(struct thread *td, struct ioctl_args *uap) > { > +#ifndef SYS_IOCTL_SMALL_SIZE > +#define SYS_IOCTL_SMALL_SIZE 128 > +#endif > + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); Should not you align to word size instead? Also maybe it would be beneficial to derive the limit from KSTACK_PAGES (something silly like KSTACK_PAGES * 32 or something), which I believe would address earlier complaints. > u_long com; > int arg, error; > u_int size; > - u_char smalldata[128]; > caddr_t data; > > if (uap->com > 0xffffffff) { > @@ -682,10 +685,10 @@ sys_ioctl(struct thread *td, struct ioct > data = (void *)&arg; > size = 0; > } else { > - if (size <= sizeof(smalldata)) > - data = smalldata; > - else > + if (size > SYS_IOCTL_SMALL_SIZE) > data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + else > + data = smalldata; > } > } else > data = (void *)&uap->data; > @@ -707,7 +710,7 @@ sys_ioctl(struct thread *td, struct ioct > error = copyout(data, uap->data, (u_int)size); > > out: > - if (size > 0 && data != (caddr_t)&smalldata) > + if (size > SYS_IOCTL_SMALL_SIZE) > free(data, M_IOCTLOPS); > return (error); > } > -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 11:46:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A5A386; Tue, 4 Nov 2014 11:46:54 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0B0177; Tue, 4 Nov 2014 11:46:53 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B5A8B1FE022; Tue, 4 Nov 2014 12:46:51 +0100 (CET) Message-ID: <5458BCB7.5090309@selasky.org> Date: Tue, 04 Nov 2014 12:47:03 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Mateusz Guzik Subject: Re: svn commit: r274088 - head/sys/kern References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> In-Reply-To: <20141104114041.GA21297@dft-labs.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 11:46:54 -0000 On 11/04/14 12:40, Mateusz Guzik wrote: > On Tue, Nov 04, 2014 at 11:29:49AM +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Nov 4 11:29:49 2014 >> New Revision: 274088 >> URL: https://svnweb.freebsd.org/changeset/base/274088 >> >> Log: >> Simplify logic a bit. Ensure data buffer is properly aligned, >> especially for platforms where unaligned access is not allowed. Make >> it possible to override the small buffer size. >> >> A simple continuous read string test using libusb showed a reduction >> in CPU usage from roughly 10% to less than 1% using a dual-core GHz >> CPU, when the malloc() operation was skipped for small buffers. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/sys_generic.c >> >> Modified: head/sys/kern/sys_generic.c >> ============================================================================== >> --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 2014 (r274087) >> +++ head/sys/kern/sys_generic.c Tue Nov 4 11:29:49 2014 (r274088) >> @@ -646,10 +646,13 @@ struct ioctl_args { >> int >> sys_ioctl(struct thread *td, struct ioctl_args *uap) >> { >> +#ifndef SYS_IOCTL_SMALL_SIZE >> +#define SYS_IOCTL_SMALL_SIZE 128 >> +#endif >> + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); > Hi, > Should not you align to word size instead? You mean 32-bit words? I think mips64 will require 64-bit alignment. I just put the value for the worst case. Possibly "sizeof(long)" might work. > > Also maybe it would be beneficial to derive the limit from KSTACK_PAGES > (something silly like KSTACK_PAGES * 32 or something), which I believe would > address earlier complaints. If this is going to give a performance improvement in the USB area, the small size must be greater or equal to 64 at least, or somewhere around there. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 05:35:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4061F1BB; Tue, 4 Nov 2014 05:35:27 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14254163; Tue, 4 Nov 2014 05:35:25 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id x13so12650679wgg.19 for ; Mon, 03 Nov 2014 21:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=fLHxoG8Pxqcb5navipgI+SxLI8CLgfUjhLBwOBP2VSM=; b=vOTekxj8Qh0eDCZnOyGr+izgQWFtgWQVIMQcitntIUBWzFSbRnVXa3QQoRRqOSYvpP Bi5NUdINhmO3KVDY9Qee6jLdCtRvPWvYgtDKLWV5wfAwh9g0bkugtLKeL3Yfm61u9REB cN4s/l61HwlUdqqnw0yTJ8ZElN1jEGofAeBhXdtkXiuN9STJFHszv08vBeFnUiZ1y0rA XU7iAWsbqwuqMkgt7OtrRA5do7YuUvDdZrr+ok6yZEq5FYdZANUVbyOR87kcvRgv97U/ F1t+2wU88fGcULkz5TECnLG6XX5l3FwHRrpuTTRxJJJNsD5NsP1UKhrMeEX3VLuAYcLn cUtw== X-Received: by 10.194.9.1 with SMTP id v1mr459712wja.124.1415079323897; Mon, 03 Nov 2014 21:35:23 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id bg10sm24430824wjc.47.2014.11.03.21.35.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 03 Nov 2014 21:35:22 -0800 (PST) Date: Tue, 4 Nov 2014 06:35:20 +0100 From: Mateusz Guzik To: Poul-Henning Kamp Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104053520.GA4032@dft-labs.eu> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> <79454.1415043356@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <79454.1415043356@critter.freebsd.dk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 04 Nov 2014 12:30:57 +0000 Cc: Hans Petter Selasky , src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 05:35:27 -0000 On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: > -------- > In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: > > >This optimization is probably minor, but reminds me of other syscalls > >that would benefit using a single largish allocation up front: > >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > > bytes and more. An 8K stack has plently to spare after allocating > > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't > > exist. Only a limit to prevent denial of service is needed. > > We should actually roll a new rev of all syscalls which take a path > and have them pass strlen(path)+1 into the kernel. > > That would allow both precise allocation and faster copyin, followed > by a check that the last byte is (still) a NUL. > I think we can speed up things on amd64 no problem without affecting userspace. amd64's copyinstr (and most likely all others) copy byte by byte. What we can do is copy word size and fall back to byte by byte on page fault. Ten on each iteration check if 0 was encountered. Maybe there will be a way of doing it in even in C without much hassle. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 07:25:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651F55C0; Tue, 4 Nov 2014 07:25:03 +0000 (UTC) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id A477ED81; Tue, 4 Nov 2014 07:25:02 +0000 (UTC) Received: from critter.freebsd.dk (unknown [192.168.60.3]) by phk.freebsd.dk (Postfix) with ESMTP id BCFE93BD2B; Tue, 4 Nov 2014 07:25:00 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.9/8.14.9) with ESMTP id sA47Ox8I082149; Tue, 4 Nov 2014 07:24:59 GMT (envelope-from phk@phk.freebsd.dk) To: Mateusz Guzik Subject: Re: svn commit: r274017 - head/sys/kern In-reply-to: <20141104053520.GA4032@dft-labs.eu> From: "Poul-Henning Kamp" References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> <79454.1415043356@critter.freebsd.dk> <20141104053520.GA4032@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <82147.1415085899.1@critter.freebsd.dk> Date: Tue, 04 Nov 2014 07:24:59 +0000 Message-ID: <82148.1415085899@critter.freebsd.dk> X-Mailman-Approved-At: Tue, 04 Nov 2014 12:39:36 +0000 Cc: Hans Petter Selasky , src-committers@freebsd.org, Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 07:25:03 -0000 -------- In message <20141104053520.GA4032@dft-labs.eu>, Mateusz Guzik writes: >On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: >> -------- >> In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: >> >> >This optimization is probably minor, but reminds me of other syscalls >> >that would benefit using a single largish allocation up front: >> >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) >> > bytes and more. An 8K stack has plently to spare after allocating >> > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't >> > exist. Only a limit to prevent denial of service is needed. >> >> We should actually roll a new rev of all syscalls which take a path >> and have them pass strlen(path)+1 into the kernel. >> >> That would allow both precise allocation and faster copyin, followed >> by a check that the last byte is (still) a NUL. >> > >I think we can speed up things on amd64 no problem without affecting >userspace. I think from a design point of view it makes much more sense to let userland do as much work as possible before we enter the kernel, rather than complicate the kernel with "oops we got a page fault" handling. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 13:41:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5084D2C4; Tue, 4 Nov 2014 13:41:56 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 3336B3B6; Tue, 4 Nov 2014 13:41:55 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 256E35C001; Tue, 4 Nov 2014 13:41:48 +0000 (UTC) Date: Tue, 4 Nov 2014 13:41:41 +0000 From: Andrew Turner To: Mateusz Guzik Subject: Re: svn commit: r274088 - head/sys/kern Message-ID: <20141104134141.22d88841@bender.lan> In-Reply-To: <20141104114041.GA21297@dft-labs.eu> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 13:41:56 -0000 On Tue, 4 Nov 2014 12:40:41 +0100 Mateusz Guzik wrote: > On Tue, Nov 04, 2014 at 11:29:49AM +0000, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Tue Nov 4 11:29:49 2014 > > New Revision: 274088 > > URL: https://svnweb.freebsd.org/changeset/base/274088 > > > > Log: > > Simplify logic a bit. Ensure data buffer is properly aligned, > > especially for platforms where unaligned access is not allowed. > > Make it possible to override the small buffer size. > > > > A simple continuous read string test using libusb showed a > > reduction in CPU usage from roughly 10% to less than 1% using a > > dual-core GHz CPU, when the malloc() operation was skipped for > > small buffers. > > MFC after: 2 weeks > > > > Modified: > > head/sys/kern/sys_generic.c > > > > Modified: head/sys/kern/sys_generic.c > > ============================================================================== > > --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 > > 2014 (r274087) +++ head/sys/kern/sys_generic.c Tue > > Nov 4 11:29:49 2014 (r274088) @@ -646,10 +646,13 @@ struct > > ioctl_args { int > > sys_ioctl(struct thread *td, struct ioctl_args *uap) > > { > > +#ifndef SYS_IOCTL_SMALL_SIZE > > +#define SYS_IOCTL_SMALL_SIZE 128 > > +#endif > > + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); > > Should not you align to word size instead? On ARM it needs to be at least 8-byte aligned as this is the largest alignment of any types. Andrew From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 14:22:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB37ED81; Tue, 4 Nov 2014 14:22:57 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id A604BAD3; Tue, 4 Nov 2014 14:22:57 +0000 (UTC) Received: from [172.16.1.27] (50-206-19-250-static.hfc.comcastbusiness.net [50.206.19.250]) by elvis.mu.org (Postfix) with ESMTPSA id 5FA8D341F83D; Tue, 4 Nov 2014 06:22:57 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r274017 - head/sys/kern From: Alfred Perlstein X-Mailer: iPhone Mail (12B411) In-Reply-To: <20141104092558.GP53947@kib.kiev.ua> Date: Tue, 4 Nov 2014 06:22:56 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <88CC9FA2-D677-484A-8D6B-9DA66D8479AE@mu.org> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <5457F771.3010509@freebsd.org> <20141104092558.GP53947@kib.kiev.ua> To: Konstantin Belousov Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 14:22:57 -0000 > On Nov 4, 2014, at 1:25 AM, Konstantin Belousov wrot= e: >=20 >> On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: >> Isn't there a problem where the stack can be swapped out? >>=20 >> I seem to recall a problem where a swapped out process was causing=20 >> problems due to a buffer passed being stack allocated and that process=20= >> being swapped out... >>=20 >> If this is not the case then please disregard. >=20 > Sure, stack can be swapped out, but buffer passing is usually not a proble= m. > At least, I am not aware of cases. >=20 > In fact, many compat layers do exactly this, allocate the native-ABI > structure on the stack, copyin the foreighn-ABI structure in pieces > into the native-ABI one, and pass native to kern_foo() implementations. >=20 > So I think you worries are not realized. >=20 Ok then as long as system will not pass this buffer as Dma target down to dr= iver we are ok. =20= From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 14:23:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D257CECA; Tue, 4 Nov 2014 14:23:41 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 65294ADF; Tue, 4 Nov 2014 14:23:41 +0000 (UTC) Received: from [172.16.1.27] (50-206-19-250-static.hfc.comcastbusiness.net [50.206.19.250]) by elvis.mu.org (Postfix) with ESMTPSA id 04EFE341F83D; Tue, 4 Nov 2014 06:23:35 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r274017 - head/sys/kern From: Alfred Perlstein X-Mailer: iPhone Mail (12B411) In-Reply-To: <88CC9FA2-D677-484A-8D6B-9DA66D8479AE@mu.org> Date: Tue, 4 Nov 2014 06:23:34 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411030746.sA37kpPu037113@svn.freebsd.org> <5457F771.3010509@freebsd.org> <20141104092558.GP53947@kib.kiev.ua> <88CC9FA2-D677-484A-8D6B-9DA66D8479AE@mu.org> To: Konstantin Belousov Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 14:23:41 -0000 > On Nov 4, 2014, at 6:22 AM, Alfred Perlstein wrote: >=20 >=20 >=20 >>> On Nov 4, 2014, at 1:25 AM, Konstantin Belousov wr= ote: >>>=20 >>> On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: >>> Isn't there a problem where the stack can be swapped out? >>>=20 >>> I seem to recall a problem where a swapped out process was causing=20 >>> problems due to a buffer passed being stack allocated and that process=20= >>> being swapped out... >>>=20 >>> If this is not the case then please disregard. >>=20 >> Sure, stack can be swapped out, but buffer passing is usually not a probl= em. >> At least, I am not aware of cases. >>=20 >> In fact, many compat layers do exactly this, allocate the native-ABI >> structure on the stack, copyin the foreighn-ABI structure in pieces >> into the native-ABI one, and pass native to kern_foo() implementations. >>=20 >> So I think you worries are not realized. >=20 > Ok then as long as system will not pass this buffer as Dma target down to d= river we are ok. =20 Also thank you for explanation.=20= From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 14:42:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7CFD4F2; Tue, 4 Nov 2014 14:42:22 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A7D71CCE; Tue, 4 Nov 2014 14:42:22 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id D7D6CA3CD; Tue, 4 Nov 2014 14:42:20 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id B85C510D1D; Tue, 4 Nov 2014 15:42:20 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Glen Barber Subject: Re: svn commit: r273653 - head/release References: <201410260141.s9Q1ft59057852@svn.freebsd.org> Date: Tue, 04 Nov 2014 15:42:20 +0100 In-Reply-To: <201410260141.s9Q1ft59057852@svn.freebsd.org> (Glen Barber's message of "Sun, 26 Oct 2014 01:41:55 +0000 (UTC)") Message-ID: <86mw8710z7.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 14:42:23 -0000 Glen Barber writes: > Modified: head/release/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/release/Makefile Sun Oct 26 01:30:46 2014 (r273652) > +++ head/release/Makefile Sun Oct 26 01:41:54 2014 (r273653) > @@ -56,13 +56,17 @@ ${_V}!=3D eval $$(awk '/^${_V}=3D/{print}' $ > .for _V in ${TARGET_ARCH} > .if !empty(TARGET:M${_V}) > OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET} > +VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} > .else > OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} > +VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} > .endif > .endfor > .endif >=20=20 > -VOLUME_LABEL=3D ${OSRELEASE:C/[-\.]/_/g:S/^$${TYPE}_//} > +.if !defined(VOLUME_LABEL) || empty(VOLUME_LABEL) > +VOLUME_LABEL=3D FreeBSD_Install > +.endif >=20=20 > .if !exists(${DOCDIR}) > NODOC=3D true This broke "make release", because the volume label now contains hyphens, so makefs rejects it. I'm not sure how we even managed to release RC4 with this :( Index: release/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/Makefile.orig +++ release/Makefile @@ -56,10 +56,10 @@ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL=3D ${REVISION:C/[-\.]/_/g:}_${BRANCH}_${TARGET} .else OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL=3D ${REVISION:C/[-\.]/_/g:}_${BRANCH}_${TARGET_ARCH} .endif .endfor .endif DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 14:56:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2173A34; Tue, 4 Nov 2014 14:56:06 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A1981E0A; Tue, 4 Nov 2014 14:56:06 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 41CC5A3F3; Tue, 4 Nov 2014 14:56:05 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 1D04B10D21; Tue, 4 Nov 2014 15:56:05 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Glen Barber Subject: Re: svn commit: r273653 - head/release References: <201410260141.s9Q1ft59057852@svn.freebsd.org> <86mw8710z7.fsf@nine.des.no> Date: Tue, 04 Nov 2014 15:56:05 +0100 In-Reply-To: <86mw8710z7.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Tue, 04 Nov 2014 15:42:20 +0100") Message-ID: <86fvdz10ca.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 14:56:07 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Index: release/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- release/Makefile.orig > +++ release/Makefile > @@ -56,10 +56,10 @@ > .for _V in ${TARGET_ARCH} > .if !empty(TARGET:M${_V}) > OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET} > -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} > +VOLUME_LABEL=3D ${REVISION:C/[-\.]/_/g:}_${BRANCH}_${TARGET} > .else > OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} > -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} > +VOLUME_LABEL=3D ${REVISION:C/[-\.]/_/g:}_${BRANCH}_${TARGET_ARCH} > .endif > .endfor > .endif Wait, this isn't right. You have to apply the same transformation to ${BRANCH}. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 15:11:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33F5914C; Tue, 4 Nov 2014 15:11:03 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 02D87F6A; Tue, 4 Nov 2014 15:11:03 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0A09A5A9F24; Tue, 4 Nov 2014 15:11:02 +0000 (UTC) Date: Tue, 4 Nov 2014 15:11:01 +0000 From: Brooks Davis To: Mateusz Guzik Subject: Re: svn commit: r274017 - head/sys/kern Message-ID: <20141104151101.GG29192@spindle.one-eyed-alien.net> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> <79454.1415043356@critter.freebsd.dk> <20141104054144.GB4032@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3O1VwFp74L81IIeR" Content-Disposition: inline In-Reply-To: <20141104054144.GB4032@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Tue, 04 Nov 2014 15:31:01 +0000 Cc: Hans Petter Selasky , src-committers@freebsd.org, jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Poul-Henning Kamp , Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 15:11:03 -0000 --3O1VwFp74L81IIeR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 04, 2014 at 06:41:44AM +0100, Mateusz Guzik wrote: > re-sent with trimmed cc >=20 > On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: > > -------- > > In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: > >=20 > > >This optimization is probably minor, but reminds me of other syscalls > > >that would benefit using a single largish allocation up front: > > >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > > > bytes and more. An 8K stack has plently to spare after allocating > > > 1K. However, if malloc() is used then the PATH_MAX limit shouldn't > > > exist. Only a limit to prevent denial of service is needed. > >=20 > > We should actually roll a new rev of all syscalls which take a path > > and have them pass strlen(path)+1 into the kernel. > >=20 > > That would allow both precise allocation and faster copyin, followed > > by a check that the last byte is (still) a NUL. > >=20 >=20 > I think we can speed up things on amd64 no problem without affecting > userspace. >=20 > amd64's copyinstr (and most likely all others) copy byte by byte. What > we can do is copy word size and fall back to byte by byte on page fault. > Ten on each iteration check if 0 was encountered. As long as you handle unaligned starting addresses, you can safely copy aligned-word by aligned-word without the risk of spurious pagefaults (libc makes this assumption all over the place). You may trip other potential memory protection mechanims which aren't limited to page alignment, but for exisiting hardware you don't need to worry about it. That said, I prefer phk's suggestion in many ways. It places the burden on userspace where it belongs and allows precise allocation in the kernel. -- Brooks --3O1VwFp74L81IIeR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRY7IUACgkQXY6L6fI4GtSzJgCfdjsPH64e93aSXnamG/b/ALnN OcYAn1lwUvhiiCFzmvyuDdVPXZto5DY1 =3q7N -----END PGP SIGNATURE----- --3O1VwFp74L81IIeR-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 15:51:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 244429A4; Tue, 4 Nov 2014 15:51:47 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DAC086BF; Tue, 4 Nov 2014 15:51:46 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id B1664A4A5; Tue, 4 Nov 2014 15:51:45 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8F52410D28; Tue, 4 Nov 2014 16:51:45 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Glen Barber Subject: Re: svn commit: r273653 - head/release References: <201410260141.s9Q1ft59057852@svn.freebsd.org> <86mw8710z7.fsf@nine.des.no> <86fvdz10ca.fsf@nine.des.no> Date: Tue, 04 Nov 2014 16:51:45 +0100 In-Reply-To: <86fvdz10ca.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Tue, 04 Nov 2014 15:56:05 +0100") Message-ID: <86bnon0xri.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 15:51:47 -0000 This works: Index: release/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/Makefile.orig +++ release/Makefile @@ -56,10 +56,10 @@ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL=3D ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} .else OSRELEASE=3D ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL=3D ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL=3D ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endif .endfor .endif DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:02:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 547A5E13; Tue, 4 Nov 2014 16:02:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2678E829; Tue, 4 Nov 2014 16:02:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4G2lX5059574; Tue, 4 Nov 2014 16:02:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4G2l3o059573; Tue, 4 Nov 2014 16:02:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411041602.sA4G2l3o059573@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 4 Nov 2014 16:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274090 - head/contrib/netbsd-tests/lib/libc/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 16:02:47 -0000 Author: ngie Date: Tue Nov 4 16:02:46 2014 New Revision: 274090 URL: https://svnweb.freebsd.org/changeset/base/274090 Log: Fix the Jenkins test run by skipping the negative testcases earlier The problem is that lib.libc.locale.t_io:bad_big5_wprintf was printing out illegal Unicode characters, which causes XML parsers to bail immediately, e.g. % kyua report-junit > ~/report.junit % python2 -c 'import xml.dom.minidom as md; md.parse("/home/ngie/report.junit")' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1918, in parse return expatbuilder.parse(file) File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse result = builder.parseFile(fp) File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) xml.parsers.expat.ExpatError: not well-formed (invalid token): line 27137, column 13 Modified: head/contrib/netbsd-tests/lib/libc/locale/t_io.c Modified: head/contrib/netbsd-tests/lib/libc/locale/t_io.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/locale/t_io.c Tue Nov 4 15:39:56 2014 (r274089) +++ head/contrib/netbsd-tests/lib/libc/locale/t_io.c Tue Nov 4 16:02:46 2014 (r274090) @@ -53,14 +53,15 @@ ATF_TC_HEAD(bad_big5_wprintf, tc) ATF_TC_BODY(bad_big5_wprintf, tc) { +#ifdef __FreeBSD__ + atf_tc_skip("does not fail as expected (may be implementation " + "specific issue with the test)"); +#endif + /* XXX implementation detail knowledge (wchar_t encoding) */ wchar_t ibuf[] = { 0xcf10, 0 }; setlocale(LC_CTYPE, "zh_TW.Big5"); -#if defined(__FreeBSD__) - atf_tc_expect_fail("does not fail as expected (may be implementation " - "specific issue with the test)"); -#endif ATF_REQUIRE_ERRNO(EILSEQ, wprintf(L"%ls\n", ibuf) < 0); ATF_REQUIRE(ferror(stdout)); } @@ -73,15 +74,16 @@ ATF_TC_HEAD(bad_big5_swprintf, tc) ATF_TC_BODY(bad_big5_swprintf, tc) { +#ifdef __FreeBSD__ + atf_tc_skip("does not fail as expected (may be implementation " + "specific issue with the test)"); +#endif + /* XXX implementation detail knowledge (wchar_t encoding) */ wchar_t ibuf[] = { 0xcf10, 0 }; wchar_t obuf[20]; setlocale(LC_CTYPE, "zh_TW.Big5"); -#if defined(__FreeBSD__) - atf_tc_expect_fail("does not fail as expected (may be implementation " - "specific issue with the test)"); -#endif ATF_REQUIRE_ERRNO(EILSEQ, swprintf(obuf, sizeof(obuf), L"%ls\n", ibuf) < 0); } @@ -171,7 +173,7 @@ ATF_TC_BODY(bad_big5_getwc, tc) ATF_REQUIRE(fp != NULL); setlocale(LC_CTYPE, "zh_TW.Big5"); -#if defined(__FreeBSD__) +#ifdef __FreeBSD__ atf_tc_expect_fail("does not return WEOF as expected"); #endif ATF_REQUIRE_EQ(getwc(fp), WEOF); From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:20:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEF1D58E; Tue, 4 Nov 2014 16:20:09 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 59D4D9AD; Tue, 4 Nov 2014 16:20:08 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 1856A7811EC; Wed, 5 Nov 2014 03:20:00 +1100 (AEDT) Date: Wed, 5 Nov 2014 03:19:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik Subject: Re: svn commit: r274088 - head/sys/kern In-Reply-To: <20141104114041.GA21297@dft-labs.eu> Message-ID: <20141105023323.O1105@besplex.bde.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=OG-MzttRyq2ILO3qSbwA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 16:20:10 -0000 On Tue, 4 Nov 2014, Mateusz Guzik wrote: > On Tue, Nov 04, 2014 at 11:29:49AM +0000, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Nov 4 11:29:49 2014 >> New Revision: 274088 >> URL: https://svnweb.freebsd.org/changeset/base/274088 >> >> Log: >> Simplify logic a bit. Ensure data buffer is properly aligned, >> especially for platforms where unaligned access is not allowed. Make >> it possible to override the small buffer size. >> >> A simple continuous read string test using libusb showed a reduction >> in CPU usage from roughly 10% to less than 1% using a dual-core GHz >> CPU, when the malloc() operation was skipped for small buffers. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/sys_generic.c >> >> Modified: head/sys/kern/sys_generic.c >> ============================================================================== >> --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 2014 (r274087) >> +++ head/sys/kern/sys_generic.c Tue Nov 4 11:29:49 2014 (r274088) >> @@ -646,10 +646,13 @@ struct ioctl_args { >> int >> sys_ioctl(struct thread *td, struct ioctl_args *uap) >> { >> +#ifndef SYS_IOCTL_SMALL_SIZE >> +#define SYS_IOCTL_SMALL_SIZE 128 >> +#endif This shouldn't be ifdefed. It doesn't even have the full complexity for an option (it isn't in conf/options). >> + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); > > Should not you align to word size instead? Neither. The alignment should be the same as given by malloc(9). The precise value is undocumented. It seems to be determined by malloc() using uma_zcreate() with align = UMA_ALIGN_PTR. This is bogus since UMA_ALIGN_PTR only guarantees enough alignment for pointers but malloc() is required to support all object types. The definition UMA_ALIGN_PTR is also bogus, since it assumes that all pointers have the same alignment requirements and that these are given by the size of the special pointer type 'void *'. But this works, because all machines are vaxes. It gives the register size on all machines. Another unsuitable alignment is by the MD ALIGNBYTES macro. This is (sizeof(register_t) - 1) on all arches except mips 32-bit where it is 7 sparc64 where it is 15. On arm, it is 3, but arm also has STACKALIGNBYTES = 7. The register size is really too small to use for malloc() on 32-bit arches. Its technical correctness depends on no C objects having more than 32-bit alignment. On i386, int64_t and double should have 64-bit alignment, but this is not required unless CFLAGS includes -malign-double which breaks the ABI in userland and is irrelevant for the kernel. > Also maybe it would be beneficial to derive the limit from KSTACK_PAGES > (something silly like KSTACK_PAGES * 32 or something), which I believe would > address earlier complaints. No, that would reward bloat in KSTACK_PAGES. KSTACK_PAGES depends on this, not the other way round. >> @@ -682,10 +685,10 @@ sys_ioctl(struct thread *td, struct ioct >> data = (void *)&arg; >> size = 0; >> } else { >> - if (size <= sizeof(smalldata)) >> - data = smalldata; >> - else >> + if (size > SYS_IOCTL_SMALL_SIZE) >> data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); >> + else >> + data = smalldata; >> } >> } else >> data = (void *)&uap->data; The previous order was better. The malloc() line still has 2 style bugs. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:30:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ACFC9CA; Tue, 4 Nov 2014 16:30:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27156AD5; Tue, 4 Nov 2014 16:30:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4GUhPK071139; Tue, 4 Nov 2014 16:30:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4GUhrp071138; Tue, 4 Nov 2014 16:30:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411041630.sA4GUhrp071138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Nov 2014 16:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274091 - head/tools/sched X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 16:30:43 -0000 Author: jhb Date: Tue Nov 4 16:30:42 2014 New Revision: 274091 URL: https://svnweb.freebsd.org/changeset/base/274091 Log: Bind Ctrl-Q as a global hotkey to exit. Bind Ctrl-W as a hotkey to close dialogs. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Nov 4 16:02:46 2014 (r274090) +++ head/tools/sched/schedgraph.py Tue Nov 4 16:30:42 2014 (r274091) @@ -286,6 +286,10 @@ class ColorConfigure(Toplevel): color = graph.getcolor(type[0]) if (color != ""): self.additem(type[0], color) + self.bind("", self.destroycb) + + def destroycb(self, event): + self.destroy() def additem(self, name, color): item = ColorConf(self.items, name, color) @@ -371,6 +375,10 @@ class SourceConfigure(Toplevel): self.addsource(source) self.drawbuttons() self.buttons.grid(row=1, column=0, sticky=W) + self.bind("", self.destroycb) + + def destroycb(self, event): + self.destroy() def addsource(self, source): if (self.irow > 30): @@ -485,6 +493,10 @@ class SourceStats(Toplevel): bd=1, relief=SUNKEN, width=10).grid( row=ypos, column=3, sticky=W+E) ypos += 1 + self.bind("", self.destroycb) + + def destroycb(self, event): + self.destroy() class SourceContext(Menu): @@ -527,6 +539,7 @@ class EventView(Toplevel): self.drawbuttons() event.displayref(canvas) self.bind("", self.destroycb) + self.bind("", self.destroycb) def destroycb(self, event): self.unbind("") @@ -1307,6 +1320,10 @@ class SchedGraph(Frame): self.pack(expand=1, fill="both") self.buildwidgets() self.layout() + self.bind_all("", self.quitcb) + + def quitcb(self, event): + self.quit() def buildwidgets(self): global status From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:35:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EB21C63; Tue, 4 Nov 2014 16:35:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4E7BB3; Tue, 4 Nov 2014 16:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4GZwYj074475; Tue, 4 Nov 2014 16:35:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4GZv3N074470; Tue, 4 Nov 2014 16:35:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201411041635.sA4GZv3N074470@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Nov 2014 16:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274092 - in head: sys/kern tools/sched X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 16:35:58 -0000 Author: jhb Date: Tue Nov 4 16:35:56 2014 New Revision: 274092 URL: https://svnweb.freebsd.org/changeset/base/274092 Log: Add a new thread state "spinning" to schedgraph and add tracepoints at the start and stop of spinning waits in lock primitives. Modified: head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/tools/sched/schedgraph.py Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Nov 4 16:30:42 2014 (r274091) +++ head/sys/kern/kern_lock.c Tue Nov 4 16:35:56 2014 (r274092) @@ -582,6 +582,9 @@ __lockmgr_args(struct lock *lk, u_int fl CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, lk, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(td), "spinning", + "lockname:\"%s\"", lk->lock_object.lo_name); /* * If we are holding also an interlock drop it @@ -597,11 +600,16 @@ __lockmgr_args(struct lock *lk, u_int fl while (LK_HOLDER(lk->lk_lock) == (uintptr_t)owner && TD_IS_RUNNING(owner)) cpu_spinwait(); + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(td), "running"); GIANT_RESTORE(); continue; } else if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) != 0 && LK_SHARERS(x) && spintries < alk_retries) { + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(td), "spinning", + "lockname:\"%s\"", lk->lock_object.lo_name); if (flags & LK_INTERLOCK) { class->lc_unlock(ilk); flags &= ~LK_INTERLOCK; @@ -619,6 +627,8 @@ __lockmgr_args(struct lock *lk, u_int fl break; cpu_spinwait(); } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(td), "running"); GIANT_RESTORE(); if (i != alk_loops) continue; @@ -814,6 +824,9 @@ __lockmgr_args(struct lock *lk, u_int fl CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, lk, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(td), "spinning", + "lockname:\"%s\"", lk->lock_object.lo_name); /* * If we are holding also an interlock drop it @@ -829,6 +842,8 @@ __lockmgr_args(struct lock *lk, u_int fl while (LK_HOLDER(lk->lk_lock) == (uintptr_t)owner && TD_IS_RUNNING(owner)) cpu_spinwait(); + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(td), "running"); GIANT_RESTORE(); continue; } else if (LK_CAN_ADAPT(lk, flags) && @@ -838,6 +853,9 @@ __lockmgr_args(struct lock *lk, u_int fl !atomic_cmpset_ptr(&lk->lk_lock, x, x | LK_EXCLUSIVE_SPINNERS)) continue; + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(td), "spinning", + "lockname:\"%s\"", lk->lock_object.lo_name); if (flags & LK_INTERLOCK) { class->lc_unlock(ilk); flags &= ~LK_INTERLOCK; @@ -854,6 +872,8 @@ __lockmgr_args(struct lock *lk, u_int fl break; cpu_spinwait(); } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(td), "running"); GIANT_RESTORE(); if (i != alk_loops) continue; Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Nov 4 16:30:42 2014 (r274091) +++ head/sys/kern/kern_mutex.c Tue Nov 4 16:35:56 2014 (r274092) @@ -433,6 +433,10 @@ __mtx_lock_sleep(volatile uintptr_t *c, CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, m, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname((struct thread *)tid), + "spinning", "lockname:\"%s\"", + m->lock_object.lo_name); while (mtx_owner(m) == owner && TD_IS_RUNNING(owner)) { cpu_spinwait(); @@ -440,6 +444,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, spin_cnt++; #endif } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname((struct thread *)tid), + "running"); continue; } } @@ -576,6 +583,8 @@ _mtx_lock_spin_cookie(volatile uintptr_t if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), + "spinning", "lockname:\"%s\"", m->lock_object.lo_name); #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -601,6 +610,8 @@ _mtx_lock_spin_cookie(volatile uintptr_t if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spin done", m); + KTR_STATE0(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), + "running"); LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(LS_MTX_SPIN_LOCK_ACQUIRE, m, contested, waittime, (file), (line)); Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Nov 4 16:30:42 2014 (r274091) +++ head/sys/kern/kern_rwlock.c Tue Nov 4 16:35:56 2014 (r274092) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -420,6 +421,9 @@ __rw_rlock(volatile uintptr_t *c, const CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, rw, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(curthread), "spinning", + "lockname:\"%s\"", rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == owner && TD_IS_RUNNING(owner)) { cpu_spinwait(); @@ -427,10 +431,15 @@ __rw_rlock(volatile uintptr_t *c, const spin_cnt++; #endif } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(curthread), "running"); continue; } } else if (spintries < rowner_retries) { spintries++; + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), + "spinning", "lockname:\"%s\"", + rw->lock_object.lo_name); for (i = 0; i < rowner_loops; i++) { v = rw->rw_lock; if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(v)) @@ -440,6 +449,8 @@ __rw_rlock(volatile uintptr_t *c, const #ifdef KDTRACE_HOOKS spin_cnt += rowner_loops - i; #endif + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); if (i != rowner_loops) continue; } @@ -759,6 +770,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, rw, owner); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), + "spinning", "lockname:\"%s\"", + rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == owner && TD_IS_RUNNING(owner)) { cpu_spinwait(); @@ -766,6 +780,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u spin_cnt++; #endif } + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); continue; } if ((v & RW_LOCK_READ) && RW_READERS(v) && @@ -777,11 +793,16 @@ __rw_wlock_hard(volatile uintptr_t *c, u } } spintries++; + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), + "spinning", "lockname:\"%s\"", + rw->lock_object.lo_name); for (i = 0; i < rowner_loops; i++) { if ((rw->rw_lock & RW_LOCK_WRITE_SPINNER) == 0) break; cpu_spinwait(); } + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); #ifdef KDTRACE_HOOKS spin_cnt += rowner_loops - i; #endif Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue Nov 4 16:30:42 2014 (r274091) +++ head/sys/kern/kern_sx.c Tue Nov 4 16:35:56 2014 (r274092) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -555,6 +556,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, sx, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(curthread), "spinning", + "lockname:\"%s\"", + sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && TD_IS_RUNNING(owner)) { @@ -563,9 +568,14 @@ _sx_xlock_hard(struct sx *sx, uintptr_t spin_cnt++; #endif } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(curthread), "running"); continue; } } else if (SX_SHARERS(x) && spintries < asx_retries) { + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(curthread), "spinning", + "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); spintries++; for (i = 0; i < asx_loops; i++) { @@ -582,6 +592,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t spin_cnt++; #endif } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(curthread), "running"); if (i != asx_loops) continue; } @@ -844,6 +856,9 @@ _sx_slock_hard(struct sx *sx, int opts, CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, sx, owner); + KTR_STATE1(KTR_SCHED, "thread", + sched_tdname(curthread), "spinning", + "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && TD_IS_RUNNING(owner)) { @@ -852,6 +867,8 @@ _sx_slock_hard(struct sx *sx, int opts, #endif cpu_spinwait(); } + KTR_STATE0(KTR_SCHED, "thread", + sched_tdname(curthread), "running"); continue; } } Modified: head/tools/sched/schedgraph.py ============================================================================== --- head/tools/sched/schedgraph.py Tue Nov 4 16:30:42 2014 (r274091) +++ head/tools/sched/schedgraph.py Tue Nov 4 16:35:56 2014 (r274092) @@ -70,6 +70,7 @@ eventcolors = [ ("count", "red"), ("running", "green"), ("idle", "grey"), + ("spinning", "red"), ("yielding", "yellow"), ("swapped", "violet"), ("suspended", "purple"), From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 16:50:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B0F0372; Tue, 4 Nov 2014 16:50:24 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id DF580CE7; Tue, 4 Nov 2014 16:50:23 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 0935BD4A44E; Wed, 5 Nov 2014 03:50:21 +1100 (AEDT) Date: Wed, 5 Nov 2014 03:50:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Chisnall Subject: Re: svn commit: r274086 - head/sbin/route In-Reply-To: Message-ID: <20141105032132.Y1105@besplex.bde.org> References: <201411041021.sA4ALZ4m001202@svn.freebsd.org> <20141104102828.GB1215@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=WG_e04i6Ftto_pB9AjcA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , "Alexander V. Chernikov" , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 16:50:24 -0000 On Tue, 4 Nov 2014, David Chisnall wrote: > On 4 Nov 2014, at 10:28, Stefan Farfeleder wrote: > >> Shouldn't Coverity understand that err doesn't return? > > err() is marked as __dead2, which expands to __attribute__((__noreturn__)). If Coverity doesn't know that __attribute__((__noreturn__)) functions don't return, then that's a Coverity bug and they should fix it (if we're not expanding __dead3 to __attribute__((__noreturn__)) for Coverity, then that's a sys/cdefs.h bug and should be fixed there). __dead3 would be the gcc-3 syntax for __dead2 if that were different. Since gcc only changed the syntax for non-returning functions once, __dead3 doesn't exist. You probably mean __dead2. is indeed broken for lint and some other cases. It defines __dead2 as nothing for lint. This shouldn't be a problem for primitive lints since __dead2 is only a hint (not so for some other things that are defined away), but it prevents any line that supports gcc extensions from seeing the defined-away attributes. __dead2 is also defined away unless the compiler is gcc >= 2.5 or any __INTEL_COMPILER (do any __INTEL_COMPILERs still exist?). Coverity would have to pretend to be gcc >= 2.5 to see the gcc attributes. clang pretends this, but INTEL_COMPILER doesn't. Some other attributes are ifdefed more orthogonally but still messily using macros like __CC_SUPPORTS_INLINE. You still need a mess of ifdefs to determine if the compiler supports the feature. The mess is especially ugly though not very large for 'inline'. There are similar macros for __inline and __inline__. Plain inline has only been standard for 15 years now. __inline is gcc's 20+ year old workaround for inline not being standard. __inline__ is an alternative spelling of this. Its use is just a style bug. All of these are assumed to exist if the compiler is gcc or __INTEL_COMPILER. The ifdefs are not messy enough to be correct even for gcc, since 25+ year old gcc didn't support inlining. Only a few places actually uses the __CC_SUPPORTS_*INLINE feature tests, so these are worse than useless. Many places use __inline instead of inline, so they don't depend on the compiler supporting C99 inline or being gcc with support for inline not killed using -std=c89, etc. > Putting a break after a noreturn function makes the code less readable and will cause errors in non-buggy static analysers (dead code warning - why do you have a break on an unreachable line?). Similarly for lint comments like /* NOTREACHED */. Even lint shouldn't need help to know that standard functions like exit() don't return. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 17:24:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CACE27C; Tue, 4 Nov 2014 17:24:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59273178; Tue, 4 Nov 2014 17:24:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4HOEvw098533; Tue, 4 Nov 2014 17:24:14 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4HOEGD098532; Tue, 4 Nov 2014 17:24:14 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411041724.sA4HOEGD098532@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 4 Nov 2014 17:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274095 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 17:24:14 -0000 Author: gjb Date: Tue Nov 4 17:24:13 2014 New Revision: 274095 URL: https://svnweb.freebsd.org/changeset/base/274095 Log: Fix VOLUME_LABEL when BRANCH contains non-alpha characters, in particular '-' and '.'. Submitted by: des Tested by: des MFC after: 3 days X-MFC-10.1: yes Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Nov 4 17:05:24 2014 (r274094) +++ head/release/Makefile Tue Nov 4 17:24:13 2014 (r274095) @@ -56,10 +56,10 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endif .endfor .endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 17:50:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58B17AB2; Tue, 4 Nov 2014 17:50:32 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B4C33FE; Tue, 4 Nov 2014 17:50:32 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XliFS-0000gS-9t; Tue, 04 Nov 2014 17:50:30 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA4HoT7W002623; Tue, 4 Nov 2014 10:50:29 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19ci0eIT/eZH635goIk4hFw X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274088 - head/sys/kern From: Ian Lepore To: Bruce Evans In-Reply-To: <20141105023323.O1105@besplex.bde.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> <20141105023323.O1105@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 04 Nov 2014 10:50:29 -0700 Message-ID: <1415123429.1200.75.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 17:50:32 -0000 On Wed, 2014-11-05 at 03:19 +1100, Bruce Evans wrote: > [...] > Another unsuitable alignment is by the MD ALIGNBYTES macro. This is > (sizeof(register_t) - 1) on all arches except mips 32-bit where it is 7 > sparc64 where it is 15. On arm, it is 3, but arm also has > STACKALIGNBYTES = 7. The register size is really too small to use for > malloc() on 32-bit arches. Its technical correctness depends on no > C objects having more than 32-bit alignment. On i386, int64_t and > double should have 64-bit alignment, but this is not required unless > CFLAGS includes -malign-double which breaks the ABI in userland and > is irrelevant for the kernel. > In arm/include/_align.h we have: /* * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). [more words snipped] */ #define _ALIGNBYTES (sizeof(int) - 1) So that's clearly wrong, because int64_t and double types require 8-byte alignment. When it comes to fixing it, I could: * include _types.h and use sizeof(__int64_t) * use sizeof(long long) * use sizeof(double) * just hardcode '7' with a comment that says why What are the pros and cons of the various options? Is one of them preferable? Is there something even better I overlooked? -- Ian From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:24:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 572C29AF; Tue, 4 Nov 2014 18:24:40 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 0EFABA16; Tue, 4 Nov 2014 18:24:39 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id D249AD624BD; Wed, 5 Nov 2014 05:24:27 +1100 (AEDT) Date: Wed, 5 Nov 2014 05:24:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis Subject: Re: svn commit: r274017 - head/sys/kern In-Reply-To: <20141104151101.GG29192@spindle.one-eyed-alien.net> Message-ID: <20141105040359.F1613@besplex.bde.org> References: <201411030746.sA37kpPu037113@svn.freebsd.org> <54573AEE.9010602@freebsd.org> <54573B87.7000801@freebsd.org> <54573CD2.1000702@selasky.org> <20141103092132.GH29497@dft-labs.eu> <20141103100847.GK53947@kib.kiev.ua> <20141104045159.E1605@besplex.bde.org> <79454.1415043356@critter.freebsd.dk> <20141104054144.GB4032@dft-labs.eu> <20141104151101.GG29192@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=dTogGHqvtYNlUwzZfsYA:9 a=GJbeeAQR_DHbMl7u:21 a=nKqDXnglTKNcwnOh:21 a=CjuIK1q_8ugA:10 X-Mailman-Approved-At: Tue, 04 Nov 2014 18:39:42 +0000 Cc: Hans Petter Selasky , Mateusz Guzik , jmallett@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Poul-Henning Kamp , src-committers@freebsd.org, Bruce Evans , Konstantin Belousov , Julian Elischer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 18:24:40 -0000 On Tue, 4 Nov 2014, Brooks Davis wrote: > On Tue, Nov 04, 2014 at 06:41:44AM +0100, Mateusz Guzik wrote: >> re-sent with trimmed cc >> >> On Mon, Nov 03, 2014 at 07:35:56PM +0000, Poul-Henning Kamp wrote: >>> -------- >>> In message <20141104045159.E1605@besplex.bde.org>, Bruce Evans writes: >>> >>>> This optimization is probably minor, but reminds me of other syscalls >>>> that would benefit using a single largish allocation up front: >>>> - all vfs calls that start with namei(). They allocate PATH_MAX (1K) >>>> bytes and more. An 8K stack has plently to spare after allocating >>>> 1K. However, if malloc() is used then the PATH_MAX limit shouldn't >>>> exist. Only a limit to prevent denial of service is needed. >>> >>> We should actually roll a new rev of all syscalls which take a path >>> and have them pass strlen(path)+1 into the kernel. >>> >>> That would allow both precise allocation and faster copyin, followed >>> by a check that the last byte is (still) a NUL. >> >> I think we can speed up things on amd64 no problem without affecting >> userspace. >> >> amd64's copyinstr (and most likely all others) copy byte by byte. What >> we can do is copy word size and fall back to byte by byte on page fault. >> Ten on each iteration check if 0 was encountered. The speed of copyinstr is unimportant. If it were, then someone would have optimized it 25 years ago when memory was slower and caches and pipelines and branch prediction were smaller or nonexistent, so that the improvement would have been larger, bith relatively and absolutely. amd64 ran for many years with unoptimized C versions of most string functions in libc. These were only 2-8 times slower than best possible. No one noticed the slowness or the speedup from changing them. copyinstr is a few orders of magnitude (base 10) less important. > As long as you handle unaligned starting addresses, you can safely copy > aligned-word by aligned-word without the risk of spurious pagefaults > (libc makes this assumption all over the place). You may trip other > potential memory protection mechanims which aren't limited to page > alignment, but for exisiting hardware you don't need to worry about it. x86 libc string functions mostly avoid doing alignment, since that would just be slower for the usual case where everthing is aligned. This depends on the hardware allowing misaligned accesses and being only slightly slower for them. The main exceptions are in functions "optimized" to do word-sized accesses. They have to align to avoid running off the end of arrays and getting pagefaults or worse. I doubt that word accesses is a useful optimization for normal use of string functions. Testing showed that the extra startup time is amortized by the string length being just 1 or 2 words, but that is for cached strings. The cached case now runs so fast (several GB/sec even with bytewise accesses) that it is hard to find uses where its overhead is not in the noise. The uncached case runs slow due to cache misses; bytewise accesses add a little noise to its slowness. Pathname lookups in the kernel are probably closest to the uncached case. A typical use is 1 pathname access per file (to open the file). > That said, I prefer phk's suggestion in many ways. It places the burden on > userspace where it belongs and allows precise allocation in the kernel. I don't prefer it, of course. The kernel still can't trust any user parameters. copyin() may be a little faster than copyinstr(), but now userland is slower since it has to do a strlen() before every syscall that passes a counted string. Better try the modest project of changing so to require counted strings everywhere. BTW, copystr() should never have been implemented in asm. It just gives copyinstr()'s error handling for kernel strings. This is convenient, but "optimizing" copystr() by writing it in asm is even less important than for copyinstr(). It can be written in a few lines of C using standard string functions, e.g., by using almost the same code as phk proposed for user pathnames: size_t lencopied, slen; slen = strlen(kfaddr); lencopied = slen + 1; if (lencopied >= len) lencopied = len; bcopy(kfaddr, kdaddr, lencopied); if (done != NULL) *done = lencopied; return (slen < len ? 0 : ENAMETOOLONG); This is a little simpler than for copying from user space, since bcopy() can't trap. This is likely to be faster than the "optimized" asm versions since it doesn't always use bytewise accesses. strlen() gives unnecessary accesses, but they might not be bytewise. The man page is quite quite broken: - it says that the [source] string is at most 'len' bytes long, but I think 'len' is actually the size of the target buffer; this should be at least 1 larger than the source or target string length. - it doesn't say if the target buffer contains a (terminated) string on error. Since termination is impossible when len == 0, it cannot require termination. These bugs are missing in at least the i386 asm implementation. I think it just copies as much of the source string as possible. The result is terminated iff there is space for the terminator. The above is supposed to match the i386 implementation, not the man page. copystr() can now be implemented even more simply but much more slowly using snprintf(). Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 18:52:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1FFA2FD; Tue, 4 Nov 2014 18:52:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE671CEE; Tue, 4 Nov 2014 18:52:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4Iqxgx042680; Tue, 4 Nov 2014 18:52:59 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4Iqx80042679; Tue, 4 Nov 2014 18:52:59 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201411041852.sA4Iqx80042679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 4 Nov 2014 18:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274099 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 18:53:00 -0000 Author: alc Date: Tue Nov 4 18:52:59 2014 New Revision: 274099 URL: https://svnweb.freebsd.org/changeset/base/274099 Log: Eliminate a stale, i386-specific comment. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Nov 4 18:48:13 2014 (r274098) +++ head/sys/vm/vm_page.c Tue Nov 4 18:52:59 2014 (r274099) @@ -290,8 +290,6 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t pa; vm_paddr_t last_pa; char *list; - - /* the biggest memory array is the second group of pages */ vm_paddr_t end; vm_paddr_t biggestsize; vm_paddr_t low_water, high_water; From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:45:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18D51301; Tue, 4 Nov 2014 19:45:56 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 901DD353; Tue, 4 Nov 2014 19:45:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id sA4JjRMO015784; Tue, 4 Nov 2014 23:45:27 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 4 Nov 2014 22:45:27 +0300 (MSK) From: Dmitry Morozovsky To: Glen Barber Subject: Re: svn commit: r274095 - head/release In-Reply-To: <201411041724.sA4HOEGD098532@svn.freebsd.org> Message-ID: References: <201411041724.sA4HOEGD098532@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 04 Nov 2014 23:45:27 +0400 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 19:45:56 -0000 On Tue, 4 Nov 2014, Glen Barber wrote: > Author: gjb > Date: Tue Nov 4 17:24:13 2014 > New Revision: 274095 > URL: https://svnweb.freebsd.org/changeset/base/274095 > > Log: > Fix VOLUME_LABEL when BRANCH contains non-alpha > characters, in particular '-' and '.'. [snip] By the way, what are original reasons to not allow '-' and '_' in volume names? It looks a bit inconsistent with other file systems volume labels... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:51:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hub.FreeBSD.org (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14D9D5B4; Tue, 4 Nov 2014 19:51:28 +0000 (UTC) Date: Tue, 4 Nov 2014 19:51:16 +0000 From: Glen Barber To: Dmitry Morozovsky Subject: Re: svn commit: r274095 - head/release Message-ID: <20141104195116.GA1138@hub.FreeBSD.org> References: <201411041724.sA4HOEGD098532@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 19:51:28 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 04, 2014 at 10:45:27PM +0300, Dmitry Morozovsky wrote: > On Tue, 4 Nov 2014, Glen Barber wrote: >=20 > > Author: gjb > > Date: Tue Nov 4 17:24:13 2014 > > New Revision: 274095 > > URL: https://svnweb.freebsd.org/changeset/base/274095 > >=20 > > Log: > > Fix VOLUME_LABEL when BRANCH contains non-alpha > > characters, in particular '-' and '.'. >=20 > [snip] >=20 > By the way, what are original reasons to not allow '-' and '_' in volume = names? >=20 > It looks a bit inconsistent with other file systems volume labels... >=20 I am unsure, but our makefs(8) does not allow it. Glen --opJtzjQTFsWo+cga Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJUWS40AAoJEAMUWKVHj+KTfy8P/2SF0JcUjg+Sqe612NZ43jXg 0FEeqTZSaONGkt7gPjcCX+Zw9UvUTJXYentbmtPy+5cCQ9VgQVJom4G+6oHbyDwR FD6PPyUd9o28y29aQCzLOdxomGo4R6hGNRSntlNZFegw1eeDHzLjqEy8opo9gd5m PenAIKM7B4v01HBaEIbrjkc4hxiUWKC3fMFOfMXZRROQoSFopdGMAV1AAs/jFZ8u jt46QEBLlXjN+LA+776EqRRNCmaQ75l0pI32LMh6ZfegMXfvOfk5XQJ0UqjBfkwI utZ7UzOaeYCU6oANycv/3Az57TmcBgMlzOjWNcHhERtSNDo32H7gLzReemUbyjRu jSBUXssr+YF8zFNrTIKXW/Vkb+8cj3Icin58dmI747IDr+ZrdrFBBEhzgzDimmST TkbOMR7msVbbzqYRH7gtIRIoltoHWWbgrjIBjQyS7ndxmfGuaJ8K2MMVDkVgr1SM 7221ZiqjPpX1Mnvlinvaa1wKK3o+Vn56OipKrb4VvUBq8E9KTh1R3N4NfbqOXf3S vYRx6ahWM2Ip4WnJAOjusejKyfasZT/hELzYmD+xfbSBB37vSvDZ6UAC8h2UZZb1 o7YRcxMHkM++satAWXFL1tRBHjU7z/fAF/7/HSNfbqFIEq4QSPjbS8cSJyRHlciF f9USXU4VCc5dB9a6IVH5 =g1Pr -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 19:56:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 948F17C2; Tue, 4 Nov 2014 19:56:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67099645; Tue, 4 Nov 2014 19:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4Ju55u071697; Tue, 4 Nov 2014 19:56:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4Ju4Hx071695; Tue, 4 Nov 2014 19:56:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411041956.sA4Ju4Hx071695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 4 Nov 2014 19:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274100 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 19:56:05 -0000 Author: kib Date: Tue Nov 4 19:56:04 2014 New Revision: 274100 URL: https://svnweb.freebsd.org/changeset/base/274100 Log: Fix mis-spelling of bits and types names in the default_pager_putpages() and swap_pager_putpages(). It is the same fix as was done for vnode_pager_putpages() in r271586. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/default_pager.c head/sys/vm/swap_pager.c Modified: head/sys/vm/default_pager.c ============================================================================== --- head/sys/vm/default_pager.c Tue Nov 4 18:52:59 2014 (r274099) +++ head/sys/vm/default_pager.c Tue Nov 4 19:56:04 2014 (r274100) @@ -137,14 +137,11 @@ default_pager_getpages(object, m, count, * cache to the free list. */ static void -default_pager_putpages(object, m, c, sync, rtvals) - vm_object_t object; - vm_page_t *m; - int c; - boolean_t sync; - int *rtvals; +default_pager_putpages(vm_object_t object, vm_page_t *m, int count, + int flags, int *rtvals) { - swappagerops.pgo_putpages(object, m, c, sync, rtvals); + + swappagerops.pgo_putpages(object, m, count, flags, rtvals); } /* Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Nov 4 18:52:59 2014 (r274099) +++ head/sys/vm/swap_pager.c Tue Nov 4 19:56:04 2014 (r274100) @@ -1280,10 +1280,10 @@ swap_pager_getpages(vm_object_t object, */ void swap_pager_putpages(vm_object_t object, vm_page_t *m, int count, - boolean_t sync, int *rtvals) + int flags, int *rtvals) { - int i; - int n = 0; + int i, n; + boolean_t sync; if (count && m[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", @@ -1303,8 +1303,11 @@ swap_pager_putpages(vm_object_t object, swp_pager_meta_build(object, 0, SWAPBLK_NONE); VM_OBJECT_WUNLOCK(object); + n = 0; if (curproc != pageproc) sync = TRUE; + else + sync = (flags & VM_PAGER_PUT_SYNC) != 0; /* * Step 2 From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:16:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id EF7E6F13; Tue, 4 Nov 2014 20:16:13 +0000 (UTC) Message-ID: <5459340D.2030605@FreeBSD.org> Date: Tue, 04 Nov 2014 15:16:13 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Dmitry Morozovsky , Glen Barber Subject: Re: svn commit: r274095 - head/release References: <201411041724.sA4HOEGD098532@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 20:16:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/04/2014 14:45, Dmitry Morozovsky wrote: > On Tue, 4 Nov 2014, Glen Barber wrote: > >> Author: gjb Date: Tue Nov 4 17:24:13 2014 New Revision: 274095 >> URL: https://svnweb.freebsd.org/changeset/base/274095 >> >> Log: Fix VOLUME_LABEL when BRANCH contains non-alpha characters, >> in particular '-' and '.'. > > [snip] > > By the way, what are original reasons to not allow '-' and '_' in > volume names? > > It looks a bit inconsistent with other file systems volume > labels... AFAIK, it is an ISO9660 limitation, i.e., it must be "d-characters". http://wiki.osdev.org/ISO_9660#String_format http://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor In fact, makefs(8) enforces this rule. https://svnweb.freebsd.org/base/head/usr.sbin/makefs/cd9660.c?annotate=253707#l343 https://svnweb.freebsd.org/base/head/usr.sbin/makefs/cd9660.c?annotate=253707#l270 https://svnweb.freebsd.org/base/head/usr.sbin/makefs/cd9660/cd9660_strings.c?annotate=219956#l57 Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUWTQNAAoJEHyflib82/FGwv0H/1P+TbNgugx5H6zkb/FL9j1/ wbP4vqlwV/L+kxmtZgeaa6Oe42ki9o0N6wXyDuran/aQISsXnz8AastSqwWDUVTA HWVWauJgdVWlJ4PKGxbX1Dkn4fuIVqxjLzVOt3U7Jw18chsNlF2B21vmrFoBnqAj EpOnKKCHyJ6oBlWamFawMyFILI9UgrLGGsrxqnNbemU5LVW4cLSloTu2rJUfRhkp N/jITXIKrcaZ3se2Sha11Ue0rjo6d88wyqjJfNSfl4ipKMKvHLkV+8wXRZ6hc1G/ Jb5C+fvlvGIj9Lxyo/h24LpjOfANEvrLdsFd4bLY+NEOe5nlVg/cbAJyrq64b7M= =GK65 -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:25:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 264A3326; Tue, 4 Nov 2014 20:25:02 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 994249FA; Tue, 4 Nov 2014 20:25:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id sA4KOxRw016384; Wed, 5 Nov 2014 00:24:59 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 4 Nov 2014 23:24:59 +0300 (MSK) From: Dmitry Morozovsky To: Jung-uk Kim Subject: Re: svn commit: r274095 - head/release In-Reply-To: <5459340D.2030605@FreeBSD.org> Message-ID: References: <201411041724.sA4HOEGD098532@svn.freebsd.org> <5459340D.2030605@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Wed, 05 Nov 2014 00:24:59 +0400 (MSK) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 20:25:02 -0000 On Tue, 4 Nov 2014, Jung-uk Kim wrote: > >> Log: Fix VOLUME_LABEL when BRANCH contains non-alpha characters, > >> in particular '-' and '.'. > > > > [snip] > > > > By the way, what are original reasons to not allow '-' and '_' in > > volume names? > > > > It looks a bit inconsistent with other file systems volume > > labels... > > AFAIK, it is an ISO9660 limitation, i.e., it must be "d-characters". > > http://wiki.osdev.org/ISO_9660#String_format > http://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor > > In fact, makefs(8) enforces this rule. Ah, so iso9660 has stricter rules than, say, xFAT/NTFS and even UFS... Maybe then we could distinguish file system type given to makefs(8) and apply different check/sed rules depending on it? I mean: it looks a bit unexpected (if not uncomfortable) to have label set up by outer OS accepted by geom_label (and thus created in /dev tree) but unable to duplicate it via makefs(8) and similar mechanisms... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:43:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 1A417AA7; Tue, 4 Nov 2014 20:43:16 +0000 (UTC) Message-ID: <54593A63.70100@FreeBSD.org> Date: Tue, 04 Nov 2014 15:43:15 -0500 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Dmitry Morozovsky Subject: Re: svn commit: r274095 - head/release References: <201411041724.sA4HOEGD098532@svn.freebsd.org> <5459340D.2030605@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 20:43:16 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/04/2014 15:24, Dmitry Morozovsky wrote: > On Tue, 4 Nov 2014, Jung-uk Kim wrote: > >>>> Log: Fix VOLUME_LABEL when BRANCH contains non-alpha >>>> characters, in particular '-' and '.'. >>> >>> [snip] >>> >>> By the way, what are original reasons to not allow '-' and '_' >>> in volume names? >>> >>> It looks a bit inconsistent with other file systems volume >>> labels... >> >> AFAIK, it is an ISO9660 limitation, i.e., it must be >> "d-characters". >> >> http://wiki.osdev.org/ISO_9660#String_format >> http://wiki.osdev.org/ISO_9660#The_Primary_Volume_Descriptor >> >> In fact, makefs(8) enforces this rule. > > Ah, so iso9660 has stricter rules than, say, xFAT/NTFS and even > UFS... > > Maybe then we could distinguish file system type given to makefs(8) > and apply different check/sed rules depending on it? > > I mean: it looks a bit unexpected (if not uncomfortable) to have > label set up by outer OS accepted by geom_label (and thus created > in /dev tree) but unable to duplicate it via makefs(8) and similar > mechanisms... Our mount_cd9660(8) allows it because there are broken CDs in real world. http://wiki.osdev.org/ISO_9660#String_format "Note that not all CDs strictly adhere to the character sets specified in ISO 9660." Actually, popular tools, e.g., mkisofs, do not do strict format checking. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUWTpjAAoJEHyflib82/FGd3sH+gKDR+7ZyHwZoX2rnfbiweKo 8uYYe50RyNfGvbwztuf6GVl1pP8U3JT3sctTvlDi5teoy2O1LNnFdQucoP0eYMDk QrybHBoMhsRL8QfnW2VT6NkwjRbojJ39XdItN4Nm4uZXPSG5oI8DjXygwYeEhDXL Vt+pWf7pHNChcQRjaufoMLCuyWoAWatcJi0tt5DXkwp986E1+B7T9MQLYVzNsTYO m7b5Byxz9Wxqbax3+pxI8zp6pnaWRgICBvyaDGGCKlsYK5YzRNz2iria4O79oUQT 4eclRZBDnSZNmNnefQhTCA9aTwt4et95bn9ZZfkCE9X83PBRTxmZATtXyhKzRU4= =cvyS -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 20:46:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4548C40; Tue, 4 Nov 2014 20:46:26 +0000 (UTC) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 763EBC0B; Tue, 4 Nov 2014 20:46:25 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D2BD1422184; Wed, 5 Nov 2014 07:46:17 +1100 (AEDT) Date: Wed, 5 Nov 2014 07:46:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r274088 - head/sys/kern In-Reply-To: <1415123429.1200.75.camel@revolution.hippie.lan> Message-ID: <20141105071445.O2183@besplex.bde.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> <20141105023323.O1105@besplex.bde.org> <1415123429.1200.75.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=5pyKLLtOd5e_8qTw3bgA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 20:46:27 -0000 On Tue, 4 Nov 2014, Ian Lepore wrote: > On Wed, 2014-11-05 at 03:19 +1100, Bruce Evans wrote: >> [...] >> Another unsuitable alignment is by the MD ALIGNBYTES macro. This is >> (sizeof(register_t) - 1) on all arches except mips 32-bit where it is 7 >> sparc64 where it is 15. On arm, it is 3, but arm also has >> STACKALIGNBYTES = 7. The register size is really too small to use for >> malloc() on 32-bit arches. Its technical correctness depends on no >> C objects having more than 32-bit alignment. On i386, int64_t and >> double should have 64-bit alignment, but this is not required unless >> CFLAGS includes -malign-double which breaks the ABI in userland and >> is irrelevant for the kernel. >> > > In arm/include/_align.h we have: > > /* > * Round p (pointer or byte index) up to a correctly-aligned value > * for all data types (int, long, ...). [more words snipped] > */ > #define _ALIGNBYTES (sizeof(int) - 1) > > So that's clearly wrong, because int64_t and double types require 8-byte > alignment. Do they really, except to be optimal? arm64 doesn't seem to be in -current yet. I know little about arm, but seem to remember that it uses 4-byte alignment to a fault and pads out arrays of chars to that. That would make even less sense if some types actually require 8-byte alignment. > When it comes to fixing it, I could: > > * include _types.h and use sizeof(__int64_t) > * use sizeof(long long) > * use sizeof(double) > * just hardcode '7' with a comment that says why > > What are the pros and cons of the various options? Is one of them > preferable? Is there something even better I overlooked? Just hard-code '7' as '(8 - 1)' without even a comment :-). Except most arches (not arm) already have an excessively verbose comment that has been been blindly copied so that it is now wrong in some cases. You would get this by copying bugs from other arches. For sparc64, it is: % * from: @(#)param.h 5.8 (Berkeley) 6/28/91 % * $FreeBSD: head/sys/sparc64/include/_align.h 196994 2009-09-08 20:45:40Z phk $ % */ The headers are convoluted and pessimized by splitting off this tiny header for namespace reasons. When I fixed the namespace bugs for i386, I intentionally didn't split off this header, but used ifdefs instead. (machine/_align.h is also used in sys/socket.h. Keeping the 2 definitions in it in a separate file just allows sys/socket.h to include this file. It used to direct machine/param.h to define only these 2 things.) % % #ifndef _SPARC64_INCLUDE__ALIGN_H_ % #define _SPARC64_INCLUDE__ALIGN_H_ % % /* % * Round p (pointer or byte index) up to a correctly-aligned value % * for all data types (int, long, ...). The result is unsigned int % * and must be cast to any desired pointer type. % */ % #define _ALIGNBYTES 0xf % #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) Note that the result type is not unsigned int as claimed in the comment. It is only that on 32-bit arches. Also, the type of _ALIGNEDBYTES is a bit fragile. It is signed 32-bit int. So ~ALIGNBYTES is 32 bits. It has value -16, not 0xFFFFFFF0 (the latter is large and unsigned. Then promotion of ~ALIGNBYTES to match the other operand changes its type to u_long and its value to 0xFFFFFFFFFFFFFFF0. The original type had to be signed int and the arithmetic normal 2's complement for the promotion to give the right mask. Even forming ~_ALIGNBYTES requires magic for toggling the sign bit. Since this is the implementation, it can know what happens, but using magic makes its correctness harder to understand. _ALIGNBYTES should probably have type u_long to begin with to reduce the magic. % % #endif /* !_SPARC64_INCLUDE__ALIGN_H_ */ Bruce From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 21:49:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA8B0BF7; Tue, 4 Nov 2014 21:49:45 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 796E6330; Tue, 4 Nov 2014 21:49:45 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xllys-000Nyg-1p; Tue, 04 Nov 2014 21:49:38 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA4Lnatx002979; Tue, 4 Nov 2014 14:49:36 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX190fxrvstcrYzSVYYUIWdik X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274088 - head/sys/kern From: Ian Lepore To: Bruce Evans In-Reply-To: <20141105071445.O2183@besplex.bde.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> <20141105023323.O1105@besplex.bde.org> <1415123429.1200.75.camel@revolution.hippie.lan> <20141105071445.O2183@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 04 Nov 2014 14:49:36 -0700 Message-ID: <1415137776.1200.113.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 21:49:45 -0000 On Wed, 2014-11-05 at 07:46 +1100, Bruce Evans wrote: > On Tue, 4 Nov 2014, Ian Lepore wrote: > > > On Wed, 2014-11-05 at 03:19 +1100, Bruce Evans wrote: > >> [...] > >> Another unsuitable alignment is by the MD ALIGNBYTES macro. This is > >> (sizeof(register_t) - 1) on all arches except mips 32-bit where it is 7 > >> sparc64 where it is 15. On arm, it is 3, but arm also has > >> STACKALIGNBYTES = 7. The register size is really too small to use for > >> malloc() on 32-bit arches. Its technical correctness depends on no > >> C objects having more than 32-bit alignment. On i386, int64_t and > >> double should have 64-bit alignment, but this is not required unless > >> CFLAGS includes -malign-double which breaks the ABI in userland and > >> is irrelevant for the kernel. > >> > > > > In arm/include/_align.h we have: > > > > /* > > * Round p (pointer or byte index) up to a correctly-aligned value > > * for all data types (int, long, ...). [more words snipped] > > */ > > #define _ALIGNBYTES (sizeof(int) - 1) > > > > So that's clearly wrong, because int64_t and double types require 8-byte > > alignment. > > Do they really, except to be optimal? arm64 doesn't seem to be in > -current yet. I know little about arm, but seem to remember that it > uses 4-byte alignment to a fault and pads out arrays of chars to that. > That would make even less sense if some types actually require 8-byte > alignment. > Yep, they do. There are instructions on newer 32-bit arm that operate on 64-bit memory operands and adjacent pairs of registers, and they require 64-bit memory alignment to avoid a fault. Also (unrelated to the ALIGN stuff), the compiler will generate such instructions when operating on pairs of 32-bit values, when it knows the alignment of the memory operand makes it safe to do so. Last year we embraced the newer EABI spec. It requires the stack to be 8-byte aligned at all times except within a leaf function, and the compiler is aware of that. > > When it comes to fixing it, I could: > > > > * include _types.h and use sizeof(__int64_t) > > * use sizeof(long long) > > * use sizeof(double) > > * just hardcode '7' with a comment that says why > > > > What are the pros and cons of the various options? Is one of them > > preferable? Is there something even better I overlooked? > > Just hard-code '7' as '(8 - 1)' without even a comment :-). Except > most arches (not arm) already have an excessively verbose comment that > has been been blindly copied so that it is now wrong in some cases. You > would get this by copying bugs from other arches. For sparc64, it is: > > % * from: @(#)param.h 5.8 (Berkeley) 6/28/91 > % * $FreeBSD: head/sys/sparc64/include/_align.h 196994 2009-09-08 20:45:40Z phk $ > % */ > > The headers are convoluted and pessimized by splitting off this tiny header > for namespace reasons. When I fixed the namespace bugs for i386, I > intentionally didn't split off this header, but used ifdefs instead. > (machine/_align.h is also used in sys/socket.h. Keeping the 2 definitions > in it in a separate file just allows sys/socket.h to include this file. > It used to direct machine/param.h to define only these 2 things.) > > % > % #ifndef _SPARC64_INCLUDE__ALIGN_H_ > % #define _SPARC64_INCLUDE__ALIGN_H_ > % > % /* > % * Round p (pointer or byte index) up to a correctly-aligned value > % * for all data types (int, long, ...). The result is unsigned int > % * and must be cast to any desired pointer type. > % */ > % #define _ALIGNBYTES 0xf > % #define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) > > Note that the result type is not unsigned int as claimed in the comment. > It is only that on 32-bit arches. > > Also, the type of _ALIGNEDBYTES is a bit fragile. It is signed 32-bit int. > So ~ALIGNBYTES is 32 bits. It has value -16, not 0xFFFFFFF0 (the latter > is large and unsigned. Then promotion of ~ALIGNBYTES to match the other > operand changes its type to u_long and its value to 0xFFFFFFFFFFFFFFF0. > The original type had to be signed int and the arithmetic normal 2's > complement for the promotion to give the right mask. Even forming > ~_ALIGNBYTES requires magic for toggling the sign bit. Since this is > the implementation, it can know what happens, but using magic makes its > correctness harder to understand. > > _ALIGNBYTES should probably have type u_long to begin with to reduce the > magic. > > % > % #endif /* !_SPARC64_INCLUDE__ALIGN_H_ */ > > Bruce > So bottom line, define _ALIGNBYTES as (8UL - 1) to minimize the magic? -- Ian From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 21:53:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 711C5DFA; Tue, 4 Nov 2014 21:53:22 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 319EF3FF; Tue, 4 Nov 2014 21:53:21 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id C4B79AC73; Tue, 4 Nov 2014 21:53:20 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id C2D1A10A2; Tue, 4 Nov 2014 22:53:16 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dmitry Morozovsky Subject: Re: svn commit: r274095 - head/release References: <201411041724.sA4HOEGD098532@svn.freebsd.org> <5459340D.2030605@FreeBSD.org> Date: Tue, 04 Nov 2014 22:53:16 +0100 In-Reply-To: (Dmitry Morozovsky's message of "Tue, 4 Nov 2014 23:24:59 +0300 (MSK)") Message-ID: <86zjc6ab03.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 21:53:22 -0000 Dmitry Morozovsky writes: > Maybe then we could distinguish file system type given to makefs(8) and a= pply=20 > different check/sed rules depending on it? More work, more complexity, more opportunity for error, for - let's be honest here - absolutely no gain. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:25:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C928817; Tue, 4 Nov 2014 22:25:35 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF6F59FC; Tue, 4 Nov 2014 22:25:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id sA4MOpDK018132; Wed, 5 Nov 2014 02:24:51 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Wed, 5 Nov 2014 01:24:51 +0300 (MSK) From: Dmitry Morozovsky To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r274095 - head/release In-Reply-To: <86zjc6ab03.fsf@nine.des.no> Message-ID: References: <201411041724.sA4HOEGD098532@svn.freebsd.org> <5459340D.2030605@FreeBSD.org> <86zjc6ab03.fsf@nine.des.no> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Wed, 05 Nov 2014 02:25:04 +0400 (MSK) Cc: svn-src-head@freebsd.org, Glen Barber , svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 22:25:35 -0000 On Tue, 4 Nov 2014, Dag-Erling Sm?rgrav wrote: > > Maybe then we could distinguish file system type given to makefs(8) and apply > > different check/sed rules depending on it? > > More work, more complexity, more opportunity for error, for - let's be > honest here - absolutely no gain. I do see your point, Dag-Erling, and honestly have no real counter-arguments ;) Well, so be it. (another sidenote: it's quite an example of "be permissive on input, and restrictive on output" principle) -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 22:47:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FA3E8D; Tue, 4 Nov 2014 22:47:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C96C7F; Tue, 4 Nov 2014 22:47:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4MlrsP055017; Tue, 4 Nov 2014 22:47:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4MlqCn055012; Tue, 4 Nov 2014 22:47:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201411042247.sA4MlqCn055012@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 4 Nov 2014 22:47:52 +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: r274101 - stable/10/contrib/mtree 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 22:47:53 -0000 Author: brooks Date: Tue Nov 4 22:47:51 2014 New Revision: 274101 URL: https://svnweb.freebsd.org/changeset/base/274101 Log: MFC r273796 Import in latest mtree from NetBSD to fix a bug in parsing group files that jmg fixed upstream. Sponsored by: DARPA, AFRL Modified: stable/10/contrib/mtree/create.c stable/10/contrib/mtree/extern.h stable/10/contrib/mtree/getid.c stable/10/contrib/mtree/mtree.c stable/10/contrib/mtree/spec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/mtree/create.c ============================================================================== --- stable/10/contrib/mtree/create.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/create.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.72 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.73 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -91,13 +91,14 @@ static u_long flags; #endif static int dcmp(const FTSENT *FTS_CONST *, const FTSENT *FTS_CONST *); -static void output(int, int *, const char *, ...) - __attribute__((__format__(__printf__, 3, 4))); -static int statd(FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, u_long *); -static void statf(int, FTSENT *); +static void output(FILE *, int, int *, const char *, ...) + __printflike(4, 5); +static int statd(FILE *, FTS *, FTSENT *, uid_t *, gid_t *, mode_t *, + u_long *); +static void statf(FILE *, int, FTSENT *); void -cwalk(void) +cwalk(FILE *fp) { FTS *t; FTSENT *p; @@ -121,7 +122,7 @@ cwalk(void) } if (!nflag) - printf( + fprintf(fp, "#\t user: %s\n#\tmachine: %s\n#\t tree: %s\n" "#\t date: %s", user, host, fullpath, ctime(&clocktime)); @@ -142,21 +143,21 @@ cwalk(void) switch(p->fts_info) { case FTS_D: if (!bflag) - printf("\n"); + fprintf(fp, "\n"); if (!nflag) - printf("# %s\n", p->fts_path); - statd(t, p, &uid, &gid, &mode, &flags); - statf(indent, p); + fprintf(fp, "# %s\n", p->fts_path); + statd(fp, t, p, &uid, &gid, &mode, &flags); + statf(fp, indent, p); break; case FTS_DP: if (p->fts_level > 0) if (!nflag) - printf("%*s# %s\n", indent, "", + fprintf(fp, "%*s# %s\n", indent, "", p->fts_path); if (p->fts_level > 0 || flavor == F_FREEBSD9) { - printf("%*s..\n", indent, ""); + fprintf(fp, "%*s..\n", indent, ""); if (!bflag) - printf("\n"); + fprintf(fp, "\n"); } break; case FTS_DNR: @@ -167,7 +168,7 @@ cwalk(void) break; default: if (!dflag) - statf(indent, p); + statf(fp, indent, p); break; } @@ -178,7 +179,7 @@ cwalk(void) } static void -statf(int indent, FTSENT *p) +statf(FILE *fp, int indent, FTSENT *p) { u_int32_t len, val; int fd, offset; @@ -187,51 +188,54 @@ statf(int indent, FTSENT *p) char *digestbuf; #endif - offset = printf("%*s%s%s", indent, "", + offset = fprintf(fp, "%*s%s%s", indent, "", S_ISDIR(p->fts_statp->st_mode) ? "" : " ", vispath(p->fts_name)); if (offset > (INDENTNAMELEN + indent)) offset = MAXLINELEN; else - offset += printf("%*s", (INDENTNAMELEN + indent) - offset, ""); + offset += fprintf(fp, "%*s", + (INDENTNAMELEN + indent) - offset, ""); if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) - output(indent, &offset, "type=%s", + output(fp, indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); if (keys & (F_UID | F_UNAME) && p->fts_statp->st_uid != uid) { if (keys & F_UNAME && (name = user_from_uid(p->fts_statp->st_uid, 1)) != NULL) - output(indent, &offset, "uname=%s", name); + output(fp, indent, &offset, "uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - output(indent, &offset, "uid=%u", p->fts_statp->st_uid); + output(fp, indent, &offset, "uid=%u", + p->fts_statp->st_uid); } if (keys & (F_GID | F_GNAME) && p->fts_statp->st_gid != gid) { if (keys & F_GNAME && (name = group_from_gid(p->fts_statp->st_gid, 1)) != NULL) - output(indent, &offset, "gname=%s", name); + output(fp, indent, &offset, "gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - output(indent, &offset, "gid=%u", p->fts_statp->st_gid); + output(fp, indent, &offset, "gid=%u", + p->fts_statp->st_gid); } if (keys & F_MODE && (p->fts_statp->st_mode & MBITS) != mode) - output(indent, &offset, "mode=%#o", + output(fp, indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_DEV && (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode))) - output(indent, &offset, "device=%#jx", + output(fp, indent, &offset, "device=%#jx", (uintmax_t)p->fts_statp->st_rdev); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) - output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); + output(fp, indent, &offset, "nlink=%u", p->fts_statp->st_nlink); if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) - output(indent, &offset, "size=%ju", + output(fp, indent, &offset, "size=%ju", (uintmax_t)p->fts_statp->st_size); if (keys & F_TIME) #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H) - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtimespec.tv_sec, p->fts_statp->st_mtimespec.tv_nsec); #else - output(indent, &offset, "time=%jd.%09ld", + output(fp, indent, &offset, "time=%jd.%09ld", (intmax_t)p->fts_statp->st_mtime, (long)0); #endif if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { @@ -239,14 +243,14 @@ statf(int indent, FTSENT *p) crc(fd, &val, &len)) mtree_err("%s: %s", p->fts_accpath, strerror(errno)); close(fd); - output(indent, &offset, "cksum=%lu", (long)val); + output(fp, indent, &offset, "cksum=%lu", (long)val); } #ifndef NO_MD5 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { if ((digestbuf = MD5File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: MD5File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", MD5KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", MD5KEY, digestbuf); free(digestbuf); } #endif /* ! NO_MD5 */ @@ -255,7 +259,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = RMD160File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: RMD160File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", RMD160KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", RMD160KEY, digestbuf); free(digestbuf); } #endif /* ! NO_RMD160 */ @@ -264,7 +268,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA1File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA1File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA1KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA1KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA1 */ @@ -273,7 +277,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA256_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA256_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA256KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA256KEY, digestbuf); free(digestbuf); } #ifdef SHA384_BLOCK_LENGTH @@ -281,7 +285,7 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA384_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA384_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA384KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA384KEY, digestbuf); free(digestbuf); } #endif @@ -289,18 +293,18 @@ statf(int indent, FTSENT *p) if ((digestbuf = SHA512_File(p->fts_accpath, NULL)) == NULL) mtree_err("%s: SHA512_File failed: %s", p->fts_accpath, strerror(errno)); - output(indent, &offset, "%s=%s", SHA512KEY, digestbuf); + output(fp, indent, &offset, "%s=%s", SHA512KEY, digestbuf); free(digestbuf); } #endif /* ! NO_SHA2 */ if (keys & F_SLINK && (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) - output(indent, &offset, "link=%s", + output(fp, indent, &offset, "link=%s", vispath(rlink(p->fts_accpath))); #if HAVE_STRUCT_STAT_ST_FLAGS if (keys & F_FLAGS && p->fts_statp->st_flags != flags) { char *str = flags_to_string(p->fts_statp->st_flags, "none"); - output(indent, &offset, "flags=%s", str); + output(fp, indent, &offset, "flags=%s", str); free(str); } #endif @@ -324,8 +328,8 @@ statf(int indent, FTSENT *p) #define MTREE_MAXS 16 static int -statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, - u_long *pflags) +statd(FILE *fp, FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode, + u_long *pflags) { FTSENT *p; gid_t sgid; @@ -398,33 +402,33 @@ statd(FTS *t, FTSENT *parent, uid_t *pui first) { first = 0; if (flavor != F_NETBSD6 && dflag) - printf("/set type=dir"); + fprintf(fp, "/set type=dir"); else - printf("/set type=file"); + fprintf(fp, "/set type=file"); if (keys & (F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(saveuid, 1)) != NULL) - printf(" uname=%s", name); + fprintf(fp, " uname=%s", name); if (keys & F_UID || (keys & F_UNAME && name == NULL)) - printf(" uid=%lu", (u_long)saveuid); + fprintf(fp, " uid=%lu", (u_long)saveuid); } if (keys & (F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(savegid, 1)) != NULL) - printf(" gname=%s", name); + fprintf(fp, " gname=%s", name); if (keys & F_GID || (keys & F_GNAME && name == NULL)) - printf(" gid=%lu", (u_long)savegid); + fprintf(fp, " gid=%lu", (u_long)savegid); } if (keys & F_MODE) - printf(" mode=%#lo", (u_long)savemode); + fprintf(fp, " mode=%#lo", (u_long)savemode); if (keys & F_NLINK) - printf(" nlink=1"); + fprintf(fp, " nlink=1"); if (keys & F_FLAGS) { char *str = flags_to_string(saveflags, "none"); - printf(" flags=%s", str); + fprintf(fp, " flags=%s", str); free(str); } - printf("\n"); + fprintf(fp, "\n"); *puid = saveuid; *pgid = savegid; *pmode = savemode; @@ -455,7 +459,7 @@ dcmp(const FTSENT *FTS_CONST *a, const F } void -output(int indent, int *offset, const char *fmt, ...) +output(FILE *fp, int indent, int *offset, const char *fmt, ...) { va_list ap; char buf[1024]; @@ -465,8 +469,8 @@ output(int indent, int *offset, const ch va_end(ap); if (*offset + strlen(buf) > MAXLINELEN - 3) { - printf(" \\\n%*s", INDENTNAMELEN + indent, ""); + fprintf(fp, " \\\n%*s", INDENTNAMELEN + indent, ""); *offset = INDENTNAMELEN + indent; } - *offset += printf(" %s", buf) + 1; + *offset += fprintf(fp, " %s", buf) + 1; } Modified: stable/10/contrib/mtree/extern.h ============================================================================== --- stable/10/contrib/mtree/extern.h Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/extern.h Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.38 2013/02/03 19:15:17 christos Exp $ */ +/* $NetBSD: extern.h,v 1.39 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -63,8 +63,8 @@ void addtag(slist_t *, char *); int check_excludes(const char *, const char *); int compare(NODE *, FTSENT *); int crc(int, u_int32_t *, u_int32_t *); -void cwalk(void); -void dump_nodes(const char *, NODE *, int); +void cwalk(FILE *); +void dump_nodes(FILE *, const char *, NODE *, int); void init_excludes(void); int matchtags(NODE *); __dead __printflike(1,2) void mtree_err(const char *, ...); Modified: stable/10/contrib/mtree/getid.c ============================================================================== --- stable/10/contrib/mtree/getid.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/getid.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $ */ +/* $NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $ */ /* from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */ /* from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */ @@ -65,7 +65,7 @@ #endif #include -__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $"); +__RCSID("$NetBSD: getid.c,v 1.10 2014/10/27 21:46:45 christos Exp $"); #include @@ -206,7 +206,12 @@ grstart(void) } if (grfile[0] == '\0') /* sanity check */ return 0; - return (_gr_fp = fopen(grfile, "r")) ? 1 : 0; + + _gr_fp = fopen(grfile, "r"); + if (_gr_fp != NULL) + return 1; + warn("Can't open `%s'", grfile); + return 0; } @@ -231,7 +236,7 @@ grscan(int search, gid_t gid, const char continue; } /* skip comments */ - if (pwline[0] == '#') + if (grline[0] == '#') continue; if (grmatchline(search, gid, name)) return 1; @@ -350,7 +355,11 @@ pwstart(void) } if (pwfile[0] == '\0') /* sanity check */ return 0; - return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0; + _pw_fp = fopen(pwfile, "r"); + if (_pw_fp != NULL) + return 1; + warn("Can't open `%s'", pwfile); + return 0; } Modified: stable/10/contrib/mtree/mtree.c ============================================================================== --- stable/10/contrib/mtree/mtree.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/mtree.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.48 2013/04/08 17:39:11 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.49 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -296,11 +296,11 @@ main(int argc, char **argv) mtree_err("-l and -u flags are mutually exclusive"); if (cflag) { - cwalk(); + cwalk(stdout); exit(0); } if (Cflag || Dflag) { - dump_nodes("", spec(spec1), Dflag); + dump_nodes(stdout, "", spec(spec1), Dflag); exit(0); } if (spec2 != NULL) Modified: stable/10/contrib/mtree/spec.c ============================================================================== --- stable/10/contrib/mtree/spec.c Tue Nov 4 19:56:04 2014 (r274100) +++ stable/10/contrib/mtree/spec.c Tue Nov 4 22:47:51 2014 (r274101) @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $ */ +/* $NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.88 2013/10/17 17:22:59 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.89 2014/04/24 17:22:41 christos Exp $"); #endif #endif /* not lint */ @@ -102,7 +102,7 @@ static void set(char *, NODE *); static void unset(char *, NODE *); static void addchild(NODE *, NODE *); static int nodecmp(const NODE *, const NODE *); -static int appendfield(int, const char *, ...) __printflike(2, 3); +static int appendfield(FILE *, int, const char *, ...) __printflike(3, 4); #define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) @@ -290,21 +290,21 @@ free_nodes(NODE *root) /* * appendfield -- - * Like printf(), but output a space either before or after + * Like fprintf(), but output a space either before or after * the regular output, according to the pathlast flag. */ static int -appendfield(int pathlast, const char *fmt, ...) +appendfield(FILE *fp, int pathlast, const char *fmt, ...) { va_list ap; int result; va_start(ap, fmt); if (!pathlast) - printf(" "); + fprintf(fp, " "); result = vprintf(fmt, ap); if (pathlast) - printf(" "); + fprintf(fp, " "); va_end(ap); return result; } @@ -316,7 +316,7 @@ appendfield(int pathlast, const char *fm * it first. */ void -dump_nodes(const char *dir, NODE *root, int pathlast) +dump_nodes(FILE *fp, const char *dir, NODE *root, int pathlast) { NODE *cur; char path[MAXPATHLEN]; @@ -334,70 +334,75 @@ dump_nodes(const char *dir, NODE *root, mtree_err("Pathname too long."); if (!pathlast) - printf("%s", vispath(path)); + fprintf(fp, "%s", vispath(path)); #define MATCHFLAG(f) ((keys & (f)) && (cur->flags & (f))) if (MATCHFLAG(F_TYPE)) - appendfield(pathlast, "type=%s", nodetype(cur->type)); + appendfield(fp, pathlast, "type=%s", + nodetype(cur->type)); if (MATCHFLAG(F_UID | F_UNAME)) { if (keys & F_UNAME && (name = user_from_uid(cur->st_uid, 1)) != NULL) - appendfield(pathlast, "uname=%s", name); + appendfield(fp, pathlast, "uname=%s", name); else - appendfield(pathlast, "uid=%u", cur->st_uid); + appendfield(fp, pathlast, "uid=%u", + cur->st_uid); } if (MATCHFLAG(F_GID | F_GNAME)) { if (keys & F_GNAME && (name = group_from_gid(cur->st_gid, 1)) != NULL) - appendfield(pathlast, "gname=%s", name); + appendfield(fp, pathlast, "gname=%s", name); else - appendfield(pathlast, "gid=%u", cur->st_gid); + appendfield(fp, pathlast, "gid=%u", + cur->st_gid); } if (MATCHFLAG(F_MODE)) - appendfield(pathlast, "mode=%#o", cur->st_mode); + appendfield(fp, pathlast, "mode=%#o", cur->st_mode); if (MATCHFLAG(F_DEV) && (cur->type == F_BLOCK || cur->type == F_CHAR)) - appendfield(pathlast, "device=%#jx", + appendfield(fp, pathlast, "device=%#jx", (uintmax_t)cur->st_rdev); if (MATCHFLAG(F_NLINK)) - appendfield(pathlast, "nlink=%d", cur->st_nlink); + appendfield(fp, pathlast, "nlink=%d", cur->st_nlink); if (MATCHFLAG(F_SLINK)) - appendfield(pathlast, "link=%s", vispath(cur->slink)); + appendfield(fp, pathlast, "link=%s", + vispath(cur->slink)); if (MATCHFLAG(F_SIZE)) - appendfield(pathlast, "size=%ju", + appendfield(fp, pathlast, "size=%ju", (uintmax_t)cur->st_size); if (MATCHFLAG(F_TIME)) - appendfield(pathlast, "time=%jd.%09ld", + appendfield(fp, pathlast, "time=%jd.%09ld", (intmax_t)cur->st_mtimespec.tv_sec, cur->st_mtimespec.tv_nsec); if (MATCHFLAG(F_CKSUM)) - appendfield(pathlast, "cksum=%lu", cur->cksum); + appendfield(fp, pathlast, "cksum=%lu", cur->cksum); if (MATCHFLAG(F_MD5)) - appendfield(pathlast, "%s=%s", MD5KEY, cur->md5digest); + appendfield(fp, pathlast, "%s=%s", MD5KEY, + cur->md5digest); if (MATCHFLAG(F_RMD160)) - appendfield(pathlast, "%s=%s", RMD160KEY, + appendfield(fp, pathlast, "%s=%s", RMD160KEY, cur->rmd160digest); if (MATCHFLAG(F_SHA1)) - appendfield(pathlast, "%s=%s", SHA1KEY, + appendfield(fp, pathlast, "%s=%s", SHA1KEY, cur->sha1digest); if (MATCHFLAG(F_SHA256)) - appendfield(pathlast, "%s=%s", SHA256KEY, + appendfield(fp, pathlast, "%s=%s", SHA256KEY, cur->sha256digest); if (MATCHFLAG(F_SHA384)) - appendfield(pathlast, "%s=%s", SHA384KEY, + appendfield(fp, pathlast, "%s=%s", SHA384KEY, cur->sha384digest); if (MATCHFLAG(F_SHA512)) - appendfield(pathlast, "%s=%s", SHA512KEY, + appendfield(fp, pathlast, "%s=%s", SHA512KEY, cur->sha512digest); if (MATCHFLAG(F_FLAGS)) { str = flags_to_string(cur->st_flags, "none"); - appendfield(pathlast, "flags=%s", str); + appendfield(fp, pathlast, "flags=%s", str); free(str); } if (MATCHFLAG(F_IGN)) - appendfield(pathlast, "ignore"); + appendfield(fp, pathlast, "ignore"); if (MATCHFLAG(F_OPT)) - appendfield(pathlast, "optional"); + appendfield(fp, pathlast, "optional"); if (MATCHFLAG(F_TAGS)) { /* don't output leading or trailing commas */ p = cur->tags; @@ -406,12 +411,12 @@ dump_nodes(const char *dir, NODE *root, q = p + strlen(p); while(q > p && q[-1] == ',') q--; - appendfield(pathlast, "tags=%.*s", (int)(q - p), p); + appendfield(fp, pathlast, "tags=%.*s", (int)(q - p), p); } puts(pathlast ? vispath(path) : ""); if (cur->child) - dump_nodes(path, cur->child, pathlast); + dump_nodes(fp, path, cur->child, pathlast); } } From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:02:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CE1918E; Tue, 4 Nov 2014 23:02:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7920EE17; Tue, 4 Nov 2014 23:02:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4N2Hij063812; Tue, 4 Nov 2014 23:02:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4N2HUs063811; Tue, 4 Nov 2014 23:02:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411042302.sA4N2HUs063811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 4 Nov 2014 23:02: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: r274102 - stable/10/release 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:02:17 -0000 Author: gjb Date: Tue Nov 4 23:02:16 2014 New Revision: 274102 URL: https://svnweb.freebsd.org/changeset/base/274102 Log: MFC r274095: Fix VOLUME_LABEL when BRANCH contains '-' and '.' characters, in particular '-' and '.'. Insta-MFC ok: re (hrs) Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Tue Nov 4 22:47:51 2014 (r274101) +++ stable/10/release/Makefile Tue Nov 4 23:02:16 2014 (r274102) @@ -56,10 +56,10 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endif .endfor .endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:02:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD23B26E; Tue, 4 Nov 2014 23:02:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8051CE1A; Tue, 4 Nov 2014 23:02:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4N2KhG063861; Tue, 4 Nov 2014 23:02:20 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4N2K4X063860; Tue, 4 Nov 2014 23:02:20 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042302.sA4N2K4X063860@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274103 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:02:20 -0000 Author: des Date: Tue Nov 4 23:02:19 2014 New Revision: 274103 URL: https://svnweb.freebsd.org/changeset/base/274103 Log: When reseeding the DPRNG, we're supposed to hash the current key and some accumulated entropy twice and use that as the new key. Due to a typo, we were using the output of the first hash round instead of the second. Correct this, but eliminate temp[] since we can reuse hash[]. Also add comments explaining what is going on and why. Noticed by: Sami Farin Reviewed by: markm@ Approved by: so (des) Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Tue Nov 4 23:02:16 2014 (r274102) +++ head/sys/dev/random/fortuna.c Tue Nov 4 23:02:19 2014 (r274103) @@ -25,6 +25,17 @@ * */ +/* This implementation of Fortuna is based on the descriptions found in + * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneier + * ("K&S"). + * + * The above book is superceded by ISBN 978-0-470-47424-2 "Cryptography + * Engineering" by Ferguson, Schneier and Kohno ("FS&K"). + * + * This code has not yet caught up with FS&K, but differences are not + * expected to be complex. + */ + #include __FBSDID("$FreeBSD$"); @@ -234,27 +245,26 @@ static void reseed(uint8_t *junk, u_int length) { struct randomdev_hash context; - uint8_t hash[KEYSIZE], temp[KEYSIZE]; + uint8_t hash[KEYSIZE]; KASSERT(fortuna_state.minpoolsize > 0, ("random: Fortuna threshold = 0")); #ifdef _KERNEL mtx_assert(&random_reseed_mtx, MA_OWNED); #endif - /* F&S - temp = H(K|s) */ + /* F&S - K = Hd(K|s) where Hd(m) is H(H(m)) */ randomdev_hash_init(&context); +#if 0 + /* FS&K defines Hd(m) as H(H(0^512|m)) */ + randomdev_hash_iterate(&context, zero_region, KEYSIZE); +#endif randomdev_hash_iterate(&context, &fortuna_state.key, sizeof(fortuna_state.key)); randomdev_hash_iterate(&context, junk, length); - randomdev_hash_finish(&context, temp); - - /* F&S - hash = H(temp) */ + randomdev_hash_finish(&context, hash); randomdev_hash_init(&context); - randomdev_hash_iterate(&context, temp, KEYSIZE); + randomdev_hash_iterate(&context, hash, KEYSIZE); randomdev_hash_finish(&context, hash); - - /* F&S - K = hash */ - randomdev_encrypt_init(&fortuna_state.key, temp); - memset(temp, 0, sizeof(temp)); + randomdev_encrypt_init(&fortuna_state.key, hash); memset(hash, 0, sizeof(hash)); /* Unblock the device if it was blocked due to being unseeded */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:04:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 742DC43D; Tue, 4 Nov 2014 23:04:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61183E3E; Tue, 4 Nov 2014 23:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4N40RP064120; Tue, 4 Nov 2014 23:04:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4N40mA064119; Tue, 4 Nov 2014 23:04:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411042304.sA4N40mA064119@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 4 Nov 2014 23:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274104 - releng/10.1/release X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:04:00 -0000 Author: gjb Date: Tue Nov 4 23:03:59 2014 New Revision: 274104 URL: https://svnweb.freebsd.org/changeset/base/274104 Log: MFstable10 r274102: MFC r274095: Fix VOLUME_LABEL when BRANCH contains '-' and '.' characters. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/release/Makefile Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/release/Makefile ============================================================================== --- releng/10.1/release/Makefile Tue Nov 4 23:02:19 2014 (r274103) +++ releng/10.1/release/Makefile Tue Nov 4 23:03:59 2014 (r274104) @@ -56,10 +56,10 @@ ${_V}!= eval $$(awk '/^${_V}=/{print}' $ .for _V in ${TARGET_ARCH} .if !empty(TARGET:M${_V}) OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET} .else OSRELEASE= ${TYPE}-${REVISION}-${BRANCH}-${TARGET}-${TARGET_ARCH} -VOLUME_LABEL= ${REVISION:C/\./_/g:}_${BRANCH}_${TARGET_ARCH} +VOLUME_LABEL= ${REVISION:C/[.-]/_/g}_${BRANCH:C/[.-]/_/g}_${TARGET_ARCH} .endif .endfor .endif From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:10:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC194890; Tue, 4 Nov 2014 23:10:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E71FE99; Tue, 4 Nov 2014 23:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NAx6V067642; Tue, 4 Nov 2014 23:10:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NAxob067641; Tue, 4 Nov 2014 23:10:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411042310.sA4NAxob067641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 4 Nov 2014 23:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274105 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:10:59 -0000 Author: bapt Date: Tue Nov 4 23:10:58 2014 New Revision: 274105 URL: https://svnweb.freebsd.org/changeset/base/274105 Log: Partially fix indentation issues to improve readability helping cooperation with Dragonfly folks PR: 194785 Submitted by: François Tigeot (ftigeot@wolfpond.org) Modified: head/sys/dev/sound/pci/spicds.c Modified: head/sys/dev/sound/pci/spicds.c ============================================================================== --- head/sys/dev/sound/pci/spicds.c Tue Nov 4 23:03:59 2014 (r274104) +++ head/sys/dev/sound/pci/spicds.c Tue Nov 4 23:10:58 2014 (r274105) @@ -210,37 +210,40 @@ spicds_init(struct spicds_info *codec) snd_mtxlock(codec->lock); if (codec->type == SPICDS_TYPE_AK4524 ||\ codec->type == SPICDS_TYPE_AK4528) { - /* power off */ - spicds_wrcd(codec, AK4524_POWER, 0); - /* set parameter */ - spicds_wrcd(codec, AK4524_FORMAT, codec->format); - spicds_wrcd(codec, AK4524_DVC, codec->dvc); - /* power on */ - spicds_wrcd(codec, AK4524_POWER, AK452X_POWER_PWDA | AK452X_POWER_PWAD | AK452X_POWER_PWVR); - /* free reset register */ - spicds_wrcd(codec, AK4524_RESET, AK452X_RESET_RSDA | AK452X_RESET_RSAD); + /* power off */ + spicds_wrcd(codec, AK4524_POWER, 0); + /* set parameter */ + spicds_wrcd(codec, AK4524_FORMAT, codec->format); + spicds_wrcd(codec, AK4524_DVC, codec->dvc); + /* power on */ + spicds_wrcd(codec, AK4524_POWER, + AK452X_POWER_PWDA | AK452X_POWER_PWAD | AK452X_POWER_PWVR); + /* free reset register */ + spicds_wrcd(codec, AK4524_RESET, + AK452X_RESET_RSDA | AK452X_RESET_RSAD); } if (codec->type == SPICDS_TYPE_WM8770) { - /* WM8770 init values are taken from ALSA */ - /* These come first to reduce init pop noise */ - spicds_wrcd(codec, 0x1b, 0x044); /* ADC Mux (AC'97 source) */ - spicds_wrcd(codec, 0x1c, 0x00B); /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ - spicds_wrcd(codec, 0x1d, 0x009); /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ - - spicds_wrcd(codec, 0x18, 0x000); /* All power-up */ + /* WM8770 init values are taken from ALSA */ - spicds_wrcd(codec, 0x16, 0x122); /* I2S, normal polarity, 24bit */ - spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */ + /* These come first to reduce init pop noise */ + spicds_wrcd(codec, 0x1b, 0x044); /* ADC Mux (AC'97 source) */ + spicds_wrcd(codec, 0x1c, 0x00B); /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ + spicds_wrcd(codec, 0x1d, 0x009); /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ - spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */ - spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */ + spicds_wrcd(codec, 0x18, 0x000); /* All power-up */ + + spicds_wrcd(codec, 0x16, 0x122); /* I2S, normal polarity, 24bit */ + spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */ + + spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */ + spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */ } - if (codec->type == SPICDS_TYPE_AK4358) - spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ + if (codec->type == SPICDS_TYPE_AK4358) + spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4381) - spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4396) - spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ snd_mtxunlock(codec->lock); } @@ -249,18 +252,18 @@ spicds_reinit(struct spicds_info *codec) { snd_mtxlock(codec->lock); if (codec->type != SPICDS_TYPE_WM8770) { - /* reset */ - spicds_wrcd(codec, AK4524_RESET, 0); - /* set parameter */ - spicds_wrcd(codec, AK4524_FORMAT, codec->format); - spicds_wrcd(codec, AK4524_DVC, codec->dvc); - /* free reset register */ - spicds_wrcd(codec, AK4524_RESET, AK452X_RESET_RSDA | AK452X_RESET_RSAD); - } - else { - /* WM8770 reinit */ - /* AK4358 reinit */ - /* AK4381 reinit */ + /* reset */ + spicds_wrcd(codec, AK4524_RESET, 0); + /* set parameter */ + spicds_wrcd(codec, AK4524_FORMAT, codec->format); + spicds_wrcd(codec, AK4524_DVC, codec->dvc); + /* free reset register */ + spicds_wrcd(codec, AK4524_RESET, + AK452X_RESET_RSDA | AK452X_RESET_RSAD); + } else { + /* WM8770 reinit */ + /* AK4358 reinit */ + /* AK4381 reinit */ } snd_mtxunlock(codec->lock); } @@ -301,11 +304,11 @@ spicds_set(struct spicds_info *codec, in case SPICDS_TYPE_WM8770: right = right + 27; break; - case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4381: case SPICDS_TYPE_AK4396: right = right * 255 / 100; break; - default: + default: right = right * 127 / 100; } if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) { From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:29:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CFCCCAC; Tue, 4 Nov 2014 23:29:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78E8910C; Tue, 4 Nov 2014 23:29:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NTU9x074516; Tue, 4 Nov 2014 23:29:30 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NTUJ4074514; Tue, 4 Nov 2014 23:29:30 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042329.sA4NTUJ4074514@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274106 - in head: contrib/tnftp/src 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:29:30 -0000 Author: des Date: Tue Nov 4 23:29:29 2014 New Revision: 274106 URL: https://svnweb.freebsd.org/changeset/base/274106 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des) Modified: head/contrib/tnftp/src/fetch.c head/sys/kern/kern_prot.c Modified: head/contrib/tnftp/src/fetch.c ============================================================================== --- head/contrib/tnftp/src/fetch.c Tue Nov 4 23:10:58 2014 (r274105) +++ head/contrib/tnftp/src/fetch.c Tue Nov 4 23:29:29 2014 (r274106) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Tue Nov 4 23:10:58 2014 (r274105) +++ head/sys/kern/kern_prot.c Tue Nov 4 23:29:29 2014 (r274106) @@ -2066,21 +2066,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2099,21 +2098,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:29:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1671DED; Tue, 4 Nov 2014 23:29:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACFDE115; Tue, 4 Nov 2014 23:29:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NTwAw074608; Tue, 4 Nov 2014 23:29:58 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NTwvM074606; Tue, 4 Nov 2014 23:29:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042329.sA4NTwvM074606@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:29:58 +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: r274107 - in stable/10: contrib/tnftp/src 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:29:58 -0000 Author: des Date: Tue Nov 4 23:29:57 2014 New Revision: 274107 URL: https://svnweb.freebsd.org/changeset/base/274107 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des) Modified: stable/10/contrib/tnftp/src/fetch.c stable/10/sys/kern/kern_prot.c Modified: stable/10/contrib/tnftp/src/fetch.c ============================================================================== --- stable/10/contrib/tnftp/src/fetch.c Tue Nov 4 23:29:29 2014 (r274106) +++ stable/10/contrib/tnftp/src/fetch.c Tue Nov 4 23:29:57 2014 (r274107) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: stable/10/sys/kern/kern_prot.c ============================================================================== --- stable/10/sys/kern/kern_prot.c Tue Nov 4 23:29:29 2014 (r274106) +++ stable/10/sys/kern/kern_prot.c Tue Nov 4 23:29:57 2014 (r274107) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:30:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85EFDF70; Tue, 4 Nov 2014 23:30:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6861D120; Tue, 4 Nov 2014 23:30:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NUO3d074844; Tue, 4 Nov 2014 23:30:24 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NUNTw074841; Tue, 4 Nov 2014 23:30:23 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042330.sA4NUNTw074841@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274108 - in stable/8: contrib/lukemftp/src sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:30:24 -0000 Author: des Date: Tue Nov 4 23:30:23 2014 New Revision: 274108 URL: https://svnweb.freebsd.org/changeset/base/274108 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: stable/8/contrib/lukemftp/src/fetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/kern/kern_prot.c Modified: stable/8/contrib/lukemftp/src/fetch.c ============================================================================== --- stable/8/contrib/lukemftp/src/fetch.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/contrib/lukemftp/src/fetch.c Tue Nov 4 23:30:23 2014 (r274108) @@ -540,7 +540,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = xstrdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -566,8 +566,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1085,17 +1084,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't run `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1278,7 +1285,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(user); FREEPTR(pass); FREEPTR(host); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:30:23 2014 (r274108) @@ -2836,6 +2836,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: stable/8/sys/kern/kern_prot.c ============================================================================== --- stable/8/sys/kern/kern_prot.c Tue Nov 4 23:29:57 2014 (r274107) +++ stable/8/sys/kern/kern_prot.c Tue Nov 4 23:30:23 2014 (r274108) @@ -2054,21 +2054,20 @@ struct getlogin_args { int getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2087,21 +2086,23 @@ setlogin(struct thread *td, struct setlo int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:30:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C71A7126; Tue, 4 Nov 2014 23:30:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B28651AF; Tue, 4 Nov 2014 23:30:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NUmqx074955; Tue, 4 Nov 2014 23:30:48 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NUmV3074953; Tue, 4 Nov 2014 23:30:48 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042330.sA4NUmV3074953@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:30:48 +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: r274109 - in stable/9: contrib/tnftp/src sys/kern 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:30:48 -0000 Author: des Date: Tue Nov 4 23:30:47 2014 New Revision: 274109 URL: https://svnweb.freebsd.org/changeset/base/274109 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: so (des) Modified: stable/9/contrib/tnftp/src/fetch.c stable/9/sys/kern/kern_prot.c Modified: stable/9/contrib/tnftp/src/fetch.c ============================================================================== --- stable/9/contrib/tnftp/src/fetch.c Tue Nov 4 23:30:23 2014 (r274108) +++ stable/9/contrib/tnftp/src/fetch.c Tue Nov 4 23:30:47 2014 (r274109) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: stable/9/sys/kern/kern_prot.c ============================================================================== --- stable/9/sys/kern/kern_prot.c Tue Nov 4 23:30:23 2014 (r274108) +++ stable/9/sys/kern/kern_prot.c Tue Nov 4 23:30:47 2014 (r274109) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:31:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1899268; Tue, 4 Nov 2014 23:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B29601B9; Tue, 4 Nov 2014 23:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NVJ4I076852; Tue, 4 Nov 2014 23:31:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NVIa3076453; Tue, 4 Nov 2014 23:31:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042331.sA4NVIa3076453@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274110 - in releng/10.0: . contrib/tnftp/src secure/usr.sbin/sshd sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:31:19 -0000 Author: des Date: Tue Nov 4 23:31:17 2014 New Revision: 274110 URL: https://svnweb.freebsd.org/changeset/base/274110 Log: [SA-14:24] Fix denial of service attack against sshd(8). [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: releng/10.0/UPDATING releng/10.0/contrib/tnftp/src/fetch.c releng/10.0/secure/usr.sbin/sshd/Makefile releng/10.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/10.0/sys/conf/newvers.sh releng/10.0/sys/kern/kern_prot.c Modified: releng/10.0/UPDATING ============================================================================== --- releng/10.0/UPDATING Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/UPDATING Tue Nov 4 23:31:17 2014 (r274110) @@ -16,6 +16,20 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141104: p12 FreeBSD-SA-14:24.sshd + FreeBSD-SA-14:25.setlogin + FreeBSD-SA-14:26.ftp + FreeBSD-EN-14:12.zfs + + Fix denial of service attack against sshd(8). [SA-14:24] + + Fix kernel stack disclosure in setlogin(2) / getlogin(2). + [SA-14:25] + + Fix remote command execution in ftp(1). [SA-14:26] + + Fix NFSv4 and ZFS cache consistency issue. [EN-14:12] + 20141022: p11 FreeBSD-EN-14:10.tzdata Time zone data file update. [EN-14:10] Modified: releng/10.0/contrib/tnftp/src/fetch.c ============================================================================== --- releng/10.0/contrib/tnftp/src/fetch.c Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/contrib/tnftp/src/fetch.c Tue Nov 4 23:31:17 2014 (r274110) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: releng/10.0/secure/usr.sbin/sshd/Makefile ============================================================================== --- releng/10.0/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:31:17 2014 (r274110) @@ -56,6 +56,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD+= -lcrypt -lcrypto -lz +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif Modified: releng/10.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/10.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:31:17 2014 (r274110) @@ -2822,6 +2822,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: releng/10.0/sys/conf/newvers.sh ============================================================================== --- releng/10.0/sys/conf/newvers.sh Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/sys/conf/newvers.sh Tue Nov 4 23:31:17 2014 (r274110) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.0" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.0/sys/kern/kern_prot.c ============================================================================== --- releng/10.0/sys/kern/kern_prot.c Tue Nov 4 23:30:47 2014 (r274109) +++ releng/10.0/sys/kern/kern_prot.c Tue Nov 4 23:31:17 2014 (r274110) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:31:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id AE57632E; Tue, 4 Nov 2014 23:31:23 +0000 (UTC) Date: Tue, 4 Nov 2014 23:31:23 +0000 From: Alexey Dokuchaev To: Hans Petter Selasky Subject: Re: svn commit: r272820 - head/etc/devd Message-ID: <20141104233123.GA7135@FreeBSD.org> References: <201410091358.s99DwKA2097240@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201410091358.s99DwKA2097240@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:31:23 -0000 On Thu, Oct 09, 2014 at 01:58:20PM +0000, Hans Petter Selasky wrote: > New Revision: 272820 > URL: https://svnweb.freebsd.org/changeset/base/272820 > > Log: > Add example devd configuration file for USB printers. > > +# Generic USB printer devices > +#notify 100 { > +# match "system" "USB"; > +# match "subsystem" "INTERFACE"; > +# match "type" "ATTACH"; > +# match "intclass" "0x07"; > +# match "intsubclass" "0x01"; > +# match "intprotocol" "(0x01|0x02|0x03)"; > +# action "chown root:wheel /dev/$cdev"; Calling chown(8) looks weird for two reasons: 1) root:wheel arguably should already be the default, and 2) device node credentials and permissions are usually set via devfs.rules(5). ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:32:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA12E561; Tue, 4 Nov 2014 23:32:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4ABC1CB; Tue, 4 Nov 2014 23:32:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NWHXf078760; Tue, 4 Nov 2014 23:32:17 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NWGUw078752; Tue, 4 Nov 2014 23:32:16 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042332.sA4NWGUw078752@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274111 - in releng/8.4: . contrib/lukemftp/src sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:32:18 -0000 Author: des Date: Tue Nov 4 23:32:15 2014 New Revision: 274111 URL: https://svnweb.freebsd.org/changeset/base/274111 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: releng/8.4/UPDATING releng/8.4/contrib/lukemftp/src/fetch.c releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.4/sys/conf/newvers.sh releng/8.4/sys/kern/kern_prot.c Modified: releng/8.4/UPDATING ============================================================================== --- releng/8.4/UPDATING Tue Nov 4 23:31:17 2014 (r274110) +++ releng/8.4/UPDATING Tue Nov 4 23:32:15 2014 (r274111) @@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20141104: p19 FreeBSD-SA-14:25.setlogin + FreeBSD-SA-14:26.ftp + FreeBSD-EN-14:12.zfs + + Fix kernel stack disclosure in setlogin(2) / getlogin(2). + [SA-14:25] + + Fix remote command execution in ftp(1). [SA-14:26] + + Fix NFSv4 and ZFS cache consistency issue. [EN-14:12] + 20141022: p18 FreeBSD-EN-14:10.tzdata Time zone data file update. [EN-14:10] Modified: releng/8.4/contrib/lukemftp/src/fetch.c ============================================================================== --- releng/8.4/contrib/lukemftp/src/fetch.c Tue Nov 4 23:31:17 2014 (r274110) +++ releng/8.4/contrib/lukemftp/src/fetch.c Tue Nov 4 23:32:15 2014 (r274111) @@ -540,7 +540,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = xstrdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -566,8 +566,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1085,17 +1084,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't run `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1278,7 +1285,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(user); FREEPTR(pass); FREEPTR(host); Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:31:17 2014 (r274110) +++ releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:32:15 2014 (r274111) @@ -2735,6 +2735,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Tue Nov 4 23:31:17 2014 (r274110) +++ releng/8.4/sys/conf/newvers.sh Tue Nov 4 23:32:15 2014 (r274111) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RELEASE-p18" +BRANCH="RELEASE-p19" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.4/sys/kern/kern_prot.c ============================================================================== --- releng/8.4/sys/kern/kern_prot.c Tue Nov 4 23:31:17 2014 (r274110) +++ releng/8.4/sys/kern/kern_prot.c Tue Nov 4 23:32:15 2014 (r274111) @@ -2054,21 +2054,20 @@ struct getlogin_args { int getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2087,21 +2086,23 @@ setlogin(struct thread *td, struct setlo int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:32:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DF4E6FB; Tue, 4 Nov 2014 23:32:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F43D1D6; Tue, 4 Nov 2014 23:32:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NWlac078868; Tue, 4 Nov 2014 23:32:47 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NWkBD078862; Tue, 4 Nov 2014 23:32:46 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042332.sA4NWkBD078862@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274112 - in releng/9.1: . contrib/tnftp/src secure/usr.sbin/sshd sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:32:48 -0000 Author: des Date: Tue Nov 4 23:32:45 2014 New Revision: 274112 URL: https://svnweb.freebsd.org/changeset/base/274112 Log: [SA-14:24] Fix denial of service attack against sshd(8). [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: releng/9.1/UPDATING releng/9.1/contrib/tnftp/src/fetch.c releng/9.1/secure/usr.sbin/sshd/Makefile releng/9.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/9.1/sys/conf/newvers.sh releng/9.1/sys/kern/kern_prot.c Modified: releng/9.1/UPDATING ============================================================================== --- releng/9.1/UPDATING Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/UPDATING Tue Nov 4 23:32:45 2014 (r274112) @@ -9,6 +9,20 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20141104: p22 FreeBSD-SA-14:24.sshd + FreeBSD-SA-14:25.setlogin + FreeBSD-SA-14:26.ftp + FreeBSD-EN-14:12.zfs + + Fix denial of service attack against sshd(8). [SA-14:24] + + Fix kernel stack disclosure in setlogin(2) / getlogin(2). + [SA-14:25] + + Fix remote command execution in ftp(1). [SA-14:26] + + Fix NFSv4 and ZFS cache consistency issue. [EN-14:12] + 20141022: p21 FreeBSD-EN-14:10.tzdata Time zone data file update. [EN-14:10] Modified: releng/9.1/contrib/tnftp/src/fetch.c ============================================================================== --- releng/9.1/contrib/tnftp/src/fetch.c Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/contrib/tnftp/src/fetch.c Tue Nov 4 23:32:45 2014 (r274112) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: releng/9.1/secure/usr.sbin/sshd/Makefile ============================================================================== --- releng/9.1/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:32:45 2014 (r274112) @@ -42,6 +42,16 @@ LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 - DPADD+= ${LIBCRYPTO} ${LIBCRYPT} LDADD+= -lcrypto -lcrypt +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif Modified: releng/9.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/9.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:32:45 2014 (r274112) @@ -2721,6 +2721,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: releng/9.1/sys/conf/newvers.sh ============================================================================== --- releng/9.1/sys/conf/newvers.sh Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/sys/conf/newvers.sh Tue Nov 4 23:32:45 2014 (r274112) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.1" -BRANCH="RELEASE-p21" +BRANCH="RELEASE-p22" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.1/sys/kern/kern_prot.c ============================================================================== --- releng/9.1/sys/kern/kern_prot.c Tue Nov 4 23:32:15 2014 (r274111) +++ releng/9.1/sys/kern/kern_prot.c Tue Nov 4 23:32:45 2014 (r274112) @@ -2073,19 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - error = copyout(login, uap->namebuf, uap->namelen); - return(error); + if (len > uap->namelen) + return (ERANGE); + return (copyout(login, uap->namebuf, len)); } /* @@ -2104,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:33:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BEA68AE; Tue, 4 Nov 2014 23:33:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5DD1E5; Tue, 4 Nov 2014 23:33:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NXJK6079020; Tue, 4 Nov 2014 23:33:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NXHl6079012; Tue, 4 Nov 2014 23:33:17 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042333.sA4NXHl6079012@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274113 - in releng/9.2: . contrib/tnftp/src secure/usr.sbin/sshd sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:33:19 -0000 Author: des Date: Tue Nov 4 23:33:17 2014 New Revision: 274113 URL: https://svnweb.freebsd.org/changeset/base/274113 Log: [SA-14:24] Fix denial of service attack against sshd(8). [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: releng/9.2/UPDATING releng/9.2/contrib/tnftp/src/fetch.c releng/9.2/secure/usr.sbin/sshd/Makefile releng/9.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/9.2/sys/conf/newvers.sh releng/9.2/sys/kern/kern_prot.c Modified: releng/9.2/UPDATING ============================================================================== --- releng/9.2/UPDATING Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/UPDATING Tue Nov 4 23:33:17 2014 (r274113) @@ -11,6 +11,20 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20141104: p15 FreeBSD-SA-14:24.sshd + FreeBSD-SA-14:25.setlogin + FreeBSD-SA-14:26.ftp + FreeBSD-EN-14:12.zfs + + Fix denial of service attack against sshd(8). [SA-14:24] + + Fix kernel stack disclosure in setlogin(2) / getlogin(2). + [SA-14:25] + + Fix remote command execution in ftp(1). [SA-14:26] + + Fix NFSv4 and ZFS cache consistency issue. [EN-14:12] + 20141022: p14 FreeBSD-EN-14:10.tzdata Time zone data file update. [EN-14:10] Modified: releng/9.2/contrib/tnftp/src/fetch.c ============================================================================== --- releng/9.2/contrib/tnftp/src/fetch.c Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/contrib/tnftp/src/fetch.c Tue Nov 4 23:33:17 2014 (r274113) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: releng/9.2/secure/usr.sbin/sshd/Makefile ============================================================================== --- releng/9.2/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/secure/usr.sbin/sshd/Makefile Tue Nov 4 23:33:17 2014 (r274113) @@ -47,6 +47,16 @@ CFLAGS+= -DNONE_CIPHER_ENABLED DPADD+= ${LIBCRYPTO} ${LIBCRYPT} LDADD+= -lcrypto -lcrypt +# Fix the order of NEEDED entries for libthr and libc. The libthr +# needs to interpose libc symbols, leaving the libthr loading as +# dependency of krb causes reversed order and broken interposing. Put +# the threading library last on the linker command line, just before +# the -lc added by a compiler driver. +.if ${MK_KERBEROS_SUPPORT} != "no" +DPADD+= ${LIBPTHREAD} +LDADD+= -lpthread +.endif + .if defined(LOCALBASE) CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" .endif Modified: releng/9.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/9.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:33:17 2014 (r274113) @@ -2799,6 +2799,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: releng/9.2/sys/conf/newvers.sh ============================================================================== --- releng/9.2/sys/conf/newvers.sh Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/sys/conf/newvers.sh Tue Nov 4 23:33:17 2014 (r274113) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.2" -BRANCH="RELEASE-p14" +BRANCH="RELEASE-p15" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.2/sys/kern/kern_prot.c ============================================================================== --- releng/9.2/sys/kern/kern_prot.c Tue Nov 4 23:32:45 2014 (r274112) +++ releng/9.2/sys/kern/kern_prot.c Tue Nov 4 23:33:17 2014 (r274113) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:33:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B11B6A23; Tue, 4 Nov 2014 23:33:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B4CC1F5; Tue, 4 Nov 2014 23:33:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NXmO7079130; Tue, 4 Nov 2014 23:33:48 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NXlxo079124; Tue, 4 Nov 2014 23:33:47 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042333.sA4NXlxo079124@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274114 - in releng/9.3: . contrib/tnftp/src sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:33:48 -0000 Author: des Date: Tue Nov 4 23:33:46 2014 New Revision: 274114 URL: https://svnweb.freebsd.org/changeset/base/274114 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). [EN-14:12] Fix NFSv4 and ZFS cache consistency issue. Approved by: so (des) Modified: releng/9.3/UPDATING releng/9.3/contrib/tnftp/src/fetch.c releng/9.3/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/9.3/sys/conf/newvers.sh releng/9.3/sys/kern/kern_prot.c Modified: releng/9.3/UPDATING ============================================================================== --- releng/9.3/UPDATING Tue Nov 4 23:33:17 2014 (r274113) +++ releng/9.3/UPDATING Tue Nov 4 23:33:46 2014 (r274114) @@ -11,6 +11,17 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20141104: p5 FreeBSD-SA-14:25.setlogin + FreeBSD-SA-14:26.ftp + FreeBSD-EN-14:12.zfs + + Fix kernel stack disclosure in setlogin(2) / getlogin(2). + [SA-14:25] + + Fix remote command execution in ftp(1). [SA-14:26] + + Fix NFSv4 and ZFS cache consistency issue. [EN-14:12] + 20141022: p4 FreeBSD-EN-14:10.tzdata FreeBSD-EN-14:11.crypt Modified: releng/9.3/contrib/tnftp/src/fetch.c ============================================================================== --- releng/9.3/contrib/tnftp/src/fetch.c Tue Nov 4 23:33:17 2014 (r274113) +++ releng/9.3/contrib/tnftp/src/fetch.c Tue Nov 4 23:33:46 2014 (r274114) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: releng/9.3/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/9.3/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:33:17 2014 (r274113) +++ releng/9.3/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 4 23:33:46 2014 (r274114) @@ -2812,6 +2812,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i #endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ + vap->va_filerev = zp->z_seq; /* * Add in any requested optional attributes and the create time. Modified: releng/9.3/sys/conf/newvers.sh ============================================================================== --- releng/9.3/sys/conf/newvers.sh Tue Nov 4 23:33:17 2014 (r274113) +++ releng/9.3/sys/conf/newvers.sh Tue Nov 4 23:33:46 2014 (r274114) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.3" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/9.3/sys/kern/kern_prot.c ============================================================================== --- releng/9.3/sys/kern/kern_prot.c Tue Nov 4 23:33:17 2014 (r274113) +++ releng/9.3/sys/kern/kern_prot.c Tue Nov 4 23:33:46 2014 (r274114) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:34:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9243AB57; Tue, 4 Nov 2014 23:34:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737A8205; Tue, 4 Nov 2014 23:34:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NYlgA079316; Tue, 4 Nov 2014 23:34:47 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NYkev079313; Tue, 4 Nov 2014 23:34:46 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411042334.sA4NYkev079313@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Tue, 4 Nov 2014 23:34:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274115 - in releng/10.1: contrib/tnftp/src sys/conf sys/kern X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:34:47 -0000 Author: des Date: Tue Nov 4 23:34:46 2014 New Revision: 274115 URL: https://svnweb.freebsd.org/changeset/base/274115 Log: [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2). [SA-14:26] Fix remote command execution in ftp(1). Approved by: re (gjb) Modified: releng/10.1/contrib/tnftp/src/fetch.c releng/10.1/sys/conf/newvers.sh releng/10.1/sys/kern/kern_prot.c Modified: releng/10.1/contrib/tnftp/src/fetch.c ============================================================================== --- releng/10.1/contrib/tnftp/src/fetch.c Tue Nov 4 23:33:46 2014 (r274114) +++ releng/10.1/contrib/tnftp/src/fetch.c Tue Nov 4 23:34:46 2014 (r274115) @@ -547,7 +547,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -571,8 +571,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -1098,17 +1097,25 @@ fetch_url(const char *url, const char *p } /* end of ftp:// or http:// specific setup */ /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldintp = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1318,7 +1325,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); Modified: releng/10.1/sys/conf/newvers.sh ============================================================================== --- releng/10.1/sys/conf/newvers.sh Tue Nov 4 23:33:46 2014 (r274114) +++ releng/10.1/sys/conf/newvers.sh Tue Nov 4 23:34:46 2014 (r274115) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.1" -BRANCH="RC4" +BRANCH="RC4-p1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/10.1/sys/kern/kern_prot.c ============================================================================== --- releng/10.1/sys/kern/kern_prot.c Tue Nov 4 23:33:46 2014 (r274114) +++ releng/10.1/sys/kern/kern_prot.c Tue Nov 4 23:34:46 2014 (r274115) @@ -2073,21 +2073,20 @@ struct getlogin_args { int sys_getlogin(struct thread *td, struct getlogin_args *uap) { - int error; char login[MAXLOGNAME]; struct proc *p = td->td_proc; + size_t len; if (uap->namelen > MAXLOGNAME) uap->namelen = MAXLOGNAME; PROC_LOCK(p); SESS_LOCK(p->p_session); - bcopy(p->p_session->s_login, login, uap->namelen); + len = strlcpy(login, p->p_session->s_login, uap->namelen) + 1; SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); - if (strlen(login) + 1 > uap->namelen) + if (len > uap->namelen) return (ERANGE); - error = copyout(login, uap->namebuf, uap->namelen); - return (error); + return (copyout(login, uap->namebuf, len)); } /* @@ -2106,21 +2105,23 @@ sys_setlogin(struct thread *td, struct s int error; char logintmp[MAXLOGNAME]; + CTASSERT(sizeof(p->p_session->s_login) >= sizeof(logintmp)); + error = priv_check(td, PRIV_PROC_SETLOGIN); if (error) return (error); error = copyinstr(uap->namebuf, logintmp, sizeof(logintmp), NULL); - if (error == ENAMETOOLONG) - error = EINVAL; - else if (!error) { - PROC_LOCK(p); - SESS_LOCK(p->p_session); - (void) memcpy(p->p_session->s_login, logintmp, - sizeof(logintmp)); - SESS_UNLOCK(p->p_session); - PROC_UNLOCK(p); + if (error != 0) { + if (error == ENAMETOOLONG) + error = EINVAL; + return (error); } - return (error); + PROC_LOCK(p); + SESS_LOCK(p->p_session); + strcpy(p->p_session->s_login, logintmp); + SESS_UNLOCK(p->p_session); + PROC_UNLOCK(p); + return (0); } void From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:38:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5203ACA2; Tue, 4 Nov 2014 23:38:13 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23AA321F; Tue, 4 Nov 2014 23:38:12 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xlnfv-000FHo-8e; Tue, 04 Nov 2014 23:38:11 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA4NcA6t003147; Tue, 4 Nov 2014 16:38:10 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/WNdVOX/sSAp8qm92L4fyj X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274103 - head/sys/dev/random From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <201411042302.sA4N2K4X063860@svn.freebsd.org> References: <201411042302.sA4N2K4X063860@svn.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Tue, 04 Nov 2014 16:38:09 -0700 Message-ID: <1415144289.1200.125.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id sA4NcA6t003147 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:38:13 -0000 On Tue, 2014-11-04 at 23:02 +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Tue Nov 4 23:02:19 2014 > New Revision: 274103 > URL: https://svnweb.freebsd.org/changeset/base/274103 >=20 > Log: > When reseeding the DPRNG, we're supposed to hash the current key and > some accumulated entropy twice and use that as the new key. Due to a > typo, we were using the output of the first hash round instead of the > second. Correct this, but eliminate temp[] since we can reuse hash[]. > Also add comments explaining what is going on and why. > =20 > Noticed by: Sami Farin > Reviewed by: markm@ > Approved by: so (des) >=20 > Modified: > head/sys/dev/random/fortuna.c >=20 > Modified: head/sys/dev/random/fortuna.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/fortuna.c Tue Nov 4 23:02:16 2014 (r274102) > +++ head/sys/dev/random/fortuna.c Tue Nov 4 23:02:19 2014 (r274103) > @@ -25,6 +25,17 @@ > * > */ > =20 > +/* This implementation of Fortuna is based on the descriptions found i= n > + * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneie= r > + * ("K&S"). I'm guessing s/b F&S. -- Ian From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:46:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0390614; Tue, 4 Nov 2014 23:46:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E181933E; Tue, 4 Nov 2014 23:46:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4Nk2bH084233; Tue, 4 Nov 2014 23:46:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4Nk1Cv084226; Tue, 4 Nov 2014 23:46:01 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411042346.sA4Nk1Cv084226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 4 Nov 2014 23:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274116 - in head: lib lib/libdpv lib/libfigpar share/mk sys/sys usr.bin usr.bin/dpv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:46:03 -0000 Author: dteske Date: Tue Nov 4 23:46:01 2014 New Revision: 274116 URL: https://svnweb.freebsd.org/changeset/base/274116 Log: Add new libraries/utilities for data throughput visualization. dpv(3): dialog progress view library dpv(1): stream data from stdin or multiple paths with dialog progress view figpar(3): configuration file parsing library Reviews: D714 Reviewed by: jelischer, shurd Discussed at: MeetBSD California 2014 Vendor/Dev Summit Discussed on: -current MFC after: 21 days X-MFC-to: stable/10 stable/9 Added: head/lib/libdpv/ head/lib/libdpv/Makefile (contents, props changed) head/lib/libdpv/dialog_util.c (contents, props changed) head/lib/libdpv/dialog_util.h (contents, props changed) head/lib/libdpv/dialogrc.c (contents, props changed) head/lib/libdpv/dialogrc.h (contents, props changed) head/lib/libdpv/dprompt.c (contents, props changed) head/lib/libdpv/dprompt.h (contents, props changed) head/lib/libdpv/dpv.3 (contents, props changed) head/lib/libdpv/dpv.c (contents, props changed) head/lib/libdpv/dpv.h (contents, props changed) head/lib/libdpv/dpv_private.h (contents, props changed) head/lib/libdpv/status.c (contents, props changed) head/lib/libdpv/status.h (contents, props changed) head/lib/libdpv/util.c (contents, props changed) head/lib/libdpv/util.h (contents, props changed) head/lib/libfigpar/ head/lib/libfigpar/Makefile (contents, props changed) head/lib/libfigpar/figpar.3 (contents, props changed) head/lib/libfigpar/figpar.c (contents, props changed) head/lib/libfigpar/figpar.h (contents, props changed) head/lib/libfigpar/string_m.c (contents, props changed) head/lib/libfigpar/string_m.h (contents, props changed) head/usr.bin/dpv/ head/usr.bin/dpv/Makefile (contents, props changed) head/usr.bin/dpv/dpv.1 (contents, props changed) head/usr.bin/dpv/dpv.c (contents, props changed) head/usr.bin/dpv/dpv_util.h (contents, props changed) Modified: head/lib/Makefile head/share/mk/bsd.libnames.mk head/sys/sys/param.h head/usr.bin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Nov 4 23:34:46 2014 (r274115) +++ head/lib/Makefile Tue Nov 4 23:46:01 2014 (r274116) @@ -42,12 +42,14 @@ SUBDIR= ${SUBDIR_ORDERED} \ libcrypt \ libdevinfo \ libdevstat \ + libdpv \ libdwarf \ libedit \ ${_libevent} \ libexecinfo \ libexpat \ libfetch \ + libfigpar \ libgeom \ ${_libgpib} \ ${_libgssapi} \ Added: head/lib/libdpv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdpv/Makefile Tue Nov 4 23:46:01 2014 (r274116) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +LIB= dpv +SHLIB_MAJOR= 1 +INCS= dpv.h +MAN= dpv.3 +MLINKS= dpv.3 dpv_free.3 + +CFLAGS+= -I${.CURDIR} +LDFLAGS+= -ldialog -lfigpar -lncurses -lutil + +SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c + +WARNS?= 6 + +.include Added: head/lib/libdpv/dialog_util.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdpv/dialog_util.c Tue Nov 4 23:46:01 2014 (r274116) @@ -0,0 +1,633 @@ +/*- + * Copyright (c) 2013-2014 Devin Teske + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dialog_util.h" +#include "dpv.h" +#include "dpv_private.h" + +extern char **environ; + +#define TTY_DEFAULT_ROWS 24 +#define TTY_DEFAULT_COLS 80 + +/* [X]dialog(1) characteristics */ +uint8_t dialog_test = 0; +uint8_t use_dialog = 0; +uint8_t use_libdialog = 1; +uint8_t use_xdialog = 0; +uint8_t use_color = 1; +char dialog[PATH_MAX] = DIALOG; + +/* [X]dialog(1) functionality */ +char *title = NULL; +char *backtitle = NULL; +int dheight = 0; +int dwidth = 0; +char *dargv[64] = { NULL }; + +/* TTY/Screen characteristics */ +static struct winsize *maxsize = NULL; + +/* Function prototypes */ +static void tty_maxsize_update(void); +static void x11_maxsize_update(void); + +/* + * Update row/column fields of `maxsize' global (used by dialog_maxrows() and + * dialog_maxcols()). If the `maxsize' pointer is NULL, it will be initialized. + * The `ws_row' and `ws_col' fields of `maxsize' are updated to hold current + * maximum height and width (respectively) for a dialog(1) widget based on the + * active TTY size. + * + * This function is called automatically by dialog_maxrows/cols() to reflect + * changes in terminal size in-between calls. + */ +static void +tty_maxsize_update(void) +{ + int fd = STDIN_FILENO; + struct termios t; + + if (maxsize == NULL) { + if ((maxsize = malloc(sizeof(struct winsize))) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + memset((void *)maxsize, '\0', sizeof(struct winsize)); + } + + if (!isatty(fd)) + fd = open("/dev/tty", O_RDONLY); + if ((tcgetattr(fd, &t) < 0) || (ioctl(fd, TIOCGWINSZ, maxsize) < 0)) { + maxsize->ws_row = TTY_DEFAULT_ROWS; + maxsize->ws_col = TTY_DEFAULT_COLS; + } +} + +/* + * Update row/column fields of `maxsize' global (used by dialog_maxrows() and + * dialog_maxcols()). If the `maxsize' pointer is NULL, it will be initialized. + * The `ws_row' and `ws_col' fields of `maxsize' are updated to hold current + * maximum height and width (respectively) for an Xdialog(1) widget based on + * the active video resolution of the X11 environment. + * + * This function is called automatically by dialog_maxrows/cols() to initialize + * `maxsize'. Since video resolution changes are less common and more obtrusive + * than changes to terminal size, the dialog_maxrows/cols() functions only call + * this function when `maxsize' is set to NULL. + */ +static void +x11_maxsize_update(void) +{ + FILE *f = NULL; + char *cols; + char *cp; + char *rows; + char cmdbuf[LINE_MAX]; + char rbuf[LINE_MAX]; + + if (maxsize == NULL) { + if ((maxsize = malloc(sizeof(struct winsize))) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + memset((void *)maxsize, '\0', sizeof(struct winsize)); + } + + /* Assemble the command necessary to get X11 sizes */ + snprintf(cmdbuf, LINE_MAX, "%s --print-maxsize 2>&1", dialog); + + fflush(STDIN_FILENO); /* prevent popen(3) from seeking on stdin */ + + if ((f = popen(cmdbuf, "r")) == NULL) { + if (debug) + warnx("WARNING! Command `%s' failed", cmdbuf); + return; + } + + /* Read in the line returned from Xdialog(1) */ + if ((fgets(rbuf, LINE_MAX, f) == NULL) || (pclose(f) < 0)) + return; + + /* Check for X11-related errors */ + if (strncmp(rbuf, "Xdialog: Error", 14) == 0) + return; + + /* Parse expected output: MaxSize: YY, XXX */ + if ((rows = strchr(rbuf, ' ')) == NULL) + return; + if ((cols = strchr(rows, ',')) != NULL) { + /* strtonum(3) doesn't like trailing junk */ + *(cols++) = '\0'; + if ((cp = strchr(cols, '\n')) != NULL) + *cp = '\0'; + } + + /* Convert to unsigned short */ + maxsize->ws_row = (unsigned short)strtonum( + rows, 0, USHRT_MAX, (const char **)NULL); + maxsize->ws_col = (unsigned short)strtonum( + cols, 0, USHRT_MAX, (const char **)NULL); +} + +/* + * Return the current maximum height (rows) for an [X]dialog(1) widget. + */ +int +dialog_maxrows(void) +{ + + if (use_xdialog && maxsize == NULL) + x11_maxsize_update(); /* initialize maxsize for GUI */ + else if (!use_xdialog) + tty_maxsize_update(); /* update maxsize for TTY */ + return (maxsize->ws_row); +} + +/* + * Return the current maximum width (cols) for an [X]dialog(1) widget. + */ +int +dialog_maxcols(void) +{ + + if (use_xdialog && maxsize == NULL) + x11_maxsize_update(); /* initialize maxsize for GUI */ + else if (!use_xdialog) + tty_maxsize_update(); /* update maxsize for TTY */ + + if (use_dialog || use_libdialog) { + if (use_shadow) + return (maxsize->ws_col - 2); + else + return (maxsize->ws_col); + } else + return (maxsize->ws_col); +} + +/* + * Return the current maximum width (cols) for the terminal. + */ +int +tty_maxcols(void) +{ + + if (use_xdialog && maxsize == NULL) + x11_maxsize_update(); /* initialize maxsize for GUI */ + else if (!use_xdialog) + tty_maxsize_update(); /* update maxsize for TTY */ + + return (maxsize->ws_col); +} + +/* + * Spawn an [X]dialog(1) `--gauge' box with a `--prompt' value of init_prompt. + * Writes the resulting process ID to the pid_t pointed at by `pid'. Returns a + * file descriptor (int) suitable for writing data to the [X]dialog(1) instance + * (data written to the file descriptor is seen as standard-in by the spawned + * [X]dialog(1) process). + */ +int +dialog_spawn_gauge(char *init_prompt, pid_t *pid) +{ + char dummy_init[2] = ""; + char *cp; + int height; + int width; + int error; + posix_spawn_file_actions_t action; +#if DIALOG_SPAWN_DEBUG + unsigned int i; +#endif + unsigned int n = 0; + int stdin_pipe[2] = { -1, -1 }; + + /* Override `dialog' with a path from ENV_DIALOG if provided */ + if ((cp = getenv(ENV_DIALOG)) != NULL) + snprintf(dialog, PATH_MAX, "%s", cp); + + /* For Xdialog(1), set ENV_XDIALOG_HIGH_DIALOG_COMPAT */ + setenv(ENV_XDIALOG_HIGH_DIALOG_COMPAT, "1", 1); + + /* Constrain the height/width */ + height = dialog_maxrows(); + if (backtitle != NULL) + height -= use_shadow ? 5 : 4; + if (dheight < height) + height = dheight; + width = dialog_maxcols(); + if (dwidth < width) + width = dwidth; + + /* Populate argument array */ + dargv[n++] = dialog; + if (title != NULL) { + if ((dargv[n] = malloc(8)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--title"); + dargv[n++] = title; + } + if (backtitle != NULL) { + if ((dargv[n] = malloc(12)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--backtitle"); + dargv[n++] = backtitle; + } + if (use_color) { + if ((dargv[n] = malloc(11)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--colors"); + } + if (use_xdialog) { + if ((dargv[n] = malloc(7)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--left"); + + /* + * NOTE: Xdialog(1)'s `--wrap' appears to be broken for the + * `--gauge' widget prompt-updates. Add it anyway (in-case it + * gets fixed in some later release). + */ + if ((dargv[n] = malloc(7)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--wrap"); + } + if ((dargv[n] = malloc(8)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + sprintf(dargv[n++], "--gauge"); + dargv[n++] = use_xdialog ? dummy_init : init_prompt; + if ((dargv[n] = malloc(40)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + snprintf(dargv[n++], 40, "%u", height); + if ((dargv[n] = malloc(40)) == NULL) + errx(EXIT_FAILURE, "Out of memory?!"); + snprintf(dargv[n++], 40, "%u", width); + dargv[n] = NULL; + + /* Open a pipe(2) to communicate with [X]dialog(1) */ + if (pipe(stdin_pipe) < 0) + err(EXIT_FAILURE, "%s: pipe(2)", __func__); + + /* Fork [X]dialog(1) process */ +#if DIALOG_SPAWN_DEBUG + fprintf(stderr, "%s: spawning `", __func__); + for (i = 0; i < n; i++) { + if (i == 0) + fprintf(stderr, "%s", dargv[i]); + else if (*dargv[i] == '-' && *(dargv[i] + 1) == '-') + fprintf(stderr, " %s", dargv[i]); + else + fprintf(stderr, " \"%s\"", dargv[i]); + } + fprintf(stderr, "'\n"); +#endif + posix_spawn_file_actions_init(&action); + posix_spawn_file_actions_adddup2(&action, stdin_pipe[0], STDIN_FILENO); + posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); + error = posix_spawnp(pid, dialog, &action, + (const posix_spawnattr_t *)NULL, dargv, environ); + if (error != 0) + err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + + /* NB: Do not free(3) *dargv[], else SIGSEGV */ + + return (stdin_pipe[1]); +} + +/* + * Returns the number of lines in buffer pointed to by `prompt'. Takes both + * newlines and escaped-newlines into account. + */ +unsigned int +dialog_prompt_numlines(const char *prompt, uint8_t nlstate) +{ + uint8_t nls = nlstate; /* See dialog_prompt_nlstate() */ + const char *cp = prompt; + unsigned int nlines = 1; + + if (prompt == NULL || *prompt == '\0') + return (0); + + while (*cp != '\0') { + if (use_dialog) { + if (strncmp(cp, "\\n", 2) == 0) { + cp++; + nlines++; + nls = TRUE; /* See declaration comment */ + } else if (*cp == '\n') { + if (!nls) + nlines++; + nls = FALSE; /* See declaration comment */ + } + } else if (use_libdialog) { + if (*cp == '\n') + nlines++; + } else if (strncmp(cp, "\\n", 2) == 0) { + cp++; + nlines++; + } + cp++; + } + + return (nlines); +} + +/* + * Returns the length in bytes of the longest line in buffer pointed to by + * `prompt'. Takes newlines and escaped newlines into account. Also discounts + * dialog(1) color escape codes if enabled (via `use_color' global). + */ +unsigned int +dialog_prompt_longestline(const char *prompt, uint8_t nlstate) +{ + uint8_t backslash = 0; + uint8_t nls = nlstate; /* See dialog_prompt_nlstate() */ + const char *p = prompt; + int longest = 0; + int n = 0; + + /* `prompt' parameter is required */ + if (prompt == NULL) + return (0); + if (*prompt == '\0') + return (0); /* shortcut */ + + /* Loop until the end of the string */ + while (*p != '\0') { + /* dialog(1) and dialog(3) will render literal newlines */ + if (use_dialog || use_libdialog) { + if (*p == '\n') { + if (!use_libdialog && nls) + n++; + else { + if (n > longest) + longest = n; + n = 0; + } + nls = FALSE; /* See declaration comment */ + p++; + continue; + } + } + + /* Check for backslash character */ + if (*p == '\\') { + /* If second backslash, count as a single-char */ + if ((backslash ^= 1) == 0) + n++; + } else if (backslash) { + if (*p == 'n' && !use_libdialog) { /* new line */ + /* NB: dialog(3) ignores escaped newlines */ + nls = TRUE; /* See declaration comment */ + if (n > longest) + longest = n; + n = 0; + } else if (use_color && *p == 'Z') { + if (*++p != '\0') + p++; + backslash = 0; + continue; + } else /* [X]dialog(1)/dialog(3) only expand those */ + n += 2; + + backslash = 0; + } else + n++; + p++; + } + if (n > longest) + longest = n; + + return (longest); +} + +/* + * Returns a pointer to the last line in buffer pointed to by `prompt'. Takes + * both newlines (if using dialog(1) versus Xdialog(1)) and escaped newlines + * into account. If no newlines (escaped or otherwise) appear in the buffer, + * `prompt' is returned. If passed a NULL pointer, returns NULL. + */ +char * +dialog_prompt_lastline(char *prompt, uint8_t nlstate) +{ + uint8_t nls = nlstate; /* See dialog_prompt_nlstate() */ + char *lastline; + char *p; + + if (prompt == NULL) + return (NULL); + if (*prompt == '\0') + return (prompt); /* shortcut */ + + lastline = p = prompt; + while (*p != '\0') { + /* dialog(1) and dialog(3) will render literal newlines */ + if (use_dialog || use_libdialog) { + if (*p == '\n') { + if (use_libdialog || !nls) + lastline = p + 1; + nls = FALSE; /* See declaration comment */ + } + } + /* dialog(3) does not expand escaped newlines */ + if (use_libdialog) { + p++; + continue; + } + if (*p == '\\' && *(p + 1) != '\0' && *(++p) == 'n') { + nls = TRUE; /* See declaration comment */ + lastline = p + 1; + } + p++; + } + + return (lastline); +} + +/* + * Returns the number of extra lines generated by wrapping the text in buffer + * pointed to by `prompt' within `ncols' columns (for prompts, this should be + * dwidth - 4). Also discounts dialog(1) color escape codes if enabled (via + * `use_color' global). + */ +int +dialog_prompt_wrappedlines(char *prompt, int ncols, uint8_t nlstate) +{ + uint8_t backslash = 0; + uint8_t nls = nlstate; /* See dialog_prompt_nlstate() */ + char *cp; + char *p = prompt; + int n = 0; + int wlines = 0; + + /* `prompt' parameter is required */ + if (p == NULL) + return (0); + if (*p == '\0') + return (0); /* shortcut */ + + /* Loop until the end of the string */ + while (*p != '\0') { + /* dialog(1) and dialog(3) will render literal newlines */ + if (use_dialog || use_libdialog) { + if (*p == '\n') { + if (use_dialog || !nls) + n = 0; + nls = FALSE; /* See declaration comment */ + } + } + + /* Check for backslash character */ + if (*p == '\\') { + /* If second backslash, count as a single-char */ + if ((backslash ^= 1) == 0) + n++; + } else if (backslash) { + if (*p == 'n' && !use_libdialog) { /* new line */ + /* NB: dialog(3) ignores escaped newlines */ + nls = TRUE; /* See declaration comment */ + n = 0; + } else if (use_color && *p == 'Z') { + if (*++p != '\0') + p++; + backslash = 0; + continue; + } else /* [X]dialog(1)/dialog(3) only expand those */ + n += 2; + + backslash = 0; + } else + n++; + + /* Did we pass the width barrier? */ + if (n > ncols) { + /* + * Work backward to find the first whitespace on-which + * dialog(1) will wrap the line (but don't go before + * the start of this line). + */ + cp = p; + while (n > 1 && !isspace(*cp)) { + cp--; + n--; + } + if (n > 0 && isspace(*cp)) + p = cp; + wlines++; + n = 1; + } + + p++; + } + + return (wlines); +} + +/* + * Returns zero if the buffer pointed to by `prompt' contains an escaped + * newline but only if appearing after any/all literal newlines. This is + * specific to dialog(1) and does not apply to Xdialog(1). + * + * As an attempt to make shell scripts easier to read, dialog(1) will "eat" + * the first literal newline after an escaped newline. This however has a bug + * in its implementation in that rather than allowing `\\n\n' to be treated + * similar to `\\n' or `\n', dialog(1) expands the `\\n' and then translates + * the following literal newline (with or without characters between [!]) into + * a single space. + * + * If you want to be compatible with Xdialog(1), it is suggested that you not + * use literal newlines (they aren't supported); but if you have to use them, + * go right ahead. But be forewarned... if you set $DIALOG in your environment + * to something other than `cdialog' (our current dialog(1)), then it should + * do the same thing w/respect to how to handle a literal newline after an + * escaped newline (you could do no wrong by translating every literal newline + * into a space but only when you've previously encountered an escaped one; + * this is what dialog(1) is doing). + * + * The ``newline state'' (or nlstate for short; as I'm calling it) is helpful + * if you plan to combine multiple strings into a single prompt text. In lead- + * up to this procedure, a common task is to calculate and utilize the widths + * and heights of each piece of prompt text to later be combined. However, if + * (for example) the first string ends in a positive newline state (has an + * escaped newline without trailing literal), the first literal newline in the + * second string will be mangled. + * + * The return value of this function should be used as the `nlstate' argument + * to dialog_*() functions that require it to allow accurate calculations in + * the event such information is needed. + */ +uint8_t +dialog_prompt_nlstate(const char *prompt) +{ + const char *cp; + + if (prompt == NULL) + return 0; + + /* + * Work our way backward from the end of the string for efficiency. + */ + cp = prompt + strlen(prompt); + while (--cp >= prompt) { + /* + * If we get to a literal newline first, this prompt ends in a + * clean state for rendering with dialog(1). Otherwise, if we + * get to an escaped newline first, this prompt ends in an un- + * clean state (following literal will be mangled; see above). + */ + if (*cp == '\n') + return (0); + else if (*cp == 'n' && --cp > prompt && *cp == '\\') + return (1); + } + + return (0); /* no newlines (escaped or otherwise) */ +} + +/* + * Free allocated items initialized by tty_maxsize_update() and + * x11_maxsize_update() + */ +void +dialog_maxsize_free(void) +{ + if (maxsize != NULL) { + free(maxsize); + maxsize = NULL; + } +} Added: head/lib/libdpv/dialog_util.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdpv/dialog_util.h Tue Nov 4 23:46:01 2014 (r274116) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2013-2014 Devin Teske + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DIALOG_UTIL_H_ +#define _DIALOG_UTIL_H_ + +#include + +#include "dialogrc.h" + +#define DIALOG_SPAWN_DEBUG 0 /* Debug spawning of [X]dialog(1) */ + +/* dialog(3) and [X]dialog(1) characteristics */ +#define DIALOG "dialog" +#define XDIALOG "Xdialog" +#define PROMPT_MAX 16384 +#define ENV_DIALOG "DIALOG" +#define ENV_USE_COLOR "USE_COLOR" +#define ENV_XDIALOG_HIGH_DIALOG_COMPAT "XDIALOG_HIGH_DIALOG_COMPAT" +extern uint8_t dialog_test; +extern uint8_t use_libdialog; +extern uint8_t use_dialog; +extern uint8_t use_xdialog; +extern uint8_t use_color; +extern char dialog[]; + +/* dialog(3) and [X]dialog(1) functionality */ +extern char *title, *backtitle; +extern int dheight, dwidth; + +__BEGIN_DECLS +uint8_t dialog_prompt_nlstate(const char *_prompt); +void dialog_gauge_free(void); +void dialog_maxsize_free(void); +char *dialog_prompt_lastline(char *_prompt, uint8_t _nlstate); +int dialog_maxcols(void); +int dialog_maxrows(void); +int dialog_prompt_wrappedlines(char *_prompt, int _ncols, + uint8_t _nlstate); +int dialog_spawn_gauge(char *_init_prompt, pid_t *_pid); +int tty_maxcols(void); +#define tty_maxrows() dialog_maxrows() +unsigned int dialog_prompt_longestline(const char *_prompt, + uint8_t _nlstate); +unsigned int dialog_prompt_numlines(const char *_prompt, uint8_t _nlstate); +__END_DECLS + +#endif /* !_DIALOG_UTIL_H_ */ Added: head/lib/libdpv/dialogrc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libdpv/dialogrc.c Tue Nov 4 23:46:01 2014 (r274116) @@ -0,0 +1,359 @@ +/*- + * Copyright (c) 2013-2014 Devin Teske + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dialogrc.h" + +#define STR_BUFSIZE 255 + +/* dialog(1) `.dialogrc' characteristics */ +uint8_t use_colors = 1; +uint8_t use_shadow = 1; +char gauge_color[STR_BUFSIZE] = "47b"; /* (BLUE,WHITE,ON) */ +char separator[STR_BUFSIZE] = ""; + +/* Function prototypes */ +static int setattr(struct config *, uint32_t, char *, char *); +static int setbool(struct config *, uint32_t, char *, char *); +static int setnum(struct config *, uint32_t, char *, char *); +static int setstr(struct config *, uint32_t, char *, char *); + +/* + * Anatomy of DIALOGRC (~/.dialogrc by default) + * NOTE: Must appear after private function prototypes (above) + * NB: Brace-initialization of union requires cast to *first* member of union + */ +static struct config dialogrc_config[] = { + /* TYPE Directive DEFAULT HANDLER */ + {TYPE_INT, "aspect", {(void *)0}, &setnum}, + {TYPE_STR, "separate_widget", {separator}, &setstr}, + {TYPE_INT, "tab_len", {(void *)0}, &setnum}, + {TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, + {TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, + {TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, + {TYPE_STR, "screen_color", {NULL}, &setattr}, + {TYPE_STR, "shadow_color", {NULL}, &setattr}, + {TYPE_STR, "dialog_color", {NULL}, &setattr}, + {TYPE_STR, "title_color", {NULL}, &setattr}, + {TYPE_STR, "border_color", {NULL}, &setattr}, + {TYPE_STR, "button_active_color", {NULL}, &setattr}, + {TYPE_STR, "button_inactive_color", {NULL}, &setattr}, + {TYPE_STR, "button_key_active_color", {NULL}, &setattr}, + {TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, + {TYPE_STR, "button_label_active_color", {NULL}, &setattr}, + {TYPE_STR, "button_label_inactive_color", {NULL}, &setattr}, + {TYPE_STR, "inputbox_color", {NULL}, &setattr}, + {TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, + {TYPE_STR, "searchbox_color", {NULL}, &setattr}, + {TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, + {TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, + {TYPE_STR, "position_indicator_color", {NULL}, &setattr}, + {TYPE_STR, "menubox_color", {NULL}, &setattr}, + {TYPE_STR, "menubox_border_color", {NULL}, &setattr}, + {TYPE_STR, "item_color", {NULL}, &setattr}, + {TYPE_STR, "item_selected_color", {NULL}, &setattr}, + {TYPE_STR, "tag_color", {NULL}, &setattr}, + {TYPE_STR, "tag_selected_color", {NULL}, &setattr}, + {TYPE_STR, "tag_key_color", {NULL}, &setattr}, + {TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, + {TYPE_STR, "check_color", {NULL}, &setattr}, + {TYPE_STR, "check_selected_color", {NULL}, &setattr}, + {TYPE_STR, "uarrow_color", {NULL}, &setattr}, + {TYPE_STR, "darrow_color", {NULL}, &setattr}, + {TYPE_STR, "itemhelp_color", {NULL}, &setattr}, + {TYPE_STR, "form_active_text_color", {NULL}, &setattr}, + {TYPE_STR, "form_text_color", {NULL}, &setattr}, + {TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, + {TYPE_STR, "gauge_color", {gauge_color}, &setattr}, + {0, NULL, {0}, NULL} +}; + +/* + * figpar call-back for interpreting value as .dialogrc `Attribute' + */ +static int +setattr(struct config *option, uint32_t line __unused, + char *directive __unused, char *value) +{ + char *cp = value; + char *val; + size_t len; + char attrbuf[4]; + + if (option == NULL) { + warnx("%s:%d:%s: Missing callback parameter", __FILE__, + __LINE__, __func__); + return (-1); /* Abort processing */ + } + + /* Allocate memory for the data if not already done */ + if (option->value.str == NULL) { + if ((option->value.str = malloc(STR_BUFSIZE)) == NULL) + return (-1); + } + + /* + * If the first character is left-parenthesis, the format is + * `(background,foreground,highlight)' otherwise, we should take it + * as a reference to another color. + */ + if (*cp != '(') { + /* Copy the [current] value from the referenced color */ + val = dialogrc_config_option(cp)->value.str; + if (val != NULL) + snprintf(option->value.str, STR_BUFSIZE, "%s", val); + + return (0); + } else + cp++; + + strtolower(cp); + + /* Initialize the attrbuf (fg,bg,hi,NUL) */ + attrbuf[0] = '0'; + attrbuf[1] = '0'; + attrbuf[2] = 'B'; /* \ZB = disable; \Zb = enable (see dialog(1)) */ + attrbuf[3] = '\0'; + + /* Interpret the foreground color */ + if (strncmp(cp, "red,", 4) == 0) attrbuf[0] = '1'; + else if (strncmp(cp, "green,", 6) == 0) attrbuf[0] = '2'; + else if (strncmp(cp, "yellow,", 7) == 0) attrbuf[0] = '3'; + else if (strncmp(cp, "blue,", 5) == 0) attrbuf[0] = '4'; + else if (strncmp(cp, "magenta,", 8) == 0) attrbuf[0] = '5'; + else if (strncmp(cp, "cyan,", 5) == 0) attrbuf[0] = '6'; + else if (strncmp(cp, "white,", 6) == 0) attrbuf[0] = '7'; + else if (strncmp(cp, "black,", 6) == 0) attrbuf[0] = '8'; + + /* Advance to the background color */ + cp = strchr(cp, ','); + if (cp == NULL) + goto write_attrbuf; + else + cp++; + + /* Interpret the background color */ + if (strncmp(cp, "red,", 4) == 0) attrbuf[1] = '1'; + else if (strncmp(cp, "green,", 6) == 0) attrbuf[1] = '2'; + else if (strncmp(cp, "yellow,", 7) == 0) attrbuf[1] = '3'; + else if (strncmp(cp, "blue,", 5) == 0) attrbuf[1] = '4'; + else if (strncmp(cp, "magenta,", 8) == 0) attrbuf[1] = '5'; + else if (strncmp(cp, "cyan,", 5) == 0) attrbuf[1] = '6'; + else if (strncmp(cp, "white,", 6) == 0) attrbuf[1] = '7'; + else if (strncmp(cp, "black,", 6) == 0) attrbuf[1] = '8'; + + /* Advance to the highlight */ + cp = strchr(cp, ','); + if (cp == NULL) + goto write_attrbuf; + else + cp++; + + /* Trim trailing parenthesis */ + len = strlen(cp); + if (cp[len - 1] == ')') + cp[len - 1] = '\0'; + + /* Interpret the highlight (initialized to off above) */ + if (strcmp(cp, "on") == 0 || strncmp(cp, "on,", 3) == 0) + attrbuf[2] = 'b'; /* \Zb = enable bold (see dialog(1)) */ + +write_attrbuf: + sprintf(option->value.str, "%s", attrbuf); + + return (0); +} + +/* + * figpar call-back for interpreting value as .dialogrc `Boolean' + */ +static int +setbool(struct config *option, uint32_t line __unused, + char *directive __unused, char *value) +{ + + if (option == NULL) { + warnx("%s:%d:%s: Missing callback parameter", __FILE__, + __LINE__, __func__); + return (-1); /* Abort processing */ + } + + /* Assume ON, check for OFF (case-insensitive) */ + option->value.boolean = 1; + strtolower(value); + if (strcmp(value, "off") == 0) + option->value.boolean = 0; + + return (0); +} + +/* + * figpar call-back for interpreting value as .dialogrc `Number' + */ +static int +setnum(struct config *option, uint32_t line __unused, char *directive __unused, + char *value) +{ + + if (option == NULL) { + warnx("%s:%d:%s: Missing callback parameter", __FILE__, + __LINE__, __func__); + return (-1); /* Abort processing */ + } + + /* Convert the string to a 32-bit signed integer */ + option->value.num = (int32_t)strtol(value, (char **)NULL, 10); + + return (0); +} + +/* + * figpar call-back for interpreting value as .dialogrc `String' + */ +static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Nov 4 23:51:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5105049F; Tue, 4 Nov 2014 23:51:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D10762B; Tue, 4 Nov 2014 23:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4Npa4A088396; Tue, 4 Nov 2014 23:51:36 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4Npadq088395; Tue, 4 Nov 2014 23:51:36 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201411042351.sA4Npadq088395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Tue, 4 Nov 2014 23:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274117 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:51:36 -0000 Author: dumbbell Date: Tue Nov 4 23:51:35 2014 New Revision: 274117 URL: https://svnweb.freebsd.org/changeset/base/274117 Log: vt(4): Support syscons' SC_HISTORY_SIZE to configure history size Therefore, to set histry size to 2000 lines, add the following line to your kernel configuration file: options SC_HISTORY_SIZE=2000 The default history remains at 500 lines. MFC after: 1 week Modified: head/sys/dev/vt/vt.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Nov 4 23:46:01 2014 (r274116) +++ head/sys/dev/vt/vt.h Tue Nov 4 23:51:35 2014 (r274117) @@ -182,7 +182,6 @@ struct vt_buf { #define VBF_SCROLL 0x8 /* scroll locked mode. */ #define VBF_HISTORY_FULL 0x10 /* All rows filled. */ unsigned int vb_history_size; -#define VBF_DEFAULT_HISTORY_SIZE 500 int vb_roffset; /* (b) History rows offset. */ int vb_curroffset; /* (b) Saved rows offset. */ term_pos_t vb_cursor; /* (u) Cursor position. */ @@ -194,6 +193,12 @@ struct vt_buf { term_char_t **vb_rows; /* (u) Array of rows */ }; +#ifdef SC_HISTORY_SIZE +#define VBF_DEFAULT_HISTORY_SIZE SC_HISTORY_SIZE +#else +#define VBF_DEFAULT_HISTORY_SIZE 500 +#endif + void vtbuf_copy(struct vt_buf *, const term_rect_t *, const term_pos_t *); void vtbuf_fill_locked(struct vt_buf *, const term_rect_t *, term_char_t); void vtbuf_init_early(struct vt_buf *); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 00:58:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C20ED444; Wed, 5 Nov 2014 00:58:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACBD381; Wed, 5 Nov 2014 00:58:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA50w2m2018675; Wed, 5 Nov 2014 00:58:02 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA50w1Vc018668; Wed, 5 Nov 2014 00:58:01 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411050058.sA50w1Vc018668@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 5 Nov 2014 00:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274118 - in head/sys: kern netinet netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 00:58:02 -0000 Author: melifaro Date: Wed Nov 5 00:58:01 2014 New Revision: 274118 URL: https://svnweb.freebsd.org/changeset/base/274118 Log: Remove old hack abusing domattach from NFS code. According to IANA RPC uaddr registry, there are no AFs except IPv4 and IPv6, so it's not worth being too abstract here. Remove ne_rtable[AF_MAX+1] and use explicit per-AF radix tries. Use own initialization without relying on domattach code. While I admit that this was one of the rare places in kernel networking code which really was capable of doing multi-AF without any AF-depended code, it is not possible anymore to rely on dom* code. While here, change terrifying "Invalid radix node head, rn:" message, to different non-understandable "netcred already exists for given addr/mask", but less terrifying. Since we know that rn_addaddr() returns NULL if the same record already exists, we should provide more friendly error. MFC after: 1 month Modified: head/sys/kern/vfs_export.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6_rmx.c head/sys/sys/domain.h Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Tue Nov 4 23:51:35 2014 (r274117) +++ head/sys/kern/vfs_export.c Wed Nov 5 00:58:01 2014 (r274118) @@ -37,9 +37,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include -#include #include #include #include @@ -54,12 +56,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address structure"); +static struct radix_node_head *vfs_create_addrlist_af( + struct radix_node_head **prnh, int off); static void vfs_free_addrlist(struct netexport *nep); static int vfs_free_netcred(struct radix_node *rn, void *w); +static void vfs_free_addrlist_af(struct radix_node_head **prnh); static int vfs_hang_addrlist(struct mount *mp, struct netexport *nep, struct export_args *argp); static struct netcred *vfs_export_lookup(struct mount *, struct sockaddr *); @@ -80,7 +86,8 @@ struct netcred { */ struct netexport { struct netcred ne_defexported; /* Default export */ - struct radix_node_head *ne_rtable[AF_MAX+1]; /* Individual exports */ + struct radix_node_head *ne4; + struct radix_node_head *ne6; }; /* @@ -96,7 +103,7 @@ vfs_hang_addrlist(struct mount *mp, stru register int i; struct radix_node *rn; struct sockaddr *saddr, *smask = 0; - struct domain *dom; + int off; int error; /* @@ -163,46 +170,39 @@ vfs_hang_addrlist(struct mount *mp, stru if (smask->sa_len > argp->ex_masklen) smask->sa_len = argp->ex_masklen; } - i = saddr->sa_family; - if ((rnh = nep->ne_rtable[i]) == NULL) { - /* - * Seems silly to initialize every AF when most are not used, - * do so on demand here - */ - for (dom = domains; dom; dom = dom->dom_next) { - KASSERT(((i == AF_INET) || (i == AF_INET6)), - ("unexpected protocol in vfs_hang_addrlist")); - if (dom->dom_family == i && dom->dom_rtattach) { - /* - * XXX MRT - * The INET and INET6 domains know the - * offset already. We don't need to send it - * So we just use it as a flag to say that - * we are or are not setting up a real routing - * table. Only IP and IPV6 need have this - * be 0 so all other protocols can stay the - * same (ABI compatible). - */ - dom->dom_rtattach( - (void **) &nep->ne_rtable[i], 0); - break; - } + rnh = NULL; + switch (saddr->sa_family) { +#ifdef INET + case AF_INET: + if ((rnh = nep->ne4) == NULL) { + off = offsetof(struct sockaddr_in, sin_addr) << 3; + rnh = vfs_create_addrlist_af(&nep->ne4, off); } - if ((rnh = nep->ne_rtable[i]) == NULL) { - error = ENOBUFS; - vfs_mount_error(mp, "%s %s %d", - "Unable to initialize radix node head ", - "for address family", i); - goto out; + break; +#endif +#ifdef INET6 + case AF_INET6: + if ((rnh = nep->ne6) == NULL) { + off = offsetof(struct sockaddr_in6, sin6_addr) << 3; + rnh = vfs_create_addrlist_af(&nep->ne6, off); } + break; +#endif + } + if (rnh == NULL) { + error = ENOBUFS; + vfs_mount_error(mp, "%s %s %d", + "Unable to initialize radix node head ", + "for address family", saddr->sa_family); + goto out; } RADIX_NODE_HEAD_LOCK(rnh); rn = (*rnh->rnh_addaddr)(saddr, smask, rnh, np->netc_rnodes); RADIX_NODE_HEAD_UNLOCK(rnh); if (rn == NULL || np != (struct netcred *)rn) { /* already exists */ error = EPERM; - vfs_mount_error(mp, "Invalid radix node head, rn: %p %p", - rn, np); + vfs_mount_error(mp, + "netcred already exists for given addr/mask"); goto out; } np->netc_exflags = argp->ex_flags; @@ -237,26 +237,43 @@ vfs_free_netcred(struct radix_node *rn, return (0); } +static struct radix_node_head * +vfs_create_addrlist_af(struct radix_node_head **prnh, int off) +{ + + if (rn_inithead((void **)prnh, off) == 0) + return (NULL); + RADIX_NODE_HEAD_LOCK_INIT(*prnh); + return (*prnh); +} + +static void +vfs_free_addrlist_af(struct radix_node_head **prnh) +{ + struct radix_node_head *rnh; + + rnh = *prnh; + RADIX_NODE_HEAD_LOCK(rnh); + (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); + RADIX_NODE_HEAD_UNLOCK(rnh); + RADIX_NODE_HEAD_DESTROY(rnh); + free(rnh, M_RTABLE); + prnh = NULL; +} + /* * Free the net address hash lists that are hanging off the mount points. */ static void vfs_free_addrlist(struct netexport *nep) { - int i; - struct radix_node_head *rnh; struct ucred *cred; - for (i = 0; i <= AF_MAX; i++) { - if ((rnh = nep->ne_rtable[i])) { - RADIX_NODE_HEAD_LOCK(rnh); - (*rnh->rnh_walktree) (rnh, vfs_free_netcred, rnh); - RADIX_NODE_HEAD_UNLOCK(rnh); - RADIX_NODE_HEAD_DESTROY(rnh); - free(rnh, M_RTABLE); - nep->ne_rtable[i] = NULL; /* not SMP safe XXX */ - } - } + if (nep->ne4 != NULL) + vfs_free_addrlist_af(&nep->ne4); + if (nep->ne6 != NULL) + vfs_free_addrlist_af(&nep->ne6); + cred = nep->ne_defexported.netc_anon; if (cred != NULL) crfree(cred); @@ -439,7 +456,15 @@ vfs_export_lookup(struct mount *mp, stru */ if (nam != NULL) { saddr = nam; - rnh = nep->ne_rtable[saddr->sa_family]; + rnh = NULL; + switch (saddr->sa_family) { + case AF_INET: + rnh = nep->ne4; + break; + case AF_INET6: + rnh = nep->ne6; + break; + } if (rnh != NULL) { RADIX_NODE_HEAD_RLOCK(rnh); np = (struct netcred *) Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Tue Nov 4 23:51:35 2014 (r274117) +++ head/sys/netinet/in_rmx.c Wed Nov 5 00:58:01 2014 (r274118) @@ -341,23 +341,12 @@ in_inithead(void **head, int off) { struct radix_node_head *rnh; - /* XXX MRT - * This can be called from vfs_export.c too in which case 'off' - * will be 0. We know the correct value so just use that and - * return directly if it was 0. - * This is a hack that replaces an even worse hack on a bad hack - * on a bad design. After RELENG_7 this should be fixed but that - * will change the ABI, so for now do it this way. - */ if (!rn_inithead(head, 32)) return 0; rnh = *head; RADIX_NODE_HEAD_LOCK_INIT(rnh); - if (off == 0) /* XXX MRT see above */ - return 1; /* only do the rest for a real routing table */ - rnh->rnh_addaddr = in_addroute; in_setmatchfunc(rnh, V_drop_redirect); rnh->rnh_close = in_clsroute; Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Tue Nov 4 23:51:35 2014 (r274117) +++ head/sys/netinet6/in6_rmx.c Wed Nov 5 00:58:01 2014 (r274118) @@ -254,10 +254,6 @@ in6_mtutimo(void *rock) /* * Initialize our routing tree. - * XXX MRT When off == 0, we are being called from vfs_export.c - * so just set up their table and leave. (we know what the correct - * value should be so just use that).. FIX AFTER RELENG_7 is MFC'd - * see also comments in in_inithead() vfs_export.c and domain.h */ static VNET_DEFINE(int, _in6_rt_was_here); #define V__in6_rt_was_here VNET(_in6_rt_was_here) @@ -268,14 +264,11 @@ in6_inithead(void **head, int off) struct radix_node_head *rnh; if (!rn_inithead(head, offsetof(struct sockaddr_in6, sin6_addr) << 3)) - return 0; /* See above */ + return (0); rnh = *head; RADIX_NODE_HEAD_LOCK_INIT(rnh); - if (off == 0) /* See above */ - return 1; /* only do the rest for the real thing */ - rnh->rnh_addaddr = in6_addroute; if (V__in6_rt_was_here == 0) { @@ -284,7 +277,7 @@ in6_inithead(void **head, int off) V__in6_rt_was_here = 1; } - return 1; + return (1); } #ifdef VIMAGE Modified: head/sys/sys/domain.h ============================================================================== --- head/sys/sys/domain.h Tue Nov 4 23:51:35 2014 (r274117) +++ head/sys/sys/domain.h Wed Nov 5 00:58:01 2014 (r274118) @@ -61,12 +61,6 @@ struct domain { int (*dom_rtdetach) /* clean up routing table */ (void **, int); int dom_rtoffset; /* an arg to rtattach, in bits */ - /* XXX MRT. - * rtoffset May be 0 if the domain supplies its own rtattach(), - * in which case, a 0 indicates it's being called from - * vfs_export.c (HACK) Only for AF_INET{,6} at this time. - * Temporary ABI compat hack.. fix post RELENG_7 - */ int dom_maxrtkey; /* for routing layer */ void *(*dom_ifattach)(struct ifnet *); void (*dom_ifdetach)(struct ifnet *, void *); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 01:01:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B94BB5E9; Wed, 5 Nov 2014 01:01:41 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7B594164; Wed, 5 Nov 2014 01:01:41 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 7E223A0F2; Wed, 5 Nov 2014 01:01:40 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8DDFF1116; Wed, 5 Nov 2014 02:01:38 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r274103 - head/sys/dev/random References: <201411042302.sA4N2K4X063860@svn.freebsd.org> <1415144289.1200.125.camel@revolution.hippie.lan> Date: Wed, 05 Nov 2014 02:01:38 +0100 In-Reply-To: <1415144289.1200.125.camel@revolution.hippie.lan> (Ian Lepore's message of "Tue, 04 Nov 2014 16:38:09 -0700") Message-ID: <86389ya2a5.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 01:01:41 -0000 Ian Lepore writes: > Dag-Erling Sm=C3=B8rgrav writes: > > +/* This implementation of Fortuna is based on the descriptions found in > > + * ISBN 0-471-22357-3 "Practical Cryptography" by Ferguson and Schneier > > + * ("K&S"). > I'm guessing s/b F&S. Uh, yes. Probably thinking of K&R :) Please feel free to fix. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 01:24:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AABD4AD8; Wed, 5 Nov 2014 01:24:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9696F391; Wed, 5 Nov 2014 01:24:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA51OjfW032483; Wed, 5 Nov 2014 01:24:45 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA51Ojof032482; Wed, 5 Nov 2014 01:24:45 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411050124.sA51Ojof032482@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 01:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274119 - head/usr.sbin/sysrc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 01:24:45 -0000 Author: dteske Date: Wed Nov 5 01:24:44 2014 New Revision: 274119 URL: https://svnweb.freebsd.org/changeset/base/274119 Log: Add EXAMPLES-section entry for new key+=append syntax of sysrc(8). MFC after: 3 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274068 Thanks to: @SeanChittenden Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Wed Nov 5 00:58:01 2014 (r274118) +++ head/usr.sbin/sysrc/sysrc.8 Wed Nov 5 01:24:44 2014 (r274119) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2014 +.Dd November 4, 2014 .Dt SYSRC 8 .Os .Sh NAME @@ -247,6 +247,12 @@ Working on other files, such as -f /etc/crontab MAILTO .Dl returns the value of the MAILTO setting Pq if configured . .Pp +Appending to existing values: +.Pp +.Nm +\&cloned_interfaces+=" gif0" +.Dl appends Qo \ gif0 Qc to $cloned_interfaces . +.Pp In addition to the above syntax, .Nm also supports inline From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 01:47:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAC98F90; Wed, 5 Nov 2014 01:47:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB7D87B3; Wed, 5 Nov 2014 01:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA51lQKc042187; Wed, 5 Nov 2014 01:47:26 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA51lQMj042182; Wed, 5 Nov 2014 01:47:26 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411050147.sA51lQMj042182@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 01:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274120 - in head: lib/libdpv usr.bin/dpv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 01:47:27 -0000 Author: dteske Date: Wed Nov 5 01:47:25 2014 New Revision: 274120 URL: https://svnweb.freebsd.org/changeset/base/274120 Log: Fix build-error (pointy hat; didn't merge full up-to-date code) MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 Modified: head/lib/libdpv/dialogrc.c head/lib/libdpv/dialogrc.h head/usr.bin/dpv/dpv.c Modified: head/lib/libdpv/dialogrc.c ============================================================================== --- head/lib/libdpv/dialogrc.c Wed Nov 5 01:24:44 2014 (r274119) +++ head/lib/libdpv/dialogrc.c Wed Nov 5 01:47:25 2014 (r274120) @@ -49,58 +49,58 @@ char gauge_color[STR_BUFSIZE] = "47b"; / char separator[STR_BUFSIZE] = ""; /* Function prototypes */ -static int setattr(struct config *, uint32_t, char *, char *); -static int setbool(struct config *, uint32_t, char *, char *); -static int setnum(struct config *, uint32_t, char *, char *); -static int setstr(struct config *, uint32_t, char *, char *); +static int setattr(struct fp_config *, uint32_t, char *, char *); +static int setbool(struct fp_config *, uint32_t, char *, char *); +static int setnum(struct fp_config *, uint32_t, char *, char *); +static int setstr(struct fp_config *, uint32_t, char *, char *); /* * Anatomy of DIALOGRC (~/.dialogrc by default) * NOTE: Must appear after private function prototypes (above) * NB: Brace-initialization of union requires cast to *first* member of union */ -static struct config dialogrc_config[] = { - /* TYPE Directive DEFAULT HANDLER */ - {TYPE_INT, "aspect", {(void *)0}, &setnum}, - {TYPE_STR, "separate_widget", {separator}, &setstr}, - {TYPE_INT, "tab_len", {(void *)0}, &setnum}, - {TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, - {TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, - {TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, - {TYPE_STR, "screen_color", {NULL}, &setattr}, - {TYPE_STR, "shadow_color", {NULL}, &setattr}, - {TYPE_STR, "dialog_color", {NULL}, &setattr}, - {TYPE_STR, "title_color", {NULL}, &setattr}, - {TYPE_STR, "border_color", {NULL}, &setattr}, - {TYPE_STR, "button_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "button_key_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "button_label_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_label_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "inputbox_color", {NULL}, &setattr}, - {TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, - {TYPE_STR, "position_indicator_color", {NULL}, &setattr}, - {TYPE_STR, "menubox_color", {NULL}, &setattr}, - {TYPE_STR, "menubox_border_color", {NULL}, &setattr}, - {TYPE_STR, "item_color", {NULL}, &setattr}, - {TYPE_STR, "item_selected_color", {NULL}, &setattr}, - {TYPE_STR, "tag_color", {NULL}, &setattr}, - {TYPE_STR, "tag_selected_color", {NULL}, &setattr}, - {TYPE_STR, "tag_key_color", {NULL}, &setattr}, - {TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, - {TYPE_STR, "check_color", {NULL}, &setattr}, - {TYPE_STR, "check_selected_color", {NULL}, &setattr}, - {TYPE_STR, "uarrow_color", {NULL}, &setattr}, - {TYPE_STR, "darrow_color", {NULL}, &setattr}, - {TYPE_STR, "itemhelp_color", {NULL}, &setattr}, - {TYPE_STR, "form_active_text_color", {NULL}, &setattr}, - {TYPE_STR, "form_text_color", {NULL}, &setattr}, - {TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, - {TYPE_STR, "gauge_color", {gauge_color}, &setattr}, +static struct fp_config dialogrc_config[] = { + /* TYPE Directive DEFAULT HANDLER */ + {FP_TYPE_INT, "aspect", {(void *)0}, &setnum}, + {FP_TYPE_STR, "separate_widget", {separator}, &setstr}, + {FP_TYPE_INT, "tab_len", {(void *)0}, &setnum}, + {FP_TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, + {FP_TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, + {FP_TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, + {FP_TYPE_STR, "screen_color", {NULL}, &setattr}, + {FP_TYPE_STR, "shadow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "dialog_color", {NULL}, &setattr}, + {FP_TYPE_STR, "title_color", {NULL}, &setattr}, + {FP_TYPE_STR, "border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_inactive_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_key_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_label_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_label_inactive_color",{NULL}, &setattr}, + {FP_TYPE_STR, "inputbox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "position_indicator_color", {NULL}, &setattr}, + {FP_TYPE_STR, "menubox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "menubox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "item_color", {NULL}, &setattr}, + {FP_TYPE_STR, "item_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_key_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "check_color", {NULL}, &setattr}, + {FP_TYPE_STR, "check_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "uarrow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "darrow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "itemhelp_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_active_text_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_text_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, + {FP_TYPE_STR, "gauge_color", {gauge_color}, &setattr}, {0, NULL, {0}, NULL} }; @@ -108,7 +108,7 @@ static struct config dialogrc_config[] = * figpar call-back for interpreting value as .dialogrc `Attribute' */ static int -setattr(struct config *option, uint32_t line __unused, +setattr(struct fp_config *option, uint32_t line __unused, char *directive __unused, char *value) { char *cp = value; @@ -204,7 +204,7 @@ write_attrbuf: * figpar call-back for interpreting value as .dialogrc `Boolean' */ static int -setbool(struct config *option, uint32_t line __unused, +setbool(struct fp_config *option, uint32_t line __unused, char *directive __unused, char *value) { @@ -227,8 +227,8 @@ setbool(struct config *option, uint32_t * figpar call-back for interpreting value as .dialogrc `Number' */ static int -setnum(struct config *option, uint32_t line __unused, char *directive __unused, - char *value) +setnum(struct fp_config *option, uint32_t line __unused, + char *directive __unused, char *value) { if (option == NULL) { @@ -247,8 +247,8 @@ setnum(struct config *option, uint32_t l * figpar call-back for interpreting value as .dialogrc `String' */ static int -setstr(struct config *option, uint32_t line __unused, char *directive __unused, - char *value) +setstr(struct fp_config *option, uint32_t line __unused, + char *directive __unused, char *value) { size_t len; @@ -315,7 +315,7 @@ parse_dialogrc(void) } /* Process file (either $DIALOGRC if set, or `$HOME/.dialogrc') */ - res = parse_config(dialogrc_config, path, NULL, BREAK_ON_EQUALS); + res = parse_config(dialogrc_config, path, NULL, FP_BREAK_ON_EQUALS); /* Set some globals based on what we parsed */ use_shadow = dialogrc_config_option("use_shadow")->value.boolean; @@ -328,10 +328,10 @@ parse_dialogrc(void) /* * Return a pointer to the `.dialogrc' config option specific to `directive' or - * static dummy_config (full of NULLs) if none found (see get_config_option(3); - * part of figpar(3)). + * static fp_dummy_config (full of NULLs) if none found (see + * get_config_option(3); part of figpar(3)). */ -struct config * +struct fp_config * dialogrc_config_option(const char *directive) { return (get_config_option(dialogrc_config, directive)); Modified: head/lib/libdpv/dialogrc.h ============================================================================== --- head/lib/libdpv/dialogrc.h Wed Nov 5 01:24:44 2014 (r274119) +++ head/lib/libdpv/dialogrc.h Wed Nov 5 01:47:25 2014 (r274120) @@ -48,9 +48,9 @@ extern char gauge_color[]; extern char separator[]; __BEGIN_DECLS -void dialogrc_free(void); -int parse_dialogrc(void); -struct config *dialogrc_config_option(const char *_directive); +void dialogrc_free(void); +int parse_dialogrc(void); +struct fp_config *dialogrc_config_option(const char *_directive); __END_DECLS #endif /* !_DIALOGRC_H_ */ Modified: head/usr.bin/dpv/dpv.c ============================================================================== --- head/usr.bin/dpv/dpv.c Wed Nov 5 01:24:44 2014 (r274119) +++ head/usr.bin/dpv/dpv.c Wed Nov 5 01:47:25 2014 (r274120) @@ -177,7 +177,7 @@ operate_on_bytes(struct dpv_file_node *f fsync(out); } - overall_read += r; + dpv_overall_read += r; file->read += r; /* Calculate percentage of completion (if possible) */ @@ -226,7 +226,7 @@ operate_on_lines(struct dpv_file_node *f /* Process the buffer for number of lines */ for (p = buf; p != NULL && *p != '\0';) if ((p = strchr(p, '\n')) != NULL) - overall_read++, p++, file->read++; + dpv_overall_read++, p++, file->read++; /* Calculate percentage of completion (if possible) */ if (file->length >= 0) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 01:57:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 425A6298; Wed, 5 Nov 2014 01:57:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8C38A9; Wed, 5 Nov 2014 01:57:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA51vX86046832; Wed, 5 Nov 2014 01:57:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA51vWWe046830; Wed, 5 Nov 2014 01:57:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411050157.sA51vWWe046830@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 01:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274121 - head/lib/libdpv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 01:57:33 -0000 Author: dteske Date: Wed Nov 5 01:57:32 2014 New Revision: 274121 URL: https://svnweb.freebsd.org/changeset/base/274121 Log: Make libdpv [dpv(3)] WARNS=6 clean for clang on -CURRENT. NB: aka unbreak the build Reviewed by: shurd MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 Modified: head/lib/libdpv/dialog_util.c head/lib/libdpv/dpv.c Modified: head/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Wed Nov 5 01:47:25 2014 (r274120) +++ head/lib/libdpv/dialog_util.c Wed Nov 5 01:57:32 2014 (r274121) @@ -62,7 +62,7 @@ char *title = NULL; char *backtitle = NULL; int dheight = 0; int dwidth = 0; -char *dargv[64] = { NULL }; +static char *dargv[64] = { NULL }; /* TTY/Screen characteristics */ static struct winsize *maxsize = NULL; Modified: head/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Wed Nov 5 01:47:25 2014 (r274120) +++ head/lib/libdpv/dpv.c Wed Nov 5 01:57:32 2014 (r274121) @@ -77,8 +77,8 @@ char *msg_pending = NULL; /* dpv_config. char *pprompt = NULL; /* dpv_config.pprompt */ /* Status-Line format for when using dialog(3) */ -const char *status_format_custom = NULL; -char status_format_default[DPV_STATUS_FORMAT_MAX]; +static const char *status_format_custom = NULL; +static char status_format_default[DPV_STATUS_FORMAT_MAX]; /* * Takes a pointer to a dpv_config structure containing layout details and From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:08:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D33CC7BA; Wed, 5 Nov 2014 02:08:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A70679B0; Wed, 5 Nov 2014 02:08:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA528chb051740; Wed, 5 Nov 2014 02:08:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA528cPs051738; Wed, 5 Nov 2014 02:08:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411050208.sA528cPs051738@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Nov 2014 02:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274122 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 02:08:38 -0000 Author: mjg Date: Wed Nov 5 02:08:37 2014 New Revision: 274122 URL: https://svnweb.freebsd.org/changeset/base/274122 Log: Extend struct ucred with group table. This saves one malloc + free with typical cases and better utilizes memory. Submitted by: Tiwei Bie (slightly modified) X-Additional: JuniorJobs project Modified: head/sys/kern/kern_prot.c head/sys/sys/ucred.h Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Wed Nov 5 01:57:32 2014 (r274121) +++ head/sys/kern/kern_prot.c Wed Nov 5 02:08:37 2014 (r274122) @@ -1817,7 +1817,9 @@ crget(void) #ifdef MAC mac_cred_init(cr); #endif - crextend(cr, XU_NGROUPS); + cr->cr_groups = cr->cr_smallgroups; + cr->cr_agroups = + sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]); return (cr); } @@ -1864,7 +1866,8 @@ crfree(struct ucred *cr) #ifdef MAC mac_cred_destroy(cr); #endif - free(cr->cr_groups, M_CRED); + if (cr->cr_groups != cr->cr_smallgroups) + free(cr->cr_groups, M_CRED); free(cr, M_CRED); } } @@ -1997,7 +2000,7 @@ crextend(struct ucred *cr, int n) cnt = roundup2(n, PAGE_SIZE / sizeof(gid_t)); /* Free the old array. */ - if (cr->cr_groups) + if (cr->cr_groups != cr->cr_smallgroups) free(cr->cr_groups, M_CRED); cr->cr_groups = malloc(cnt * sizeof(gid_t), M_CRED, M_WAITOK | M_ZERO); Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Wed Nov 5 01:57:32 2014 (r274121) +++ head/sys/sys/ucred.h Wed Nov 5 02:08:37 2014 (r274122) @@ -37,6 +37,8 @@ struct loginclass; +#define XU_NGROUPS 16 + /* * Credentials. * @@ -64,13 +66,12 @@ struct ucred { struct auditinfo_addr cr_audit; /* Audit properties. */ gid_t *cr_groups; /* groups */ int cr_agroups; /* Available groups */ + gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ }; #define NOCRED ((struct ucred *)0) /* no credential available */ #define FSCRED ((struct ucred *)-1) /* filesystem credential */ #endif /* _KERNEL || _WANT_UCRED */ -#define XU_NGROUPS 16 - /* * Flags for cr_flags. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:11:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44AA8940; Wed, 5 Nov 2014 02:11:48 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 899BFA4E; Wed, 5 Nov 2014 02:11:47 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi2so715121wib.7 for ; Tue, 04 Nov 2014 18:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UNw7HlnAEmvoqMW6FztZOIm4ckTOwbolW7nEtdUG5OQ=; b=Q2xmOByo/hhgX/O0qJTBAUTjG23L3GNd0KgxAAxyH1vWvqcETzNXm9r5Cpx0aE4Ous 389m5XYHhrkLct4YpqUQ17e+fP5kAGzz/+fsDRum0cdmwTO+6q0vNuYs4jOFR1HaeiyQ dWPJEEGuJjtfK7O6O3qJa/ZYKOAg+BGvD+qPNmCdhIcxygDYV8bawNA+QXHf/jaj+WRh 2nR25xpq/Gs9/7dOIYoJ9s+b/AaT5CwuHr5/+XDg4CtN71rcNXPze0xwHL856uE23p41 F0JP/zd2wFe4QOECV3T/4djXi0kyRRwsRik3Yt5KCKXqiCnx9/6PNPWj6MCrdytRl5IA 8A+Q== X-Received: by 10.180.93.233 with SMTP id cx9mr2023747wib.48.1415153505780; Tue, 04 Nov 2014 18:11:45 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id m6sm2876126wiy.16.2014.11.04.18.11.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 18:11:45 -0800 (PST) Date: Wed, 5 Nov 2014 03:11:42 +0100 From: Mateusz Guzik To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274122 - in head/sys: kern sys Message-ID: <20141105021142.GB21297@dft-labs.eu> References: <201411050208.sA528cPs051738@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201411050208.sA528cPs051738@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 02:11:48 -0000 On Wed, Nov 05, 2014 at 02:08:38AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Nov 5 02:08:37 2014 > New Revision: 274122 > URL: https://svnweb.freebsd.org/changeset/base/274122 > > Log: > Extend struct ucred with group table. > > This saves one malloc + free with typical cases and better utilizes > memory. > > @@ -64,13 +66,12 @@ struct ucred { > struct auditinfo_addr cr_audit; /* Audit properties. */ > gid_t *cr_groups; /* groups */ > int cr_agroups; /* Available groups */ > + gid_t cr_smallgroups[XU_NGROUPS]; /* storage for small groups */ > }; This struct ate 160 bytes on e.g. amd64, so was using a 256 byte buffer anyway and previously separately allocated groups fit there no problem. On 32-bit systems struct was smaller and e.g. on i386 it was only 120 bytes, so for such systems this change increases memory usage a little. If someone really does not like it I'm happy to ifdef the code. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:36:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C60AFE14; Wed, 5 Nov 2014 02:36:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1DDCC53; Wed, 5 Nov 2014 02:36:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA52aTrt065525; Wed, 5 Nov 2014 02:36:29 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA52aTXM065523; Wed, 5 Nov 2014 02:36:29 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411050236.sA52aTXM065523@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 02:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274123 - in head: lib/libdpv usr.bin/dpv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 02:36:29 -0000 Author: dteske Date: Wed Nov 5 02:36:28 2014 New Revision: 274123 URL: https://svnweb.freebsd.org/changeset/base/274123 Log: Fix buildworld by adding DPADD= to libdpv [dpv(3)] Makefile NB: Should also address `make -j' building Remove "+" from "+=" in assignments to DPADD/LDADD while here. NB: Also move CFLAGS for style measure. Reviewed by: shurd MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 274121 Modified: head/lib/libdpv/Makefile head/usr.bin/dpv/Makefile Modified: head/lib/libdpv/Makefile ============================================================================== --- head/lib/libdpv/Makefile Wed Nov 5 02:08:37 2014 (r274122) +++ head/lib/libdpv/Makefile Wed Nov 5 02:36:28 2014 (r274123) @@ -6,11 +6,13 @@ INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 -CFLAGS+= -I${.CURDIR} -LDFLAGS+= -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBFIGPAR} +LDADD= -ldialog -lfigpar -lncurses -lutil SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c +CFLAGS+= -I${.CURDIR} + WARNS?= 6 .include Modified: head/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Wed Nov 5 02:08:37 2014 (r274122) +++ head/usr.bin/dpv/Makefile Wed Nov 5 02:36:28 2014 (r274123) @@ -4,8 +4,8 @@ PROG= dpv CFLAGS+= -I${.CURDIR} -DPADD+= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSES} ${LIBUTIL} -LDADD+= -ldpv -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSES} ${LIBUTIL} +LDADD= -ldpv -ldialog -lfigpar -lncurses -lutil WARNS?= 6 From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 02:58:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34297231; Wed, 5 Nov 2014 02:58:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20608E23; Wed, 5 Nov 2014 02:58:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA52w2GD074922; Wed, 5 Nov 2014 02:58:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA52w29N074919; Wed, 5 Nov 2014 02:58:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411050258.sA52w29N074919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 02:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274124 - in head: lib usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 02:58:03 -0000 Author: dteske Date: Wed Nov 5 02:58:02 2014 New Revision: 274124 URL: https://svnweb.freebsd.org/changeset/base/274124 Log: Temporarily _disable_ compilation of dpv(3) and dpv(1). Will revisit this to find out how to solve the ordering issue in buildworld (potentially `make -j' specific). Reviewed by: shurd Modified: head/lib/Makefile head/usr.bin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Nov 5 02:36:28 2014 (r274123) +++ head/lib/Makefile Wed Nov 5 02:58:02 2014 (r274124) @@ -42,7 +42,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ libcrypt \ libdevinfo \ libdevstat \ - libdpv \ libdwarf \ libedit \ ${_libevent} \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Wed Nov 5 02:36:28 2014 (r274123) +++ head/usr.bin/Makefile Wed Nov 5 02:58:02 2014 (r274124) @@ -36,7 +36,6 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ - dpv \ du \ ee \ elf2aout \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 03:47:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A815A927; Wed, 5 Nov 2014 03:47:10 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B13F649; Wed, 5 Nov 2014 03:47:09 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XlrYq-000Odh-Ci; Wed, 05 Nov 2014 03:47:08 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA53l7M1003507; Tue, 4 Nov 2014 20:47:07 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19KahUWVo/Nrf1AeqzgAg3l X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274124 - in head: lib usr.bin From: Ian Lepore To: Devin Teske In-Reply-To: <201411050258.sA52w29N074919@svn.freebsd.org> References: <201411050258.sA52w29N074919@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 04 Nov 2014 20:47:07 -0700 Message-ID: <1415159227.1200.130.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 03:47:10 -0000 On Wed, 2014-11-05 at 02:58 +0000, Devin Teske wrote: > Author: dteske > Date: Wed Nov 5 02:58:02 2014 > New Revision: 274124 > URL: https://svnweb.freebsd.org/changeset/base/274124 > > Log: > Temporarily _disable_ compilation of dpv(3) and dpv(1). > Will revisit this to find out how to solve the ordering > issue in buildworld (potentially `make -j' specific). > I think you probably just need to add a subdir order dependency. See the comment around line 120 in lib/Makefile. (Hmm, maybe that comment should be easier to notice, somewhere near the top of the file.) -- Ian > Reviewed by: shurd > > Modified: > head/lib/Makefile > head/usr.bin/Makefile > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Wed Nov 5 02:36:28 2014 (r274123) > +++ head/lib/Makefile Wed Nov 5 02:58:02 2014 (r274124) > @@ -42,7 +42,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ > libcrypt \ > libdevinfo \ > libdevstat \ > - libdpv \ > libdwarf \ > libedit \ > ${_libevent} \ > > Modified: head/usr.bin/Makefile > ============================================================================== > --- head/usr.bin/Makefile Wed Nov 5 02:36:28 2014 (r274123) > +++ head/usr.bin/Makefile Wed Nov 5 02:58:02 2014 (r274124) > @@ -36,7 +36,6 @@ SUBDIR= alias \ > ctlstat \ > cut \ > dirname \ > - dpv \ > du \ > ee \ > elf2aout \ > From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:02:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68353B23; Wed, 5 Nov 2014 04:02:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49E7F81B; Wed, 5 Nov 2014 04:02:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA542Qcf007681; Wed, 5 Nov 2014 04:02:26 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA542P9g007678; Wed, 5 Nov 2014 04:02:25 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411050402.sA542P9g007678@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 04:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274125 - head/usr.bin/wc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 04:02:26 -0000 Author: marcel Date: Wed Nov 5 04:02:25 2014 New Revision: 274125 URL: https://svnweb.freebsd.org/changeset/base/274125 Log: Convert to use libxo. Obtained from: Phil Shafer Sponsored by: Juniper Networks, Inc. Modified: head/usr.bin/wc/Makefile head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/Makefile ============================================================================== --- head/usr.bin/wc/Makefile Wed Nov 5 02:58:02 2014 (r274124) +++ head/usr.bin/wc/Makefile Wed Nov 5 04:02:25 2014 (r274125) @@ -2,4 +2,7 @@ # $FreeBSD$ PROG= wc +DPADD= ${LIBXO} +LDADD= -lxo + .include Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Wed Nov 5 02:58:02 2014 (r274124) +++ head/usr.bin/wc/wc.c Wed Nov 5 04:02:25 2014 (r274125) @@ -57,10 +57,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static uintmax_t tlinect, twordct, tcharct, tlongline; static int doline, doword, dochar, domulti, dolongline; static volatile sig_atomic_t siginfo; +static xo_handle_t *stderr_handle; static void show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, uintmax_t charct, uintmax_t llct); @@ -81,6 +83,10 @@ main(int argc, char *argv[]) (void) setlocale(LC_CTYPE, ""); + argc = xo_parse_args(argc, argv); + if (argc < 0) + return (argc); + while ((ch = getopt(argc, argv, "clmwL")) != -1) switch((char)ch) { case 'l': @@ -113,21 +119,35 @@ main(int argc, char *argv[]) if (doline + doword + dochar + domulti + dolongline == 0) doline = doword = dochar = 1; + stderr_handle = xo_create_to_file(stderr, XO_STYLE_TEXT, 0); + xo_open_container("wc"); + xo_open_list("file"); + errors = 0; total = 0; if (!*argv) { + xo_open_instance("file"); if (cnt((char *)NULL) != 0) ++errors; + xo_close_instance("file"); } else { do { + xo_open_instance("file"); if (cnt(*argv) != 0) ++errors; + xo_close_instance("file"); ++total; } while(*++argv); } - if (total > 1) + if (total > 1) { + xo_open_container("total"); show_cnt("total", tlinect, twordct, tcharct, tlongline); + xo_close_container("total"); + } + xo_close_list("file"); + xo_close_container("wc"); + xo_finish(); exit(errors == 0 ? 0 : 1); } @@ -135,27 +155,29 @@ static void show_cnt(const char *file, uintmax_t linect, uintmax_t wordct, uintmax_t charct, uintmax_t llct) { - FILE *out; + xo_handle_t *xop; if (!siginfo) - out = stdout; + xop = NULL; else { - out = stderr; + xop = stderr_handle; siginfo = 0; } + xo_emit("{ek:filename/%s}", file); + if (doline) - (void)fprintf(out, " %7ju", linect); + xo_emit_h(xop, " {:lines/%7ju/%ju}", linect); if (doword) - (void)fprintf(out, " %7ju", wordct); + xo_emit_h(xop, " {:words/%7ju/%ju}", wordct); if (dochar || domulti) - (void)fprintf(out, " %7ju", charct); + xo_emit_h(xop, " {:characters/%7ju/%ju}", charct); if (dolongline) - (void)fprintf(out, " %7ju", llct); + xo_emit_h(xop, " {:long-lines/%7ju/%ju}", llct); if (file != NULL) - (void)fprintf(out, " %s\n", file); + xo_emit_h(xop, " {d:filename/%s}\n", file); else - (void)fprintf(out, "\n"); + xo_emit_h(xop, "\n"); } static int @@ -176,7 +198,7 @@ cnt(const char *file) fd = STDIN_FILENO; else { if ((fd = open(file, O_RDONLY, 0)) < 0) { - warn("%s: open", file); + xo_warn("%s: open", file); return (1); } if (doword || (domulti && MB_CUR_MAX != 1)) @@ -189,7 +211,7 @@ cnt(const char *file) if (doline) { while ((len = read(fd, buf, MAXBSIZE))) { if (len == -1) { - warn("%s: read", file); + xo_warn("%s: read", file); (void)close(fd); return (1); } @@ -224,7 +246,7 @@ cnt(const char *file) */ if (dochar || domulti) { if (fstat(fd, &sb)) { - warn("%s: fstat", file); + xo_warn("%s: fstat", file); (void)close(fd); return (1); } @@ -244,7 +266,7 @@ word: gotsp = 1; memset(&mbs, 0, sizeof(mbs)); while ((len = read(fd, buf, MAXBSIZE)) != 0) { if (len == -1) { - warn("%s: read", file != NULL ? file : "stdin"); + xo_warn("%s: read", file != NULL ? file : "stdin"); (void)close(fd); return (1); } @@ -259,7 +281,7 @@ word: gotsp = 1; (size_t)-1) { if (!warned) { errno = EILSEQ; - warn("%s", + xo_warn("%s", file != NULL ? file : "stdin"); warned = 1; } @@ -291,7 +313,7 @@ word: gotsp = 1; } if (domulti && MB_CUR_MAX > 1) if (mbrtowc(NULL, NULL, 0, &mbs) == (size_t)-1 && !warned) - warn("%s", file != NULL ? file : "stdin"); + xo_warn("%s", file != NULL ? file : "stdin"); if (doline) tlinect += linect; if (doword) @@ -310,6 +332,6 @@ word: gotsp = 1; static void usage(void) { - (void)fprintf(stderr, "usage: wc [-Lclmw] [file ...]\n"); + xo_error("usage: wc [-Lclmw] [file ...]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:09:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A585ECBA; Wed, 5 Nov 2014 04:09:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBF0855; Wed, 5 Nov 2014 04:09:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA549BjL008554; Wed, 5 Nov 2014 04:09:11 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA549BXS008553; Wed, 5 Nov 2014 04:09:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411050409.sA549BXS008553@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 04:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274126 - head/usr.bin/wc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 04:09:11 -0000 Author: marcel Date: Wed Nov 5 04:09:10 2014 New Revision: 274126 URL: https://svnweb.freebsd.org/changeset/base/274126 Log: Document that wc(1) supports libxo(3). Modified: head/usr.bin/wc/wc.1 Modified: head/usr.bin/wc/wc.1 ============================================================================== --- head/usr.bin/wc/wc.1 Wed Nov 5 04:02:25 2014 (r274125) +++ head/usr.bin/wc/wc.1 Wed Nov 5 04:09:10 2014 (r274126) @@ -31,7 +31,7 @@ .\" @(#)wc.1 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 6, 2008 +.Dd November 4, 2014 .Dt WC 1 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd word, line, character, and byte count .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl Lclmw .Op Ar .Sh DESCRIPTION @@ -175,6 +176,8 @@ option of the GNU utility. .Sh SEE ALSO .Xr iswspace 3 +.Xr libxo 3 +.Xr xo_parse_args 3 .Sh STANDARDS The .Nm From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:18:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CDB1E72; Wed, 5 Nov 2014 04:18:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48CCC915; Wed, 5 Nov 2014 04:18:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA54IgbB013134; Wed, 5 Nov 2014 04:18:42 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA54Igtr013133; Wed, 5 Nov 2014 04:18:42 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411050418.sA54Igtr013133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 04:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274127 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 04:18:42 -0000 Author: marcel Date: Wed Nov 5 04:18:41 2014 New Revision: 274127 URL: https://svnweb.freebsd.org/changeset/base/274127 Log: In alloc_pread() and kern_pread(), print errors only when DEBUG is defined. An error is not fatal and is supposed to be handled by the caller. Obtained from: Juniper Networks, Inc. Modified: head/sys/boot/common/misc.c Modified: head/sys/boot/common/misc.c ============================================================================== --- head/sys/boot/common/misc.c Wed Nov 5 04:09:10 2014 (r274126) +++ head/sys/boot/common/misc.c Wed Nov 5 04:18:41 2014 (r274127) @@ -121,12 +121,16 @@ kern_pread(int fd, vm_offset_t dest, siz ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { +#ifdef DEBUG printf("\nlseek failed\n"); +#endif return (-1); } nread = archsw.arch_readin(fd, dest, len); if (nread != len) { +#ifdef DEBUG printf("\nreadin failed\n"); +#endif return (-1); } return (0); @@ -144,17 +148,23 @@ alloc_pread(int fd, off_t off, size_t le buf = malloc(len); if (buf == NULL) { +#ifdef DEBUG printf("\nmalloc(%d) failed\n", (int)len); +#endif return (NULL); } if (lseek(fd, off, SEEK_SET) == -1) { +#ifdef DEBUG printf("\nlseek failed\n"); +#endif free(buf); return (NULL); } nread = read(fd, buf, len); if (nread != len) { +#ifdef DEBUG printf("\nread failed\n"); +#endif free(buf); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 04:25:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39850139; Wed, 5 Nov 2014 04:25:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2513A9DB; Wed, 5 Nov 2014 04:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA54POWD017434; Wed, 5 Nov 2014 04:25:24 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA54POK7017433; Wed, 5 Nov 2014 04:25:24 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201411050425.sA54POK7017433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Wed, 5 Nov 2014 04:25: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: r274128 - stable/10/etc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 04:25:24 -0000 Author: wblock (doc committer) Date: Wed Nov 5 04:25:23 2014 New Revision: 274128 URL: https://svnweb.freebsd.org/changeset/base/274128 Log: MFC r273985: Add the less-ambiguous freebsd-version command. Modified: stable/10/etc/motd Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/motd ============================================================================== --- stable/10/etc/motd Wed Nov 5 04:18:41 2014 (r274127) +++ stable/10/etc/motd Wed Nov 5 04:25:23 2014 (r274128) @@ -13,7 +13,7 @@ Documents installed with the system are directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. -Show the version of FreeBSD installed: uname -a +Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 05:49:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7483FC6E; Wed, 5 Nov 2014 05:49:48 +0000 (UTC) Received: from mail-pd0-x235.google.com (mail-pd0-x235.google.com [IPv6:2607:f8b0:400e:c02::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3527BED; Wed, 5 Nov 2014 05:49:48 +0000 (UTC) Received: by mail-pd0-f181.google.com with SMTP id y10so79086pdj.12 for ; Tue, 04 Nov 2014 21:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=JQQ8Ap6VN+Zm5yb9xlNmselIG54280PUjC13s7xTcvk=; b=hNOCrxLyn3mEnq4cmKP3Bor3L7MzL8Yu0lH1EfcXLqGXkhTqfTx2a4ZB4KhNqR8lq8 0df1Es8Z4r7wjeY5XW04QYBm69x9oXSYtqWKgKxY0bOyrSz7DklfEKFHnJQylnK67KRi T7LKBkaIE6AGiUAAEt54QHstk+fRqPCm0T1xyQntG3P2t3DsBzCUCNeydH553n/8dgCm 1byrgI6DANJ8/MczCjwZOV1tfCxvvm/MmhyDF+eTo8j/6x/hSBiLsZLZ47I3eRsAo22v K+ISl6KxMYqmldVC+TkFFjfx1mUkyNzk2S0fviFh+/z+qar2HFA0NaQ0QWefMNraHa2N xCcw== X-Received: by 10.68.255.195 with SMTP id as3mr55917935pbd.38.1415166587859; Tue, 04 Nov 2014 21:49:47 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:a5f2:d04a:984a:91? ([2601:8:ab80:7d6:a5f2:d04a:984a:91]) by mx.google.com with ESMTPSA id yw3sm1935202pbc.88.2014.11.04.21.49.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 21:49:47 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_3E2016B4-F24B-441C-9263-8C5CF84EAEF1"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274123 - in head: lib/libdpv usr.bin/dpv From: Garrett Cooper In-Reply-To: <201411050236.sA52aTXM065523@svn.freebsd.org> Date: Tue, 4 Nov 2014 21:49:45 -0800 Message-Id: <7E81392D-83F7-460F-8461-3F4028DFE88C@gmail.com> References: <201411050236.sA52aTXM065523@svn.freebsd.org> To: Devin Teske X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 05:49:48 -0000 --Apple-Mail=_3E2016B4-F24B-441C-9263-8C5CF84EAEF1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 4, 2014, at 18:36, Devin Teske wrote: > Author: dteske > Date: Wed Nov 5 02:36:28 2014 > New Revision: 274123 > URL: https://svnweb.freebsd.org/changeset/base/274123 =85 > Modified: head/lib/libdpv/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libdpv/Makefile Wed Nov 5 02:08:37 2014 = (r274122) > +++ head/lib/libdpv/Makefile Wed Nov 5 02:36:28 2014 = (r274123) > @@ -6,11 +6,13 @@ INCS=3D dpv.h > MAN=3D dpv.3 > MLINKS=3D dpv.3 dpv_free.3 >=20 > -CFLAGS+=3D -I${.CURDIR} > -LDFLAGS+=3D -ldialog -lfigpar -lncurses -lutil > +DPADD=3D ${LIBFIGPAR} > +LDADD=3D -ldialog -lfigpar -lncurses -lutil DPADD and LDADD are out of synch now; it should be: DPADD=3D ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} LDADD=3D -ldialog -lfigpar -lncursesw -lutil Please note that I used -lncursesw instead of -lncurses =97 please = verify whether or not it works (should because stuff is hard linked, but = it doesn=92t hurt to check=85). --Apple-Mail=_3E2016B4-F24B-441C-9263-8C5CF84EAEF1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUWbp5AAoJEMZr5QU6S73ejSQH+wSFykAv5UCUpAJfxE8cpmdI 2m1AGf354oKncxTuEMkPb65LHJZt4T0QjwwuXEljFC+k7NiWwqwR4bPiShOFSVtm 7bu8zT40j+LH0CwofeDYqjIYBisNZfOzTu5kB9UMnqouWjN79Gg3WgDzFPq7T1vu 7Vx0+8eNkcEAVyPZF6Vi73yvvWdsPKJ9V9/tAopQ1GF2w7g2MhITaHRLSkL3kPVm jG6EvvcspaTNtgIQnc+4Yrt9Aq1LBN/JKLqpJKVyL3L7HyNjveYvg3C1NHqr5f7d M+K0P3Q/gsoHJh6R5eSOmDJ9ERoqQSQAktYWZoDevubMiibPPmaReCVHmK2tjsw= =/UvL -----END PGP SIGNATURE----- --Apple-Mail=_3E2016B4-F24B-441C-9263-8C5CF84EAEF1-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 05:55:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06DA6E60; Wed, 5 Nov 2014 05:55:10 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 264411B9; Wed, 5 Nov 2014 05:55:09 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id d1so987830wiv.3 for ; Tue, 04 Nov 2014 21:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6vQIerk0Akk1olXF0rD1jJCaozWwyiMSwL5xRRMll3k=; b=koSIFdTFiHgHojLzfPwkra39GiYm5e1Mv1wVW8n1blhoFhB37CY2UdafKTV7zOW5QZ B9PAf3V2QeGob4gDigutzKUzfTbbBsc88T5F2dNuYB1D+Sm8jT8KVLbWUvsHSkNCM4pB hkbAvYSE67fywZCTzikwGHjexlUAGT6uxzBYmipLbLf6JOssVNnEhgRmMgigofZSanMK Kry2hpaH7/h1bHjBAHx/SQKQDVWcWCNuyzzAQyec8GVSK0hVu5rnVolqWzflGLPWVHam vM84CxtcpHt+4zFwngZbAPJoKrK4+wyAffY6bwpR4YrjuHIEe2+68tllKfVB32w9EmXh AK9Q== MIME-Version: 1.0 X-Received: by 10.180.83.98 with SMTP id p2mr29058089wiy.20.1415166907476; Tue, 04 Nov 2014 21:55:07 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 4 Nov 2014 21:55:07 -0800 (PST) In-Reply-To: <201410291921.s9TJLKpg005878@svn.freebsd.org> References: <201410291921.s9TJLKpg005878@svn.freebsd.org> Date: Tue, 4 Nov 2014 21:55:07 -0800 X-Google-Sender-Auth: oKRXzByMudN-nFKBdfX_ngDiubM Message-ID: Subject: Re: svn commit: r273835 - head/usr.bin/top From: Adrian Chadd To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 05:55:10 -0000 Hah, great catch! Thanks! -adrian On 29 October 2014 12:21, Jung-uk Kim wrote: > Author: jkim > Date: Wed Oct 29 19:21:19 2014 > New Revision: 273835 > URL: https://svnweb.freebsd.org/changeset/base/273835 > > Log: > Replace a magic number with the proper definition. This change actually > fixes broken state field after r273266, i.e., "CPU-1" was displayed in place > of "RUN". > > Modified: > head/usr.bin/top/machine.c > > Modified: head/usr.bin/top/machine.c > ============================================================================== > --- head/usr.bin/top/machine.c Wed Oct 29 18:01:09 2014 (r273834) > +++ head/usr.bin/top/machine.c Wed Oct 29 19:21:19 2014 (r273835) > @@ -941,7 +941,7 @@ format_next_process(caddr_t handle, char > /* generate "STATE" field */ > switch (state = pp->ki_stat) { > case SRUN: > - if (smpmode && pp->ki_oncpu != 0xff) > + if (smpmode && pp->ki_oncpu != NOCPU) > sprintf(status, "CPU%d", pp->ki_oncpu); > else > strcpy(status, "RUN"); > @@ -1100,7 +1100,7 @@ format_next_process(caddr_t handle, char > > /* format this entry */ > if (smpmode) { > - if (state == SRUN && pp->ki_oncpu != 0xff) > + if (state == SRUN && pp->ki_oncpu != NOCPU) > cpu = pp->ki_oncpu; > else > cpu = pp->ki_lastcpu; > From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 06:22:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3750C25D; Wed, 5 Nov 2014 06:22:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23FB1669; Wed, 5 Nov 2014 06:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA56Mc8Z072359; Wed, 5 Nov 2014 06:22:38 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA56MbCe072358; Wed, 5 Nov 2014 06:22:37 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201411050622.sA56MbCe072358@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Wed, 5 Nov 2014 06:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274129 - head/sys/amd64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 06:22:38 -0000 Author: gnn Date: Wed Nov 5 06:22:37 2014 New Revision: 274129 URL: https://svnweb.freebsd.org/changeset/base/274129 Log: Add support for netmap in GENERIC by default. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Nov 5 04:25:23 2014 (r274128) +++ head/sys/amd64/conf/GENERIC Wed Nov 5 06:22:37 2014 (r274129) @@ -361,3 +361,7 @@ device xenpci # Xen HVM Hypervisor se # VMware support device vmx # VMware VMXNET3 Ethernet + +# Netmap provides direct access to TX/RX rings on supported NICs +device netmap # netmap(4) support + From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 06:42:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14AFB61E; Wed, 5 Nov 2014 06:42:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01634881; Wed, 5 Nov 2014 06:42:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA56g7hh081396; Wed, 5 Nov 2014 06:42:07 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA56g7mE081395; Wed, 5 Nov 2014 06:42:07 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411050642.sA56g7mE081395@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Nov 2014 06:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274130 - head/etc/periodic/security 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 06:42:08 -0000 Author: bapt Date: Wed Nov 5 06:42:07 2014 New Revision: 274130 URL: https://svnweb.freebsd.org/changeset/base/274130 Log: Avoid installing security.functions with executable bits, periodic(8) will try to execute all files with an executable bit in /etc/periodic/*/ while this file is supposed only to be sourced by others MFC after: 1 week Modified: head/etc/periodic/security/Makefile Modified: head/etc/periodic/security/Makefile ============================================================================== --- head/etc/periodic/security/Makefile Wed Nov 5 06:22:37 2014 (r274129) +++ head/etc/periodic/security/Makefile Wed Nov 5 06:42:07 2014 (r274130) @@ -2,6 +2,8 @@ .include +FILESGROUPS= FILES DATA + FILES= 100.chksetuid \ 110.neggrpperm \ 200.chkmounts \ @@ -10,8 +12,8 @@ FILES= 100.chksetuid \ 410.logincheck \ 700.kernelmsg \ 800.loginfail \ - 900.tcpwrap \ - security.functions + 900.tcpwrap +DATA= security.functions # NB: keep these sorted by MK_* knobs From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 06:52:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 785E08DE; Wed, 5 Nov 2014 06:52:14 +0000 (UTC) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB8796B; Wed, 5 Nov 2014 06:52:13 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id d1so1073707wiv.3 for ; Tue, 04 Nov 2014 22:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=wI0LFfNvC7jbO8Ds5SAk96ZUPRWn2DIVUM5+EkKv/88=; b=sNGocHlpJ1PZ3tNc4b/POyAPGeyOGXiwatPv4vKoByxBiMlUz+oYNCdVPtPoMrm9VL HQfTpcanIJCs8AAFr2vasSO3UYpb/sSF+3X0EKizu1IBPjm8pM1GhR/aLEz866wmxJB/ LEI1E7A2vNfihKrWPzOC+zLPZIa7Ftr8zPvJu2ZSb2EMZDD0pQbnKFVJEfFp6gtQkw5v FPJnhcWZaLcnk8HlEyy3kkdzhSTwqJ3J/qCANVpzRc64S9JUQLp3uSemwENNH242bgM2 GHl4fu01mArIVCGonhwJc49XqAvuvCg0uDlO6LVO/2axZNW9VRl3GGs8nCFz9X8iZ5Ba y/BA== MIME-Version: 1.0 X-Received: by 10.180.87.33 with SMTP id u1mr3354585wiz.20.1415170331977; Tue, 04 Nov 2014 22:52:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 4 Nov 2014 22:52:11 -0800 (PST) In-Reply-To: <201411041129.sA4BTnwX030600@svn.freebsd.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> Date: Tue, 4 Nov 2014 22:52:11 -0800 X-Google-Sender-Auth: zNo0qKk5OpzWm-Q5xC5oxtSCP3M Message-ID: Subject: Re: svn commit: r274088 - head/sys/kern From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 06:52:14 -0000 ... why not just use UMA? -adrian On 4 November 2014 03:29, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Nov 4 11:29:49 2014 > New Revision: 274088 > URL: https://svnweb.freebsd.org/changeset/base/274088 > > Log: > Simplify logic a bit. Ensure data buffer is properly aligned, > especially for platforms where unaligned access is not allowed. Make > it possible to override the small buffer size. > > A simple continuous read string test using libusb showed a reduction > in CPU usage from roughly 10% to less than 1% using a dual-core GHz > CPU, when the malloc() operation was skipped for small buffers. > > MFC after: 2 weeks > > Modified: > head/sys/kern/sys_generic.c > > Modified: head/sys/kern/sys_generic.c > ============================================================================== > --- head/sys/kern/sys_generic.c Tue Nov 4 10:25:52 2014 (r274087) > +++ head/sys/kern/sys_generic.c Tue Nov 4 11:29:49 2014 (r274088) > @@ -646,10 +646,13 @@ struct ioctl_args { > int > sys_ioctl(struct thread *td, struct ioctl_args *uap) > { > +#ifndef SYS_IOCTL_SMALL_SIZE > +#define SYS_IOCTL_SMALL_SIZE 128 > +#endif > + u_char smalldata[SYS_IOCTL_SMALL_SIZE] __aligned(8); > u_long com; > int arg, error; > u_int size; > - u_char smalldata[128]; > caddr_t data; > > if (uap->com > 0xffffffff) { > @@ -682,10 +685,10 @@ sys_ioctl(struct thread *td, struct ioct > data = (void *)&arg; > size = 0; > } else { > - if (size <= sizeof(smalldata)) > - data = smalldata; > - else > + if (size > SYS_IOCTL_SMALL_SIZE) > data = malloc((u_long)size, M_IOCTLOPS, M_WAITOK); > + else > + data = smalldata; > } > } else > data = (void *)&uap->data; > @@ -707,7 +710,7 @@ sys_ioctl(struct thread *td, struct ioct > error = copyout(data, uap->data, (u_int)size); > > out: > - if (size > 0 && data != (caddr_t)&smalldata) > + if (size > SYS_IOCTL_SMALL_SIZE) > free(data, M_IOCTLOPS); > return (error); > } > From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 07:22:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 344441B6; Wed, 5 Nov 2014 07:22:40 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA95AC72; Wed, 5 Nov 2014 07:22:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id F20C51FE022; Wed, 5 Nov 2014 08:22:37 +0100 (CET) Message-ID: <5459D04A.1080204@selasky.org> Date: Wed, 05 Nov 2014 08:22:50 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Alexey Dokuchaev Subject: Re: svn commit: r272820 - head/etc/devd References: <201410091358.s99DwKA2097240@svn.freebsd.org> <20141104233123.GA7135@FreeBSD.org> In-Reply-To: <20141104233123.GA7135@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 07:22:40 -0000 On 11/05/14 00:31, Alexey Dokuchaev wrote: > On Thu, Oct 09, 2014 at 01:58:20PM +0000, Hans Petter Selasky wrote: >> New Revision: 272820 >> URL: https://svnweb.freebsd.org/changeset/base/272820 >> >> Log: >> Add example devd configuration file for USB printers. >> >> +# Generic USB printer devices >> +#notify 100 { >> +# match "system" "USB"; >> +# match "subsystem" "INTERFACE"; >> +# match "type" "ATTACH"; >> +# match "intclass" "0x07"; >> +# match "intsubclass" "0x01"; >> +# match "intprotocol" "(0x01|0x02|0x03)"; >> +# action "chown root:wheel /dev/$cdev"; > > Calling chown(8) looks weird for two reasons: 1) root:wheel arguably should > already be the default, and 2) device node credentials and permissions are > usually set via devfs.rules(5). > > ./danfe > > Hi, This file is just an example and bandaid for those that want to integrate USB printers with cups. For real use you would need to substitute root:wheel with cups:cups or something like that. We possibly need a printer class, maybe just create cups:cups from the start? --HPS From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:23:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E399C5D1; Wed, 5 Nov 2014 09:23:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE3D0AB2; Wed, 5 Nov 2014 09:23:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA59NVsf055678; Wed, 5 Nov 2014 09:23:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA59NTjY055666; Wed, 5 Nov 2014 09:23:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411050923.sA59NTjY055666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Nov 2014 09:23:29 +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: r274132 - in stable/10/sys: netinet6 netipsec 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 09:23:32 -0000 Author: ae Date: Wed Nov 5 09:23:29 2014 New Revision: 274132 URL: https://svnweb.freebsd.org/changeset/base/274132 Log: MFC r266800 by vanhu: IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels. For IPv6-in-IPv4, you may need to do the following command on the tunnel interface if it is configured as IPv4 only: ifconfig inet6 -ifdisabled Code logic inspired from NetBSD. PR: kern/169438 MC r266822 by bz: Use IPv4 statistics in ipsec4_process_packet() rather than the IPv6 version. This also unbreaks the NOINET6 builds after r266800. MFC r268083 by zec: The assumption in ipsec4_process_packet() that the payload may be only IPv4 is wrong, so check the IP version before mangling the payload header. MFC r272394: Do not strip outer header when operating in transport mode. Instead requeue mbuf back to IPv4 protocol handler. If there is one extra IP-IP encapsulation, it will be handled with tunneling interface. And thus proper interface will be exposed into mbuf's rcvif. Also, tcpdump that listens on tunneling interface will see packets in both directions. PR: 194761 Modified: stable/10/sys/netinet6/ip6_forward.c stable/10/sys/netinet6/ip6_ipsec.c stable/10/sys/netinet6/ip6_ipsec.h stable/10/sys/netinet6/ip6_output.c stable/10/sys/netinet6/ip6_var.h stable/10/sys/netipsec/ipsec6.h stable/10/sys/netipsec/ipsec_input.c stable/10/sys/netipsec/ipsec_output.c stable/10/sys/netipsec/xform_ipip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_forward.c ============================================================================== --- stable/10/sys/netinet6/ip6_forward.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_forward.c Wed Nov 5 09:23:29 2014 (r274132) @@ -251,7 +251,6 @@ ip6_forward(struct mbuf *m, int srcrt) { struct ipsecrequest *isr = NULL; - struct ipsec_output_state state; /* * when the kernel forwards a packet, it is not proper to apply @@ -284,18 +283,27 @@ ip6_forward(struct mbuf *m, int srcrt) * * IPv6 [ESP|AH] IPv6 [extension headers] payload */ - bzero(&state, sizeof(state)); - state.m = m; - state.ro = NULL; /* update at ipsec6_output_tunnel() */ - state.dst = NULL; /* update at ipsec6_output_tunnel() */ - error = ipsec6_output_tunnel(&state, sp, 0); + /* + * If we need to encapsulate the packet, do it here + * ipsec6_proces_packet will send the packet using ip6_output + */ + error = ipsec6_process_packet(m, sp->req); - m = state.m; KEY_FREESP(&sp); + if (error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + error = 0; + goto skip_ipsec; + } + if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ + /* mbuf is already reclaimed in ipsec6_process_packet. */ switch (error) { case EHOSTUNREACH: case ENETUNREACH: @@ -318,7 +326,6 @@ ip6_forward(struct mbuf *m, int srcrt) m_freem(mcopy); #endif } - m_freem(m); return; } else { /* @@ -330,25 +337,7 @@ ip6_forward(struct mbuf *m, int srcrt) m = NULL; goto freecopy; } - - if ((m != NULL) && (ip6 != mtod(m, struct ip6_hdr *)) ){ - /* - * now tunnel mode headers are added. we are originating - * packet instead of forwarding the packet. - */ - ip6_output(m, NULL, NULL, IPV6_FORWARDING/*XXX*/, NULL, NULL, - NULL); - goto freecopy; - } - - /* adjust pointer */ - dst = (struct sockaddr_in6 *)state.dst; - rt = state.ro ? state.ro->ro_rt : NULL; - if (dst != NULL && rt != NULL) - ipsecrt = 1; } - if (ipsecrt) - goto skip_routing; skip_ipsec: #endif again: @@ -371,9 +360,6 @@ again2: goto bad; } rt = rin6.ro_rt; -#ifdef IPSEC -skip_routing: -#endif /* * Source scope check: if a packet can't be delivered to its Modified: stable/10/sys/netinet6/ip6_ipsec.c ============================================================================== --- stable/10/sys/netinet6/ip6_ipsec.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_ipsec.c Wed Nov 5 09:23:29 2014 (r274132) @@ -220,23 +220,22 @@ ip6_ipsec_input(struct mbuf *m, int nxt) int ip6_ipsec_output(struct mbuf **m, struct inpcb *inp, int *flags, int *error, - struct ifnet **ifp, struct secpolicy **sp) + struct ifnet **ifp) { #ifdef IPSEC + struct secpolicy *sp = NULL; struct tdb_ident *tdbi; struct m_tag *mtag; /* XXX int s; */ - if (sp == NULL) - return 1; mtag = m_tag_find(*m, PACKET_TAG_IPSEC_PENDING_TDB, NULL); if (mtag != NULL) { tdbi = (struct tdb_ident *)(mtag + 1); - *sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); - if (*sp == NULL) + sp = ipsec_getpolicy(tdbi, IPSEC_DIR_OUTBOUND); + if (sp == NULL) *error = -EINVAL; /* force silent drop */ m_tag_delete(*m, mtag); } else { - *sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, + sp = ipsec4_checkpolicy(*m, IPSEC_DIR_OUTBOUND, *flags, error, inp); } @@ -247,9 +246,9 @@ ip6_ipsec_output(struct mbuf **m, struct * sp == NULL, error == -EINVAL discard packet w/o error * sp == NULL, error != 0 discard packet, report error */ - if (*sp != NULL) { + if (sp != NULL) { /* Loop detection, check if ipsec processing already done */ - KASSERT((*sp)->req != NULL, ("ip_output: no ipsec request")); + KASSERT(sp->req != NULL, ("ip_output: no ipsec request")); for (mtag = m_tag_first(*m); mtag != NULL; mtag = m_tag_next(*m, mtag)) { if (mtag->m_tag_cookie != MTAG_ABI_COMPAT) @@ -263,12 +262,12 @@ ip6_ipsec_output(struct mbuf **m, struct * an SA; e.g. on first reference. If it occurs, * then we let ipsec4_process_packet do its thing. */ - if ((*sp)->req->sav == NULL) + if (sp->req->sav == NULL) break; tdbi = (struct tdb_ident *)(mtag + 1); - if (tdbi->spi == (*sp)->req->sav->spi && - tdbi->proto == (*sp)->req->sav->sah->saidx.proto && - bcmp(&tdbi->dst, &(*sp)->req->sav->sah->saidx.dst, + if (tdbi->spi == sp->req->sav->spi && + tdbi->proto == sp->req->sav->sah->saidx.proto && + bcmp(&tdbi->dst, &sp->req->sav->sah->saidx.dst, sizeof (union sockaddr_union)) == 0) { /* * No IPsec processing is needed, free @@ -277,7 +276,7 @@ ip6_ipsec_output(struct mbuf **m, struct * NB: null pointer to avoid free at * done: below. */ - KEY_FREESP(sp), *sp = NULL; + KEY_FREESP(&sp), sp = NULL; goto done; } } @@ -285,16 +284,37 @@ ip6_ipsec_output(struct mbuf **m, struct /* * Do delayed checksums now because we send before * this is done in the normal processing path. - * For IPv6 we do delayed checksums in ip6_output.c. */ #ifdef INET if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - ipseclog((LOG_DEBUG, - "%s: we do not support IPv4 over IPv6", __func__)); in_delayed_cksum(*m); (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #endif + if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(*m, (*m)->m_pkthdr.len - sizeof(struct ip6_hdr), + sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } +#ifdef SCTP + if ((*m)->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { + sctp_delayed_cksum(*m, sizeof(struct ip6_hdr)); + (*m)->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; + } +#endif + + /* NB: callee frees mbuf */ + *error = ipsec6_process_packet(*m, sp->req); + + if (*error == EJUSTRETURN) { + /* + * We had a SP with a level of 'use' and no SA. We + * will just continue to process the packet without + * IPsec processing. + */ + *error = 0; + goto done; + } /* * Preserve KAME behaviour: ENOENT can be returned @@ -305,7 +325,7 @@ ip6_ipsec_output(struct mbuf **m, struct */ if (*error == ENOENT) *error = 0; - goto do_ipsec; + goto reinjected; } else { /* sp == NULL */ if (*error != 0) { /* @@ -322,10 +342,16 @@ ip6_ipsec_output(struct mbuf **m, struct } } done: + if (sp != NULL) + KEY_FREESP(&sp); return 0; -do_ipsec: +reinjected: + if (sp != NULL) + KEY_FREESP(&sp); return -1; bad: + if (sp != NULL) + KEY_FREESP(&sp); return 1; #endif /* IPSEC */ return 0; Modified: stable/10/sys/netinet6/ip6_ipsec.h ============================================================================== --- stable/10/sys/netinet6/ip6_ipsec.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_ipsec.h Wed Nov 5 09:23:29 2014 (r274132) @@ -36,7 +36,7 @@ int ip6_ipsec_filtertunnel(struct mbuf * int ip6_ipsec_fwd(struct mbuf *); int ip6_ipsec_input(struct mbuf *, int); int ip6_ipsec_output(struct mbuf **, struct inpcb *, int *, int *, - struct ifnet **, struct secpolicy **sp); + struct ifnet **); #if 0 int ip6_ipsec_mtu(struct mbuf *); #endif Modified: stable/10/sys/netinet6/ip6_output.c ============================================================================== --- stable/10/sys/netinet6/ip6_output.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_output.c Wed Nov 5 09:23:29 2014 (r274132) @@ -184,7 +184,7 @@ static int copypktopts(struct ip6_pktopt }\ } while (/*CONSTCOND*/ 0) -static void +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset) { u_short csum; @@ -248,15 +248,7 @@ ip6_output(struct mbuf *m0, struct ip6_p u_int32_t zone; struct route_in6 *ro_pmtu = NULL; int hdrsplit = 0; - int needipsec = 0; int sw_csum, tso; -#ifdef IPSEC - struct ipsec_output_state state; - struct ip6_rthdr *rh = NULL; - int needipsectun = 0; - int segleft_org = 0; - struct secpolicy *sp = NULL; -#endif /* IPSEC */ struct m_tag *fwd_tag = NULL; ip6 = mtod(m, struct ip6_hdr *); @@ -298,26 +290,12 @@ ip6_output(struct mbuf *m0, struct ip6_p * IPSec checking which handles several cases. * FAST IPSEC: We re-injected the packet. */ - switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp, &sp)) + switch(ip6_ipsec_output(&m, inp, &flags, &error, &ifp)) { case 1: /* Bad packet */ goto freehdrs; - case -1: /* Do IPSec */ - needipsec = 1; - /* - * Do delayed checksums now, as we may send before returning. - */ - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { - plen = m->m_pkthdr.len - sizeof(*ip6); - in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; - } -#ifdef SCTP - if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) { - sctp_delayed_cksum(m, sizeof(struct ip6_hdr)); - m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6; - } -#endif + case -1: /* IPSec done */ + goto done; case 0: /* No IPSec */ default: break; @@ -337,15 +315,15 @@ ip6_output(struct mbuf *m0, struct ip6_p optlen += exthdrs.ip6e_rthdr->m_len; unfragpartlen = optlen + sizeof(struct ip6_hdr); - /* NOTE: we don't add AH/ESP length here. do that later. */ + /* NOTE: we don't add AH/ESP length here (done in ip6_ipsec_output) */ if (exthdrs.ip6e_dest2) optlen += exthdrs.ip6e_dest2->m_len; /* - * If we need IPsec, or there is at least one extension header, + * If there is at least one extension header, * separate IP6 header from the payload. */ - if ((needipsec || optlen) && !hdrsplit) { + if (optlen && !hdrsplit) { if ((error = ip6_splithdr(m, &exthdrs)) != 0) { m = NULL; goto freehdrs; @@ -420,72 +398,6 @@ ip6_output(struct mbuf *m0, struct ip6_p MAKE_CHAIN(exthdrs.ip6e_rthdr, mprev, nexthdrp, IPPROTO_ROUTING); -#ifdef IPSEC - if (!needipsec) - goto skip_ipsec2; - - /* - * pointers after IPsec headers are not valid any more. - * other pointers need a great care too. - * (IPsec routines should not mangle mbufs prior to AH/ESP) - */ - exthdrs.ip6e_dest2 = NULL; - - if (exthdrs.ip6e_rthdr) { - rh = mtod(exthdrs.ip6e_rthdr, struct ip6_rthdr *); - segleft_org = rh->ip6r_segleft; - rh->ip6r_segleft = 0; - } - - bzero(&state, sizeof(state)); - state.m = m; - error = ipsec6_output_trans(&state, nexthdrp, mprev, sp, flags, - &needipsectun); - m = state.m; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_trans. */ - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else if (!needipsectun) { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - if (exthdrs.ip6e_rthdr) { - /* ah6_output doesn't modify mbuf chain */ - rh->ip6r_segleft = segleft_org; - } -skip_ipsec2:; -#endif /* IPSEC */ - /* * If there is a routing header, discard the packet. */ @@ -551,77 +463,6 @@ again: ip6->ip6_hlim = V_ip6_defmcasthlim; } -#ifdef IPSEC - /* - * We may re-inject packets into the stack here. - */ - if (needipsec && needipsectun) { - struct ipsec_output_state state; - - /* - * All the extension headers will become inaccessible - * (since they can be encrypted). - * Don't panic, we need no more updates to extension headers - * on inner IPv6 packet (since they are now encapsulated). - * - * IPv6 [ESP|AH] IPv6 [extension headers] payload - */ - bzero(&exthdrs, sizeof(exthdrs)); - exthdrs.ip6e_ip6 = m; - - bzero(&state, sizeof(state)); - state.m = m; - state.ro = (struct route *)ro; - state.dst = (struct sockaddr *)dst; - - error = ipsec6_output_tunnel(&state, sp, flags); - - m = state.m; - ro = (struct route_in6 *)state.ro; - dst = (struct sockaddr_in6 *)state.dst; - if (error == EJUSTRETURN) { - /* - * We had a SP with a level of 'use' and no SA. We - * will just continue to process the packet without - * IPsec processing. - */ - ; - } else if (error) { - /* mbuf is already reclaimed in ipsec6_output_tunnel. */ - m0 = m = NULL; - m = NULL; - switch (error) { - case EHOSTUNREACH: - case ENETUNREACH: - case EMSGSIZE: - case ENOBUFS: - case ENOMEM: - break; - default: - printf("[%s:%d] (ipsec): error code %d\n", - __func__, __LINE__, error); - /* FALLTHROUGH */ - case ENOENT: - /* don't show these error codes to the user */ - error = 0; - break; - } - goto bad; - } else { - /* - * In the FAST IPSec case we have already - * re-injected the packet and it has been freed - * by the ipsec_done() function. So, just clean - * up after ourselves. - */ - m = NULL; - goto done; - } - - exthdrs.ip6e_ip6 = m; - } -#endif /* IPSEC */ - /* adjust pointer */ ip6 = mtod(m, struct ip6_hdr *); @@ -1182,11 +1023,6 @@ done: RO_RTFREE(ro); if (ro_pmtu == &ip6route) RO_RTFREE(ro_pmtu); -#ifdef IPSEC - if (sp != NULL) - KEY_FREESP(&sp); -#endif - return (error); freehdrs: Modified: stable/10/sys/netinet6/ip6_var.h ============================================================================== --- stable/10/sys/netinet6/ip6_var.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netinet6/ip6_var.h Wed Nov 5 09:23:29 2014 (r274132) @@ -456,6 +456,7 @@ int in6_selectroute_fib(struct sockaddr_ struct rtentry **, u_int); u_int32_t ip6_randomid(void); u_int32_t ip6_randomflowlabel(void); +void in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset); #endif /* _KERNEL */ #endif /* !_NETINET6_IP6_VAR_H_ */ Modified: stable/10/sys/netipsec/ipsec6.h ============================================================================== --- stable/10/sys/netipsec/ipsec6.h Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec6.h Wed Nov 5 09:23:29 2014 (r274132) @@ -76,6 +76,7 @@ extern int ipsec6_output_trans __P((stru struct mbuf *, struct secpolicy *, int, int *)); extern int ipsec6_output_tunnel __P((struct ipsec_output_state *, struct secpolicy *, int)); +extern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *); #endif /*_KERNEL*/ #endif /*_NETIPSEC_IPSEC6_H_*/ Modified: stable/10/sys/netipsec/ipsec_input.c ============================================================================== --- stable/10/sys/netipsec/ipsec_input.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec_input.c Wed Nov 5 09:23:29 2014 (r274132) @@ -295,7 +295,7 @@ int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt) { - int prot, af, sproto; + int prot, af, sproto, isr_prot; struct ip *ip; struct m_tag *mtag; struct tdb_ident *tdbi; @@ -349,20 +349,34 @@ ipsec4_common_input_cb(struct mbuf *m, s } prot = ip->ip_p; -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); + + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + /* IP-in-IP encapsulation */ - if (prot == IPPROTO_IPIP) { - struct ip ipn; + if (prot == IPPROTO_IPIP && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ipn will now contain the inner IPv4 header */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip), - (caddr_t) &ipn); + /* enc0: strip outer IPv4 header */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* XXX PROXY address isn't recorded in SAH */ /* * Check that the inner source address is the same as @@ -388,21 +402,21 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #ifdef INET6 /* IPv6-in-IP encapsulation. */ - if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; + if (prot == IPPROTO_IPV6 && + saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } - /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, ip->ip_hl << 2, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + /* enc0: strip IPv4 header, keep IPv6 header only */ + m_striphdr(m, 0, ip->ip_hl << 2); +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -426,9 +440,9 @@ ipsec4_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET6 */ -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -464,25 +478,50 @@ ipsec4_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); /* record data transfer */ + /* + * In transport mode requeue decrypted mbuf back to IPv4 protocol + * handler. This is necessary to correctly expose rcvif. + */ + if (saidx->mode == IPSEC_MODE_TRANSPORT) + prot = IPPROTO_IPIP; #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); - - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); +#ifdef INET6 + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); #endif + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ + /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { + + switch (prot) { + case IPPROTO_IPIP: + isr_prot = NETISR_IP; + break; +#ifdef INET6 + case IPPROTO_IPV6: + isr_prot = NETISR_IPV6; + break; +#endif + default: + DPRINTF(("%s: cannot handle inner ip proto %d\n", + __func__, prot)); + IPSEC_ISTAT(sproto, nopf); + error = EPFNOSUPPORT; + goto bad; + } + + error = netisr_queue_src(isr_prot, (uintptr_t)sav->spi, m); + if (error) { IPSEC_ISTAT(sproto, qfull); DPRINTF(("%s: queue full; proto %u packet dropped\n", __func__, sproto)); @@ -605,20 +644,34 @@ ipsec6_common_input_cb(struct mbuf *m, s prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); -#ifdef notyet +#ifdef DEV_ENC + encif->if_ipackets++; + encif->if_ibytes += m->m_pkthdr.len; + + /* + * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP + * packet later after it has been decapsulated. + */ + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); + + /* XXX-BZ does not make sense. */ + if (prot != IPPROTO_IPIP) + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); +#endif /* DEV_ENC */ + #ifdef INET /* IP-in-IP encapsulation */ if (prot == IPPROTO_IPIP) { - struct ip ipn; - if (m->m_pkthdr.len - skip < sizeof(struct ip)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ipn will now contain the inner IPv4 header */ - m_copydata(m, skip, sizeof(struct ip), (caddr_t) &ipn); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -641,22 +694,20 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } #endif /* INET */ - /* IPv6-in-IP encapsulation */ if (prot == IPPROTO_IPV6) { - struct ip6_hdr ip6n; - if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } /* ip6n will now contain the inner IPv6 header. */ - m_copydata(m, skip, sizeof(struct ip6_hdr), - (caddr_t) &ip6n); - + m_striphdr(m, 0, skip); + skip = 0; +#ifdef notyet /* * Check that the inner source address is the same as * the proxy address, if available. @@ -680,8 +731,8 @@ ipsec6_common_input_cb(struct mbuf *m, s error = EACCES; goto bad; } +#endif /* notyet */ } -#endif /*XXX*/ /* * Record what we've done to the packet (under what SA it was @@ -719,23 +770,22 @@ ipsec6_common_input_cb(struct mbuf *m, s key_sa_recordxfer(sav, m); #ifdef DEV_ENC - encif->if_ipackets++; - encif->if_ibytes += m->m_pkthdr.len; - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. + * Pass the mbuf to enc0 for bpf and pfil. */ - ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); - - /* XXX-BZ does not make sense. */ - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); +#ifdef INET + if (prot == IPPROTO_IPIP) + ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER); #endif + if (prot == IPPROTO_IPV6) + ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0) + return (error); +#endif /* DEV_ENC */ /* Retrieve new protocol */ - m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &nxt8); + /* We have stripped the IP6 header from the mbuf, we have to use the backuped proto value instead */ + nxt8 = prot; /* * See the end of ip6_input for this logic. Modified: stable/10/sys/netipsec/ipsec_output.c ============================================================================== --- stable/10/sys/netipsec/ipsec_output.c Wed Nov 5 08:10:58 2014 (r274131) +++ stable/10/sys/netipsec/ipsec_output.c Wed Nov 5 09:23:29 2014 (r274132) @@ -176,8 +176,7 @@ ipsec_process_done(struct mbuf *m, struc #ifdef INET6 case AF_INET6: /* XXX */ - ipsec6_output_trans() - ipsec6_output_tunnel() + return ipsec6_process_packet(m, isr->next); /* NOTREACHED */ #endif /* INET6 */ #endif @@ -498,9 +497,11 @@ ipsec4_process_packet( goto bad; } ip = mtod(m, struct ip *); - ip->ip_len = htons(m->m_pkthdr.len); - ip->ip_sum = 0; - ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + if (ip->ip_v == IPVERSION) { + ip->ip_len = htons(m->m_pkthdr.len); + ip->ip_sum = 0; + ip->ip_sum = in_cksum(m, ip->ip_hl << 2); + } /* Encapsulate the packet */ error = ipip_output(m, isr, &mp, 0, 0); @@ -542,7 +543,7 @@ ipsec4_process_packet( #ifdef DEV_ENC /* pass the mbuf to enc0 for bpf processing */ - ipsec_bpf(m, sav, AF_INET, ENC_OUT|ENC_AFTER); + ipsec_bpf(m, sav, sav->sah->saidx.dst.sa.sa_family, ENC_OUT|ENC_AFTER); /* pass the mbuf to enc0 for packet filtering */ if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_AFTER)) != 0) goto bad; @@ -559,9 +560,26 @@ ipsec4_process_packet( * for reclaiming their resources. */ if (sav->tdb_xform->xf_type != XF_IP4) { - ip = mtod(m, struct ip *); - i = ip->ip_hl << 2; - off = offsetof(struct ip, ip_p); + union sockaddr_union *dst = &sav->sah->saidx.dst; + switch(dst->sa.sa_family) { + case AF_INET: + ip = mtod(m, struct ip *); + i = ip->ip_hl << 2; + off = offsetof(struct ip, ip_p); + break; +#ifdef INET6 + case AF_INET6: + i = sizeof(struct ip6_hdr); + off = offsetof(struct ip6_hdr, ip6_nxt); + break; +#endif /* INET6 */ + default: + DPRINTF(("%s: unsupported protocol family %u\n", + __func__, dst->sa.sa_family)); + error = EPFNOSUPPORT; + IPSECSTAT_INC(ips_out_inval); + goto bad; + } error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off); } else { error = ipsec_process_done(m, isr); @@ -577,224 +595,50 @@ bad: } #endif -#ifdef INET6 -/* - * Chop IP6 header from the payload. - */ -static struct mbuf * -ipsec6_splithdr(struct mbuf *m) -{ - struct mbuf *mh; - struct ip6_hdr *ip6; - int hlen; - - IPSEC_ASSERT(m->m_len >= sizeof (struct ip6_hdr), - ("first mbuf too short, len %u", m->m_len)); - ip6 = mtod(m, struct ip6_hdr *); - hlen = sizeof(struct ip6_hdr); - if (m->m_len > hlen) { - MGETHDR(mh, M_NOWAIT, MT_DATA); - if (!mh) { - m_freem(m); - return NULL; - } - M_MOVE_PKTHDR(mh, m); - MH_ALIGN(mh, hlen); - m->m_len -= hlen; - m->m_data += hlen; - mh->m_next = m; - m = mh; - m->m_len = hlen; - bcopy((caddr_t)ip6, mtod(m, caddr_t), hlen); - } else if (m->m_len < hlen) { - m = m_pullup(m, hlen); - if (!m) - return NULL; - } - return m; -} - -/* - * IPsec output logic for IPv6, transport mode. - */ -int -ipsec6_output_trans( - struct ipsec_output_state *state, - u_char *nexthdrp, - struct mbuf *mprev, - struct secpolicy *sp, - int flags, - int *tun) -{ - struct ipsecrequest *isr; - struct secasindex saidx; - int error = 0; - struct mbuf *m; - - IPSEC_ASSERT(state != NULL, ("null state")); - IPSEC_ASSERT(state->m != NULL, ("null m")); - IPSEC_ASSERT(nexthdrp != NULL, ("null nexthdrp")); - IPSEC_ASSERT(mprev != NULL, ("null mprev")); - IPSEC_ASSERT(sp != NULL, ("null sp")); - IPSEC_ASSERT(tun != NULL, ("null tun")); - - KEYDEBUG(KEYDEBUG_IPSEC_DATA, - printf("%s: applied SP\n", __func__); - kdebug_secpolicy(sp)); - - isr = sp->req; - if (isr->saidx.mode == IPSEC_MODE_TUNNEL) { - /* the rest will be handled by ipsec6_output_tunnel() */ - *tun = 1; /* need tunnel-mode processing */ - return 0; - } - - *tun = 0; - m = state->m; - - IPSECREQUEST_LOCK(isr); /* insure SA contents don't change */ - isr = ipsec_nextisr(m, isr, AF_INET6, &saidx, &error); - if (isr == NULL) { - if (error != 0) { -#ifdef notdef - /* XXX should notification be done for all errors ? */ - /* - * Notify the fact that the packet is discarded - * to ourselves. I believe this is better than - * just silently discarding. (jinmei@kame.net) - * XXX: should we restrict the error to TCP packets? - * XXX: should we directly notify sockets via - * pfctlinputs? - */ - icmp6_error(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADMIN, 0); - m = NULL; /* NB: icmp6_error frees mbuf */ -#endif - goto bad; - } - return EJUSTRETURN; - } - - error = (*isr->sav->tdb_xform->xf_output)(m, isr, NULL, - sizeof (struct ip6_hdr), - offsetof(struct ip6_hdr, - ip6_nxt)); - IPSECREQUEST_UNLOCK(isr); - return error; -bad: - if (isr) - IPSECREQUEST_UNLOCK(isr); - if (m) - m_freem(m); - state->m = NULL; - return error; -} +#ifdef INET6 static int -ipsec6_encapsulate(struct mbuf *m, struct secasvar *sav) +in6_sa_equal_addrwithscope(const struct sockaddr_in6 *sa, const struct in6_addr *ia) { - struct ip6_hdr *oip6; - struct ip6_hdr *ip6; - size_t plen; + struct in6_addr ia2; - /* can't tunnel between different AFs */ - if (sav->sah->saidx.src.sa.sa_family != AF_INET6 || - sav->sah->saidx.dst.sa.sa_family != AF_INET6) { - m_freem(m); - return EINVAL; - } - IPSEC_ASSERT(m->m_len == sizeof (struct ip6_hdr), - ("mbuf wrong size; len %u", m->m_len)); - - - /* - * grow the mbuf to accomodate the new IPv6 header. - */ - plen = m->m_pkthdr.len; - if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) { - struct mbuf *n; - MGET(n, M_NOWAIT, MT_DATA); - if (!n) { - m_freem(m); - return ENOBUFS; - } - n->m_len = sizeof(struct ip6_hdr); - n->m_next = m->m_next; - m->m_next = n; - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(n, struct ip6_hdr *); - } else { - m->m_next->m_len += sizeof(struct ip6_hdr); - m->m_next->m_data -= sizeof(struct ip6_hdr); - m->m_pkthdr.len += sizeof(struct ip6_hdr); - oip6 = mtod(m->m_next, struct ip6_hdr *); - } - ip6 = mtod(m, struct ip6_hdr *); - bcopy((caddr_t)ip6, (caddr_t)oip6, sizeof(struct ip6_hdr)); - - /* Fake link-local scope-class addresses */ - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_src)) - oip6->ip6_src.s6_addr16[1] = 0; - if (IN6_IS_SCOPE_LINKLOCAL(&oip6->ip6_dst)) - oip6->ip6_dst.s6_addr16[1] = 0; - - /* construct new IPv6 header. see RFC 2401 5.1.2.2 */ - /* ECN consideration. */ - ip6_ecn_ingress(V_ip6_ipsec_ecn, &ip6->ip6_flow, &oip6->ip6_flow); - if (plen < IPV6_MAXPACKET - sizeof(struct ip6_hdr)) - ip6->ip6_plen = htons(plen); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 09:33:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CACB3BE9; Wed, 5 Nov 2014 09:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6E8CBD3; Wed, 5 Nov 2014 09:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA59X36B060514; Wed, 5 Nov 2014 09:33:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA59X3oq060510; Wed, 5 Nov 2014 09:33:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411050933.sA59X3oq060510@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Nov 2014 09:33:03 +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: r274133 - in stable/9/sys: net netinet 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 09:33:03 -0000 Author: ae Date: Wed Nov 5 09:33:02 2014 New Revision: 274133 URL: https://svnweb.freebsd.org/changeset/base/274133 Log: Revert r273860. It breaks IPSEC in tunnel mode and needs more revisions to be merged before it will work as expected. Modified: stable/9/sys/net/if_gif.c stable/9/sys/netinet/ip_gre.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_gif.c ============================================================================== --- stable/9/sys/net/if_gif.c Wed Nov 5 09:23:29 2014 (r274132) +++ stable/9/sys/net/if_gif.c Wed Nov 5 09:33:02 2014 (r274133) @@ -500,7 +500,6 @@ gif_input(m, af, ifp) } sc = ifp->if_softc; m->m_pkthdr.rcvif = ifp; - m->m_flags &= ~(M_PROTOFLAGS); #ifdef MAC mac_ifnet_create_mbuf(ifp, m); Modified: stable/9/sys/netinet/ip_gre.c ============================================================================== --- stable/9/sys/netinet/ip_gre.c Wed Nov 5 09:23:29 2014 (r274132) +++ stable/9/sys/netinet/ip_gre.c Wed Nov 5 09:33:02 2014 (r274133) @@ -211,7 +211,7 @@ gre_input2(struct mbuf *m ,int hlen, u_c } m->m_pkthdr.rcvif = GRE2IFP(sc); - m->m_flags &= ~(M_PROTOFLAGS); + netisr_queue(isr, m); /* Packet is done, no further processing needed. */ From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 14:55:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E2479D3; Wed, 5 Nov 2014 14:55:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE1A77D; Wed, 5 Nov 2014 14:55:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5Et253017009; Wed, 5 Nov 2014 14:55:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5Et2nc017008; Wed, 5 Nov 2014 14:55:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411051455.sA5Et2nc017008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Nov 2014 14:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274135 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 14:55:02 -0000 Author: bapt Date: Wed Nov 5 14:55:01 2014 New Revision: 274135 URL: https://svnweb.freebsd.org/changeset/base/274135 Log: Nothing in iconv(1) uses symbols from libcrypt Modified: head/usr.bin/iconv/Makefile Modified: head/usr.bin/iconv/Makefile ============================================================================== --- head/usr.bin/iconv/Makefile Wed Nov 5 13:22:19 2014 (r274134) +++ head/usr.bin/iconv/Makefile Wed Nov 5 14:55:01 2014 (r274135) @@ -7,7 +7,4 @@ PROG= iconv #SRCS= iconv.c MAN= iconv.1 -LDADD+= -lcrypt -DPADD+= ${LIBCRYPT} - .include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 15:03:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7505BC82; Wed, 5 Nov 2014 15:03:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 612DF8A5; Wed, 5 Nov 2014 15:03:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5F3xUe021604; Wed, 5 Nov 2014 15:03:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5F3xB0021603; Wed, 5 Nov 2014 15:03:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411051503.sA5F3xB0021603@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Nov 2014 15:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274136 - head/usr.bin/id 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 15:03:59 -0000 Author: bapt Date: Wed Nov 5 15:03:58 2014 New Revision: 274136 URL: https://svnweb.freebsd.org/changeset/base/274136 Log: id(1) only uses getaudit(2) from the BSM which is part of the libc Modified: head/usr.bin/id/Makefile Modified: head/usr.bin/id/Makefile ============================================================================== --- head/usr.bin/id/Makefile Wed Nov 5 14:55:01 2014 (r274135) +++ head/usr.bin/id/Makefile Wed Nov 5 15:03:58 2014 (r274136) @@ -10,8 +10,6 @@ MAN= id.1 groups.1 whoami.1 .if ${MK_AUDIT} != "no" CFLAGS+= -DUSE_BSM_AUDIT -DPADD+= ${LIBBSM} -LDADD+= -lbsm .endif .include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 15:32:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 165C85ED; Wed, 5 Nov 2014 15:32:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02E97BE5; Wed, 5 Nov 2014 15:32:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5FWvv6035705; Wed, 5 Nov 2014 15:32:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5FWvqi035704; Wed, 5 Nov 2014 15:32:57 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411051532.sA5FWvqi035704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Nov 2014 15:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274137 - head/usr.bin/ftp 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 15:32:58 -0000 Author: bapt Date: Wed Nov 5 15:32:57 2014 New Revision: 274137 URL: https://svnweb.freebsd.org/changeset/base/274137 Log: ftp(1) uses nothing from libutil, do not link to it Modified: head/usr.bin/ftp/Makefile Modified: head/usr.bin/ftp/Makefile ============================================================================== --- head/usr.bin/ftp/Makefile Wed Nov 5 15:03:58 2014 (r274136) +++ head/usr.bin/ftp/Makefile Wed Nov 5 15:32:57 2014 (r274137) @@ -20,8 +20,8 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${.CURDIR} -I${TNFTP} -LDADD= -ledit -ltermcapw -lutil -DPADD= ${LIBEDIT} ${LIBTERMCAPW} ${LIBUTIL} +LDADD= -ledit -ltermcapw +DPADD= ${LIBEDIT} ${LIBTERMCAPW} WARNS?= 2 From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:13:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90A972EA; Wed, 5 Nov 2014 16:13:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C75813B; Wed, 5 Nov 2014 16:13:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GDhRP054719; Wed, 5 Nov 2014 16:13:43 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GDhq5054717; Wed, 5 Nov 2014 16:13:43 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411051613.sA5GDhq5054717@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Wed, 5 Nov 2014 16:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274138 - in head/lib/libpam/libpam: . 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:13:43 -0000 Author: des Date: Wed Nov 5 16:13:42 2014 New Revision: 274138 URL: https://svnweb.freebsd.org/changeset/base/274138 Log: Hook up OpenPAM's own unit tests to the build. Added: head/lib/libpam/libpam/tests/ head/lib/libpam/libpam/tests/Makefile (contents, props changed) Modified: head/lib/libpam/libpam/Makefile Modified: head/lib/libpam/libpam/Makefile ============================================================================== --- head/lib/libpam/libpam/Makefile Wed Nov 5 15:32:57 2014 (r274137) +++ head/lib/libpam/libpam/Makefile Wed Nov 5 16:13:42 2014 (r274138) @@ -199,4 +199,8 @@ DPSRCS= openpam_static.c INCS= ${HEADERS} ${ADD_HEADERS} INCSDIR= ${INCLUDEDIR}/security +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/lib/libpam/libpam/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libpam/libpam/tests/Makefile Wed Nov 5 16:13:42 2014 (r274138) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +OPENPAM = ${.CURDIR}/../../../../contrib/openpam +.PATH: ${OPENPAM}/t + +TESTSDIR = ${TESTSBASE}/lib/libpam + +COMMONSRC = t_file.c t_main.c +.for test in t_openpam_ctype t_openpam_readlinev t_openpam_readword +TAP_TESTS_C += ${test} +SRCS.${test} = ${test}.c ${COMMONSRC} +.endfor +CFLAGS +=-I${OPENPAM}/include -I${OPENPAM}/lib/libpam -I${OPENPAM}/t +WARNS ?= 6 + +DPADD = ${LIBPAM} +LDADD = ${MINUSLPAM} + +.include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:24:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAD91822; Wed, 5 Nov 2014 16:24:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95CF6282; Wed, 5 Nov 2014 16:24:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GOwb0059676; Wed, 5 Nov 2014 16:24:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GOvW5059672; Wed, 5 Nov 2014 16:24:57 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051624.sA5GOvW5059672@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:24:57 +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: r274139 - in stable/10: . share/man/man9 sys/sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:24:58 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:24:57 2014 New Revision: 274139 URL: https://svnweb.freebsd.org/changeset/base/274139 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man9/Makefile stable/10/share/man/man9/sleepqueue.9 stable/10/sys/sys/sleepqueue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/ObsoleteFiles.inc Wed Nov 5 16:24:57 2014 (r274139) @@ -42,6 +42,9 @@ OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20141010: rc.d/kerberos removed OLD_FILES+=etc/rc.d/kerberos +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140814: libopie version bump Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/share/man/man9/Makefile Wed Nov 5 16:24:57 2014 (r274139) @@ -1238,8 +1238,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/10/share/man/man9/sleepqueue.9 ============================================================================== --- stable/10/share/man/man9/sleepqueue.9 Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/share/man/man9/sleepqueue.9 Wed Nov 5 16:24:57 2014 (r274139) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2013 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -62,10 +60,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -86,15 +80,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -252,17 +246,6 @@ allows to pass additional .Fn callout_reset_sbt flags. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -289,12 +272,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -304,20 +284,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/10/sys/sys/sleepqueue.h ============================================================================== --- stable/10/sys/sys/sleepqueue.h Wed Nov 5 16:13:42 2014 (r274138) +++ stable/10/sys/sys/sleepqueue.h Wed Nov 5 16:24:57 2014 (r274139) @@ -46,13 +46,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:26:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70D72961; Wed, 5 Nov 2014 16:26:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B53328D; Wed, 5 Nov 2014 16:26:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GQPlj059963; Wed, 5 Nov 2014 16:26:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GQOFo059959; Wed, 5 Nov 2014 16:26:24 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051626.sA5GQOFo059959@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:26:24 +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: r274140 - in stable/9: . share/man/man9 sys/sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:26:25 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:26:23 2014 New Revision: 274140 URL: https://svnweb.freebsd.org/changeset/base/274140 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/sleepqueue.9 stable/9/sys/sys/sleepqueue.h Directory Properties: stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/ObsoleteFiles.inc Wed Nov 5 16:26:23 2014 (r274140) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20140728: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/VOP_GETVOBJECT.9.gz OLD_FILES+=usr/share/man/man9/VOP_CREATEVOBJECT.9.gz Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/share/man/man9/Makefile Wed Nov 5 16:26:23 2014 (r274140) @@ -1205,8 +1205,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/9/share/man/man9/sleepqueue.9 ============================================================================== --- stable/9/share/man/man9/sleepqueue.9 Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/share/man/man9/sleepqueue.9 Wed Nov 5 16:26:23 2014 (r274140) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -61,10 +59,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -82,15 +76,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -231,17 +225,6 @@ The .Fa timo parameter should specify the timeout value in ticks. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -268,12 +251,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -283,20 +263,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/9/sys/sys/sleepqueue.h ============================================================================== --- stable/9/sys/sys/sleepqueue.h Wed Nov 5 16:24:57 2014 (r274139) +++ stable/9/sys/sys/sleepqueue.h Wed Nov 5 16:26:23 2014 (r274140) @@ -46,13 +46,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:27:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90175AB1; Wed, 5 Nov 2014 16:27:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1E22C1; Wed, 5 Nov 2014 16:27:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GRTSo060161; Wed, 5 Nov 2014 16:27:29 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GRSOh060157; Wed, 5 Nov 2014 16:27:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201411051627.sA5GRSOh060157@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Nov 2014 16:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274141 - in stable/8: . share/man/man9 sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:27:29 -0000 Author: lwhsu (ports committer) Date: Wed Nov 5 16:27:27 2014 New Revision: 274141 URL: https://svnweb.freebsd.org/changeset/base/274141 Log: MFC r271992 Reflect the chanages in sleepqueue.h and subr_sleepqueue.c - Priority argument is introduced to sleepq_*wait* in r177085 - sleepq_calc_signal_retval is removed from implementation - sleepq_catch_signals is internal now MFC r272475 - Bump .Dd Approved by: kevlo Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/sleepqueue.9 stable/8/sys/sys/sleepqueue.h Directory Properties: stable/8/share/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/ObsoleteFiles.inc Wed Nov 5 16:27:27 2014 (r274141) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed +OLD_FILES+=usr/share/man/man9/sleepq_calc_signal_retval.9.gz +OLD_FILES+=usr/share/man/man9/sleepq_catch_signals.9.gz # 20130701: vfs_mount.9 removed OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20110915: rename congestion control manpages Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/share/man/man9/Makefile Wed Nov 5 16:27:27 2014 (r274141) @@ -1161,8 +1161,6 @@ MLINKS+=sleepqueue.9 init_sleepqueues.9 sleepqueue.9 sleepq_add.9 \ sleepqueue.9 sleepq_alloc.9 \ sleepqueue.9 sleepq_broadcast.9 \ - sleepqueue.9 sleepq_calc_signal_retval.9 \ - sleepqueue.9 sleepq_catch_signals.9 \ sleepqueue.9 sleepq_free.9 \ sleepqueue.9 sleepq_lookup.9 \ sleepqueue.9 sleepq_release.9 \ Modified: stable/8/share/man/man9/sleepqueue.9 ============================================================================== --- stable/8/share/man/man9/sleepqueue.9 Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/share/man/man9/sleepqueue.9 Wed Nov 5 16:27:27 2014 (r274141) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2010 +.Dd September 22, 2014 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -32,8 +32,6 @@ .Nm sleepq_add , .Nm sleepq_alloc , .Nm sleepq_broadcast , -.Nm sleepq_calc_signal_retval , -.Nm sleepq_catch_signals , .Nm sleepq_free , .Nm sleepq_lock , .Nm sleepq_lookup , @@ -61,10 +59,6 @@ .Fn sleepq_alloc "void" .Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" -.Ft int -.Fn sleepq_calc_signal_retval "int sig" -.Ft int -.Fn sleepq_catch_signals "void *wchan" .Ft void .Fn sleepq_free "struct sleepqueue *sq" .Ft struct sleepqueue * @@ -82,15 +76,15 @@ .Ft u_int .Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int -.Fn sleepq_timedwait "void *wchan" +.Fn sleepq_timedwait "void *wchan" "int pri" .Ft int -.Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Fn sleepq_timedwait_sig "void *wchan" "int pri" .Ft int .Fn sleepq_type "void *wchan" .Ft void -.Fn sleepq_wait "void *wchan" +.Fn sleepq_wait "void *wchan" "int pri" .Ft int -.Fn sleepq_wait_sig "void *wchan" +.Fn sleepq_wait_sig "void *wchan" "int pri" .Sh DESCRIPTION Sleep queues provide a mechanism for suspending execution of a thread until some condition is met. @@ -231,17 +225,6 @@ The .Fa timo parameter should specify the timeout value in ticks. .Pp -The current thread may be marked interruptible by calling -.Fn sleepq_catch_signals -with -.Fa wchan -set to the wait channel. -This function returns a signal number if there are any pending signals for -the current thread and 0 if there is not a pending signal. -The sleep queue chain associated with argument -.Fa wchan -should have been locked by a prior call to -.Fn sleepq_lock . .Pp Once the thread is ready to suspend, one of the wait functions is called to put the current thread to sleep @@ -268,12 +251,9 @@ The sleep queue chain associated with ar needs to have been locked with a prior call to .Fn sleepq_lock . The -.Fa signal_caught -parameter to -.Fn sleepq_timedwait_sig -specifies if a previous call to -.Fn sleepq_catch_signals -found a pending signal. +.Fa pri +argument is used to set the priority of the thread when it is awakened. +If it is set to zero, the thread's priority is left alone. .Pp When the thread is resumed, the wait functions return a non-zero value if the thread was awakened due to @@ -283,20 +263,6 @@ If the sleep timed out, then is returned. If the sleep was interrupted by something other than a signal, then some other return value will be returned. -If zero is returned after resuming from an interruptible sleep, -then -.Fn sleepq_calc_signal_retval -should be called to determine if the sleep was interrupted by a signal. -If so, -.Fn sleepq_calc_signal_retval -returns -.Er ERESTART -if the interrupting signal is restartable and -.Er EINTR -otherwise. -If the sleep was not interrupted by a signal, -.Fn sleepq_calc_signal_retval -will return 0. .Pp A sleeping thread is normally resumed by the .Fn sleepq_broadcast Modified: stable/8/sys/sys/sleepqueue.h ============================================================================== --- stable/8/sys/sys/sleepqueue.h Wed Nov 5 16:26:23 2014 (r274140) +++ stable/8/sys/sys/sleepqueue.h Wed Nov 5 16:27:27 2014 (r274141) @@ -49,13 +49,6 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants to the sleep to be interruptible by signals, it can - * call sleepq_catch_signals() after sleepq_add(). It should then use - * one of the sleepq_wait_sig() functions to block. After the thread has - * been resumed, it should call sleepq_calc_signal_retval() to determine - * if it should return EINTR or ERESTART passing in the value returned from - * the earlier call to sleepq_catch_signals(). - * * A thread is normally resumed from a sleep queue by either the * sleepq_signal() or sleepq_broadcast() functions. Sleepq_signal() wakes * the thread with the highest priority that is sleeping on the specified From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:30:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1EA4C29; Wed, 5 Nov 2014 16:30:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDD3B2FC; Wed, 5 Nov 2014 16:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5GU2YG060603; Wed, 5 Nov 2014 16:30:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5GU2Xv060602; Wed, 5 Nov 2014 16:30:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411051630.sA5GU2Xv060602@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 5 Nov 2014 16:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274142 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:30:02 -0000 Author: ngie Date: Wed Nov 5 16:30:02 2014 New Revision: 274142 URL: https://svnweb.freebsd.org/changeset/base/274142 Log: Remove expected failure from lib.libc.sys.t_mincore:mincore_resid The failure was added based on observation seen on 11.0-CURRENT @ r273153, not based on internal testing at EMC/Isilon PR: 194829 Tested with the following configuration: - amd64/i386 - 11.0-CURRENT @ r273153 - 100 times in a tight loop as root with the following commands... -- kyua test lib/libc -- kyua test lib/libc/sys -- kyua test lib/libc/sys/mincore_test Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Nov 5 16:27:27 2014 (r274141) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mincore.c Wed Nov 5 16:30:02 2014 (r274142) @@ -206,9 +206,6 @@ ATF_TC_BODY(mincore_resid, tc) "might be low on memory"); #ifdef __FreeBSD__ - atf_tc_expect_fail("the following calls fail; this seems to be a new " - "issue (didn't occur in 07/2014)"); - ATF_REQUIRE(mlock(addr, npgs * page) == 0); #endif ATF_REQUIRE(check_residency(addr, npgs) == npgs); From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 16:38:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 045EBFD5; Wed, 5 Nov 2014 16:38:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB4B4614; Wed, 5 Nov 2014 16:38:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5Gcv76065194; Wed, 5 Nov 2014 16:38:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5Gcv8L065193; Wed, 5 Nov 2014 16:38:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411051638.sA5Gcv8L065193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 5 Nov 2014 16:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274143 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 16:38:58 -0000 Author: ngie Date: Wed Nov 5 16:38:57 2014 New Revision: 274143 URL: https://svnweb.freebsd.org/changeset/base/274143 Log: Expect lib.libc.sys.getcontext_test.setcontext_link to fail on amd64; add additional debugging to make the underlying problem more visible Calling setcontext(2) on amd64 as shown in the test program is failing on amd64, not i386, with a return code of -1 and an errno of EINVAL Further investigation is being done in the PR to determine the root cause for the failure PR: 194828 Tested with the following configuration: - amd64/i386 - 11.0-CURRENT @ r273153 - 100 times in a tight loop as root with the following commands... -- kyua test lib/libc -- kyua test lib/libc/sys -- kyua test lib/libc/sys/getcontext_test Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Wed Nov 5 16:30:02 2014 (r274142) +++ head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Wed Nov 5 16:38:57 2014 (r274143) @@ -101,6 +101,13 @@ ATF_TC_BODY(setcontext_link, tc) ucontext_t save; volatile int i = 0; /* avoid longjmp clobbering */ +#ifdef __FreeBSD__ +#ifdef __amd64__ + atf_tc_expect_fail("setcontext in this testcase fails on " + "FreeBSD/amd64 with rc == -1/errno == EINVAL; see PR # 194828"); +#endif +#endif + for (i = 0; i < DEPTH; ++i) { ATF_REQUIRE_EQ(getcontext(&uc[i]), 0); @@ -114,8 +121,15 @@ ATF_TC_BODY(setcontext_link, tc) ATF_REQUIRE_EQ(getcontext(&save), 0); +#ifdef __FreeBSD__ + if (calls == 0) { + int rc = setcontext(&uc[DEPTH-1]); + ATF_REQUIRE_EQ_MSG(rc, 0, "%d != 0; (errno = %d)", rc, errno); + } +#else if (calls == 0) ATF_REQUIRE_EQ(setcontext(&uc[DEPTH-1]), 0); +#endif } ATF_TP_ADD_TCS(tp) From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 19:54:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9EE9AA1; Wed, 5 Nov 2014 19:54:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B633DE61; Wed, 5 Nov 2014 19:54:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5JsFXu059315; Wed, 5 Nov 2014 19:54:15 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5JsFZJ059314; Wed, 5 Nov 2014 19:54:15 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411051954.sA5JsFZJ059314@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 19:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274144 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 19:54:15 -0000 Author: dteske Date: Wed Nov 5 19:54:14 2014 New Revision: 274144 URL: https://svnweb.freebsd.org/changeset/base/274144 Log: Fix code-typo; introduced by r267511 MFC after: 3 days X-MFC-to: stable/10 Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Wed Nov 5 16:38:57 2014 (r274143) +++ head/lib/Makefile Wed Nov 5 19:54:14 2014 (r274144) @@ -130,7 +130,7 @@ SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcapsicum= libnv SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog SUBDIR_DEPEND_libdevstat= libkvm -SUBDIR_DEPEND_libdiaglog= ncurses +SUBDIR_DEPEND_libdialog= ncurses SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 20:13:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8230C0; Wed, 5 Nov 2014 20:13:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4430FA; Wed, 5 Nov 2014 20:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5KDJIb068802; Wed, 5 Nov 2014 20:13:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5KDJF5068799; Wed, 5 Nov 2014 20:13:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201411052013.sA5KDJF5068799@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Wed, 5 Nov 2014 20:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274145 - head/contrib/openpam/t 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 20:13:20 -0000 Author: des Date: Wed Nov 5 20:13:18 2014 New Revision: 274145 URL: https://svnweb.freebsd.org/changeset/base/274145 Log: Staticize the test plans. Modified: head/contrib/openpam/t/t_openpam_ctype.c head/contrib/openpam/t/t_openpam_readlinev.c head/contrib/openpam/t/t_openpam_readword.c Modified: head/contrib/openpam/t/t_openpam_ctype.c ============================================================================== --- head/contrib/openpam/t/t_openpam_ctype.c Wed Nov 5 19:54:14 2014 (r274144) +++ head/contrib/openpam/t/t_openpam_ctype.c Wed Nov 5 20:13:18 2014 (r274145) @@ -94,7 +94,7 @@ T_OC(pfcs) * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(t_oc_digit), T(t_oc_xdigit), T(t_oc_upper), Modified: head/contrib/openpam/t/t_openpam_readlinev.c ============================================================================== --- head/contrib/openpam/t/t_openpam_readlinev.c Wed Nov 5 19:54:14 2014 (r274144) +++ head/contrib/openpam/t/t_openpam_readlinev.c Wed Nov 5 20:13:18 2014 (r274145) @@ -255,7 +255,7 @@ T_FUNC(unterminated_line, "unterminated * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(empty_input), T(empty_line), T(unterminated_empty_line), Modified: head/contrib/openpam/t/t_openpam_readword.c ============================================================================== --- head/contrib/openpam/t/t_openpam_readword.c Wed Nov 5 19:54:14 2014 (r274144) +++ head/contrib/openpam/t/t_openpam_readword.c Wed Nov 5 20:13:18 2014 (r274145) @@ -823,7 +823,7 @@ T_FUNC(escaped_double_quote_within_doubl * Boilerplate */ -const struct t_test *t_plan[] = { +static const struct t_test *t_plan[] = { T(empty_input), T(empty_line), T(single_whitespace), From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 20:28:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45EC9366; Wed, 5 Nov 2014 20:28:14 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1539321B; Wed, 5 Nov 2014 20:28:13 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Xm7Bc-0009L9-57; Wed, 05 Nov 2014 20:28:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA5KSBfm001586; Wed, 5 Nov 2014 13:28:11 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18sN4jylYwq8V5XpEJ/Ms2r X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274144 - head/lib From: Ian Lepore To: Devin Teske In-Reply-To: <201411051954.sA5JsFZJ059314@svn.freebsd.org> References: <201411051954.sA5JsFZJ059314@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 05 Nov 2014 13:28:10 -0700 Message-ID: <1415219290.1200.148.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 20:28:14 -0000 On Wed, 2014-11-05 at 19:54 +0000, Devin Teske wrote: > Author: dteske > Date: Wed Nov 5 19:54:14 2014 > New Revision: 274144 > URL: https://svnweb.freebsd.org/changeset/base/274144 > > Log: > Fix code-typo; introduced by r267511 > > MFC after: 3 days > X-MFC-to: stable/10 > Pointy hat to: ian -- Ian > Modified: > head/lib/Makefile > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Wed Nov 5 16:38:57 2014 (r274143) > +++ head/lib/Makefile Wed Nov 5 19:54:14 2014 (r274144) > @@ -130,7 +130,7 @@ SUBDIR_DEPEND_libcam= libsbuf > SUBDIR_DEPEND_libcapsicum= libnv > SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog > SUBDIR_DEPEND_libdevstat= libkvm > -SUBDIR_DEPEND_libdiaglog= ncurses > +SUBDIR_DEPEND_libdialog= ncurses > SUBDIR_DEPEND_libedit= ncurses > SUBDIR_DEPEND_libg++= msun > SUBDIR_DEPEND_libgeom= libexpat libsbuf > From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 20:58:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07C17949; Wed, 5 Nov 2014 20:58:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6016762; Wed, 5 Nov 2014 20:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5KwQFi088048; Wed, 5 Nov 2014 20:58:26 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5KwQCW088046; Wed, 5 Nov 2014 20:58:26 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411052058.sA5KwQCW088046@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 5 Nov 2014 20:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274146 - in head: lib/libdpv usr.bin/dpv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 20:58:27 -0000 Author: dteske Date: Wed Nov 5 20:58:25 2014 New Revision: 274146 URL: https://svnweb.freebsd.org/changeset/base/274146 Log: Balance DPADD against LDADD for dpv(1,3). Thanks to: ngie MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 274121 274123 274144 Modified: head/lib/libdpv/Makefile head/usr.bin/dpv/Makefile Modified: head/lib/libdpv/Makefile ============================================================================== --- head/lib/libdpv/Makefile Wed Nov 5 20:13:18 2014 (r274145) +++ head/lib/libdpv/Makefile Wed Nov 5 20:58:25 2014 (r274146) @@ -6,8 +6,8 @@ INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 -DPADD= ${LIBFIGPAR} -LDADD= -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} +LDADD= -ldialog -lfigpar -lncursesw -lutil SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c Modified: head/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Wed Nov 5 20:13:18 2014 (r274145) +++ head/usr.bin/dpv/Makefile Wed Nov 5 20:58:25 2014 (r274146) @@ -4,8 +4,8 @@ PROG= dpv CFLAGS+= -I${.CURDIR} -DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSES} ${LIBUTIL} -LDADD= -ldpv -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} +LDADD= -ldpv -ldialog -lfigpar -lncursesw -lutil WARNS?= 6 From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 21:04:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCF34C05; Wed, 5 Nov 2014 21:04:17 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 4CA97830; Wed, 5 Nov 2014 21:04:17 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id E6DDFD48698; Thu, 6 Nov 2014 08:04:05 +1100 (AEDT) Date: Thu, 6 Nov 2014 08:04:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore Subject: Re: svn commit: r274088 - head/sys/kern In-Reply-To: <1415137776.1200.113.camel@revolution.hippie.lan> Message-ID: <20141106063913.V1296@besplex.bde.org> References: <201411041129.sA4BTnwX030600@svn.freebsd.org> <20141104114041.GA21297@dft-labs.eu> <20141105023323.O1105@besplex.bde.org> <1415123429.1200.75.camel@revolution.hippie.lan> <20141105071445.O2183@besplex.bde.org> <1415137776.1200.113.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=JqP_PKshwFK4I7qh_TUA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 21:04:18 -0000 On Tue, 4 Nov 2014, Ian Lepore wrote: > On Wed, 2014-11-05 at 07:46 +1100, Bruce Evans wrote: >> ... >> _ALIGNBYTES should probably have type u_long to begin with to reduce the >> magic. >> ... > > So bottom line, define _ALIGNBYTES as (8UL - 1) to minimize the magic? 8UL on 64-bit arches and 8U on 32-bit arches. The second is required to avoid surprises and not break the comment which says that _ALIGN() has type unsigned int. Except the comment is often broken. All cases are now broken in some way, including some that were correct except for style bugs in FreeBSD-[4-5] :-(, The less-broken cases use 'unsigned long' or 'unsigned int' in the definition of _ALIGN() so as to avoid namespace pollution. This type should be identical to uintptr_t, and must be equivalent to uintptr_t. The documentation of the type in the comment should match this. The current (and some previous) brokenness is: amd64: This was broken in FreeBSD-[5-8] by spelling uintptr_t as u_long in the code and comments. Using u_long gives namespace pollution and thus defeats the reason for existence of _align.h, but FreeBSD-[5-8] didn't use _align.h. The namespace pollution was moved by merging with the i386 _align.h. The u_long in the code is now spelled uintptr_t. The long in the code is now spelled register_t. The u_long in the comment is now just wrong for amd64. It is now misspelled unsigned int, after copying the comment from i386 where it was correct. arm: Correct, except for the style bug of spelling the type verbosely as unsigned int in the comment. Only 32 bits is supported, and uintptr_t is always uint32_t == unsigned, so there are no complications. i386, pc98: This was correct in FreeBSD[4-8] except for the same style bug as arm. (I changed tyhe comment to say uintptr_t in my version. This spelling doesn't cause any namespace problems when it is in a comment.) i386 now uses the same code as amd64. The type in the comment remains correct, but the types in the code give namespace pollution. mips This still uses the old alpha/NetBSD (arch) code and spells the type as u_long in the comment and the code. This is more broken than before, since u_long is incompatible with the type of uintptr_t in the 32-bit case. uintptr_t == uint32_t == plain unsigned then. It gives the same namespace pollution as on old amd64 (which was also closer to alpha than to i386). More details on the pollution: u_long is not even defined when in the case where _align.h does something useful (when sys/socket.h is compiled with options for strict POSIX conformance). powerpc: Same as amd64. More details on the namsespace pollution: types ending in _t are in the POSIX namespace in some cases, so uintptr_t and register_t are not quite as polluting as u_long. sparc64: this uses u_long in the code but unsigned int in the comment. It is like old alpha except for the wrong comment. ia64: Now dead. In FreeBSD-10, it was like old alpha except for having ALIGNBYTES = 15 instead of 7. This signed type gives the magic previously discussed. Another archaism from old alpha is spelling '& ~ALIGNBYTES' as '&~ ALIGNBYTES'. All arches except mips and powerpc now avoid the signed magic by spelling _ALIGNBYTES using sizeof(sizeof(foo_t)). sizeof() gives type size_t without spelling it as such, thus has no namespace problems in itself, and also gives the correct type (u_int or u_long) on all supported arches. However, using foo_t gives namespace problems. The namespace problems can also be avoided by including and using __foo_t instead of foo_t. I don't like that much, though its overhead is small since almost all headers end up including . Using literal constants also has the advantage of making _ALIGNBYTES usable in cpp expressions. Since it is an implementation detail, this is not very important. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 22:33:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4431035A; Wed, 5 Nov 2014 22:33:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8991B0; Wed, 5 Nov 2014 22:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5MXLbv034487; Wed, 5 Nov 2014 22:33:21 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5MXLVS034486; Wed, 5 Nov 2014 22:33:21 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201411052233.sA5MXLVS034486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Wed, 5 Nov 2014 22:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274147 - releng/10.1/etc X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 22:33:21 -0000 Author: wblock (doc committer) Date: Wed Nov 5 22:33:20 2014 New Revision: 274147 URL: https://svnweb.freebsd.org/changeset/base/274147 Log: MFC r274128: Add the less-ambiguous freebsd-version command. Approved by: re Modified: releng/10.1/etc/motd Directory Properties: releng/10.1/ (props changed) Modified: releng/10.1/etc/motd ============================================================================== --- releng/10.1/etc/motd Wed Nov 5 20:58:25 2014 (r274146) +++ releng/10.1/etc/motd Wed Nov 5 22:33:20 2014 (r274147) @@ -13,7 +13,7 @@ Documents installed with the system are directory, or can be installed later with: pkg install en-freebsd-doc For other languages, replace "en" with a language code like de or fr. -Show the version of FreeBSD installed: uname -a +Show the version of FreeBSD installed: freebsd-version ; uname -a Please include that output and any error messages when posting questions. Introduction to manual pages: man man FreeBSD directory layout: man hier From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 22:46:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EAF7A75; Wed, 5 Nov 2014 22:46:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29F59325; Wed, 5 Nov 2014 22:46:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5MkCGk039474; Wed, 5 Nov 2014 22:46:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5MkCh4039473; Wed, 5 Nov 2014 22:46:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411052246.sA5MkCh4039473@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 5 Nov 2014 22:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274148 - head/sbin/fsirand 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 22:46:12 -0000 Author: bapt Date: Wed Nov 5 22:46:11 2014 New Revision: 274148 URL: https://svnweb.freebsd.org/changeset/base/274148 Log: fsirand does not actually use libutil Modified: head/sbin/fsirand/Makefile Modified: head/sbin/fsirand/Makefile ============================================================================== --- head/sbin/fsirand/Makefile Wed Nov 5 22:33:20 2014 (r274147) +++ head/sbin/fsirand/Makefile Wed Nov 5 22:46:11 2014 (r274148) @@ -4,7 +4,5 @@ PROG= fsirand MAN= fsirand.8 WARNS?= 3 -DPADD= ${LIBUTIL} -LDADD= -lutil .include From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 22:50:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8609BF3; Wed, 5 Nov 2014 22:50:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94888353; Wed, 5 Nov 2014 22:50:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5MoYvU040104; Wed, 5 Nov 2014 22:50:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5MoY8K040103; Wed, 5 Nov 2014 22:50:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411052250.sA5MoY8K040103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Nov 2014 22:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274149 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 22:50:34 -0000 Author: markj Date: Wed Nov 5 22:50:33 2014 New Revision: 274149 URL: https://svnweb.freebsd.org/changeset/base/274149 Log: Create a directory for the PAM tests. Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Wed Nov 5 22:46:11 2014 (r274148) +++ head/etc/mtree/BSD.tests.dist Wed Nov 5 22:50:33 2014 (r274149) @@ -145,6 +145,8 @@ .. libnv .. + libpam + .. libproc .. libutil From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:04:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1BFD290; Wed, 5 Nov 2014 23:04:59 +0000 (UTC) Received: from mail-ig0-x233.google.com (mail-ig0-x233.google.com [IPv6:2607:f8b0:4001:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 880DA76F; Wed, 5 Nov 2014 23:04:59 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id r10so2368559igi.6 for ; Wed, 05 Nov 2014 15:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=q/uXvTWj5Xo8QgMx5/TAgwnXHlnzF0es88IthhzSaHA=; b=KbyZOBpHq5+vAjb5rhBSXAO21E5tdqREjE43XxN2veb5t+XtIM5vlph46XmvFcsD6w 4FX7w+oh1n92DYEIZc03v07hahAhvbAKxgfY2ACzZYrVWVFeH8ckG6yO2R07BuseU0So gPEv2c1XyYRtq9Dgrti2nTDBHO53HoRM72ugofVrCDIkjZ3lTKjcY82nxhvOIzUQwPW+ 93ewyl+nClc935NR470Ubp8CHkp2bm1irRk8w+ICweq52B50fGgyFJCgyfQiXyr365+l 6KFLMFK1Ym/74Sx2YudwQzDqrfKAyuGXYNX71bab6gmVFqFElT1AVfWFPX90aMeiH1Pc FsnA== MIME-Version: 1.0 X-Received: by 10.107.18.1 with SMTP id a1mr374118ioj.83.1415228698459; Wed, 05 Nov 2014 15:04:58 -0800 (PST) Received: by 10.50.235.49 with HTTP; Wed, 5 Nov 2014 15:04:58 -0800 (PST) In-Reply-To: <201411052250.sA5MoY8K040103@svn.freebsd.org> References: <201411052250.sA5MoY8K040103@svn.freebsd.org> Date: Wed, 5 Nov 2014 15:04:58 -0800 Message-ID: Subject: Re: svn commit: r274149 - head/etc/mtree From: NGie Cooper To: Mark Johnston Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:04:59 -0000 On Wed, Nov 5, 2014 at 2:50 PM, Mark Johnston wrote: > Author: markj > Date: Wed Nov 5 22:50:33 2014 > New Revision: 274149 > URL: https://svnweb.freebsd.org/changeset/base/274149 > > Log: > Create a directory for the PAM tests. Thanks Mark! From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:06:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5677A3E1; Wed, 5 Nov 2014 23:06:17 +0000 (UTC) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D01D77D; Wed, 5 Nov 2014 23:06:17 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id y20so1834199ier.11 for ; Wed, 05 Nov 2014 15:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=udbYhbxyJYt7C3G3lp4nD874woMtdHnAQVx5Qas7Oys=; b=dIOdU3XaJEIBDqVwESYyeTjIpl7it8Isd7M0bxVUHzJFiJkB5EXOAHBBwq4d25w4m3 gAcGUjS/u+ZWHUo6O9yd3GweRRMR/cTh/nusPijMAX4pp2mn0LYyuDxPaFa9Djq9Xiar S8VJZ/HxmDQL2ElRoIZnK7OFHlg2ydmVVhvBYYue1ujbyI/EvitgoYBqtCCozA6hnTYx 9BDDP+080TAGUp/bBNYWkM33EDmkhpH85ej4u+i74NZ4RksXiz8IPzsoeg6g6WuXkrvL IkkHVy9ul+H9NTA8bjXgjj5cmKTiPMs3VRcaOjE/dRDpgq0YEFKzg0We6UcPV2Ifs+8R HP5Q== MIME-Version: 1.0 X-Received: by 10.50.43.200 with SMTP id y8mr35628361igl.7.1415228776587; Wed, 05 Nov 2014 15:06:16 -0800 (PST) Received: by 10.50.235.49 with HTTP; Wed, 5 Nov 2014 15:06:16 -0800 (PST) In-Reply-To: <201411052058.sA5KwQCW088046@svn.freebsd.org> References: <201411052058.sA5KwQCW088046@svn.freebsd.org> Date: Wed, 5 Nov 2014 15:06:16 -0800 Message-ID: Subject: Re: svn commit: r274146 - in head: lib/libdpv usr.bin/dpv From: NGie Cooper To: Devin Teske Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:06:17 -0000 On Wed, Nov 5, 2014 at 12:58 PM, Devin Teske wrote: > Author: dteske > Date: Wed Nov 5 20:58:25 2014 > New Revision: 274146 > URL: https://svnweb.freebsd.org/changeset/base/274146 > > Log: > Balance DPADD against LDADD for dpv(1,3). > > Thanks to: ngie > MFC after: 21 days > X-MFC-to: stable/10 stable/9 > X-MFC-with: 274116 274120 274121 274123 274144 Thank you Devin! From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:12:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA2AB765; Wed, 5 Nov 2014 23:12:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B95A85B; Wed, 5 Nov 2014 23:12:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NCeoS053383; Wed, 5 Nov 2014 23:12:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NCeTK053382; Wed, 5 Nov 2014 23:12:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201411052312.sA5NCeTK053382@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 5 Nov 2014 23:12: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: r274150 - stable/10/sys/fs/nfsclient 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:12:40 -0000 Author: rmacklem Date: Wed Nov 5 23:12:39 2014 New Revision: 274150 URL: https://svnweb.freebsd.org/changeset/base/274150 Log: MFC: r273486 Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 22:50:33 2014 (r274149) +++ stable/10/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:12:39 2014 (r274150) @@ -621,17 +621,27 @@ nfs_decode_args(struct mount *mp, struct if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* Round down to multiple of blocksize */ - nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_wsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_wsize > NFS_FABLKSIZE) + nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1); + else nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* Round down to multiple of blocksize */ - nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_rsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_rsize > NFS_FABLKSIZE) + nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1); + else nmp->nm_rsize = NFS_FABLKSIZE; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:54:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2A7D52F; Wed, 5 Nov 2014 23:54:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAD2C90; Wed, 5 Nov 2014 23:54:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NsYPE072332; Wed, 5 Nov 2014 23:54:34 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NsXTX072329; Wed, 5 Nov 2014 23:54:33 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411052354.sA5NsXTX072329@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 23:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274151 - head/usr.bin/w 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:54:34 -0000 Author: marcel Date: Wed Nov 5 23:54:33 2014 New Revision: 274151 URL: https://svnweb.freebsd.org/changeset/base/274151 Log: Convert to use libxo. Obtained from: Phil Shafer Sponsored by: Juniper Networks, Inc. Modified: head/usr.bin/w/Makefile head/usr.bin/w/pr_time.c head/usr.bin/w/w.c Modified: head/usr.bin/w/Makefile ============================================================================== --- head/usr.bin/w/Makefile Wed Nov 5 23:12:39 2014 (r274150) +++ head/usr.bin/w/Makefile Wed Nov 5 23:54:33 2014 (r274151) @@ -4,8 +4,8 @@ PROG= w SRCS= fmt.c pr_time.c proc_compare.c w.c MAN= w.1 uptime.1 -DPADD= ${LIBKVM} ${LIBUTIL} -LDADD= -lkvm -lutil +DPADD= ${LIBKVM} ${LIBUTIL} ${LIBXO} +LDADD= -lkvm -lutil -lxo #BINGRP= kmem #BINMODE=2555 LINKS= ${BINDIR}/w ${BINDIR}/uptime Modified: head/usr.bin/w/pr_time.c ============================================================================== --- head/usr.bin/w/pr_time.c Wed Nov 5 23:12:39 2014 (r274150) +++ head/usr.bin/w/pr_time.c Wed Nov 5 23:54:33 2014 (r274151) @@ -41,6 +41,7 @@ static const char sccsid[] = "@(#)pr_tim #include #include #include +#include #include "extern.h" @@ -82,12 +83,14 @@ pr_attime(time_t *started, time_t *now) (void)wcsftime(buf, sizeof(buf), fmt, &tp); len = wcslen(buf); width = wcswidth(buf, len); + xo_attr("since", "%lu", (unsigned long) *started); + xo_attr("delta", "%lu", (unsigned long) diff); if (len == width) - (void)wprintf(L"%-7.7ls", buf); + xo_emit("{:login-time/%-7.7ls/%ls}", buf); else if (width < 7) - (void)wprintf(L"%ls%.*s", buf, 7 - width, " "); + xo_emit("{:login-time/%ls}%.*s", buf, 7 - width, " "); else { - (void)wprintf(L"%ls", buf); + xo_emit("{:login-time/%ls}", buf); offset = width - 7; } return (offset); @@ -104,7 +107,7 @@ pr_idle(time_t idle) /* If idle more than 36 hours, print as a number of days. */ if (idle >= 36 * 3600) { int days = idle / 86400; - (void)printf(" %dday%s ", days, days > 1 ? "s" : " " ); + xo_emit(" {:idle/%dday%s} ", days, days > 1 ? "s" : " " ); if (days >= 100) return (2); if (days >= 10) @@ -113,15 +116,15 @@ pr_idle(time_t idle) /* If idle more than an hour, print as HH:MM. */ else if (idle >= 3600) - (void)printf(" %2d:%02d ", + xo_emit(" {:idle/%2d:%02d/} ", (int)(idle / 3600), (int)((idle % 3600) / 60)); else if (idle / 60 == 0) - (void)printf(" - "); + xo_emit(" - "); /* Else print the minutes idle. */ else - (void)printf(" %2d ", (int)(idle / 60)); + xo_emit(" {:idle/%2d} ", (int)(idle / 60)); return (0); /* not idle longer than 9 days */ } Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Wed Nov 5 23:12:39 2014 (r274150) +++ head/usr.bin/w/w.c Wed Nov 5 23:54:33 2014 (r274151) @@ -83,6 +83,7 @@ static const char sccsid[] = "@(#)w.c 8. #include #include #include +#include #include "extern.h" @@ -133,7 +134,7 @@ main(int argc, char *argv[]) struct stat *stp; time_t touched; int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid; - const char *memf, *nlistf, *p; + const char *memf, *nlistf, *p, *save_p; char *x_suffix; char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX]; char fn[MAXHOSTNAMELEN]; @@ -143,6 +144,10 @@ main(int argc, char *argv[]) use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); use_comma = (*nl_langinfo(RADIXCHAR) != ','); + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + /* Are we w(1) or uptime(1)? */ if (strcmp(basename(argv[0]), "uptime") == 0) { wcmd = 0; @@ -254,9 +259,12 @@ main(int argc, char *argv[]) } endutxent(); + xo_open_container("uptime-information"); + if (header || wcmd == 0) { pr_header(&now, nusers); if (wcmd == 0) { + xo_close_container("uptime-information"); (void)kvm_close(kd); exit(0); } @@ -268,7 +276,7 @@ main(int argc, char *argv[]) #define HEADER_WHAT "WHAT\n" #define WUSED (W_DISPUSERSIZE + W_DISPLINESIZE + W_DISPHOSTSIZE + \ sizeof(HEADER_LOGIN_IDLE) + 3) /* header width incl. spaces */ - (void)printf("%-*.*s %-*.*s %-*.*s %s", + xo_emit("{T:/%-*.*s} {T:/%-*.*s} {T:/%-*.*s} {T:/%s}", W_DISPUSERSIZE, W_DISPUSERSIZE, HEADER_USER, W_DISPLINESIZE, W_DISPLINESIZE, HEADER_TTY, W_DISPHOSTSIZE, W_DISPHOSTSIZE, HEADER_FROM, @@ -342,6 +350,9 @@ main(int argc, char *argv[]) } } + xo_open_container("user-table"); + xo_open_list("user-entry"); + for (ep = ehead; ep != NULL; ep = ep->next) { struct addrinfo hints, *res; struct sockaddr_storage ss; @@ -351,7 +362,9 @@ main(int argc, char *argv[]) time_t t; int isaddr; - p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; + xo_open_instance("user-entry"); + + save_p = p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; if ((x_suffix = strrchr(p, ':')) != NULL) { if ((dot = strchr(x_suffix, '.')) != NULL && strchr(dot+1, '.') == NULL) @@ -400,6 +413,9 @@ main(int argc, char *argv[]) p = buf; } if (dflag) { + xo_open_container("process-table"); + xo_open_list("process-entry"); + for (dkp = ep->dkp; dkp != NULL; dkp = debugproc(dkp)) { const char *ptr; @@ -407,24 +423,41 @@ main(int argc, char *argv[]) dkp->ki_comm, NULL, MAXCOMLEN); if (ptr == NULL) ptr = "-"; - (void)printf("\t\t%-9d %s\n", + xo_open_instance("process-entry"); + xo_emit("\t\t{:process-id/%-9d/%d} {:command/%s}\n", dkp->ki_pid, ptr); + xo_close_instance("process-entry"); } + xo_close_list("process-entry"); + xo_close_container("process-table"); } - (void)printf("%-*.*s %-*.*s %-*.*s ", - W_DISPUSERSIZE, W_DISPUSERSIZE, ep->utmp.ut_user, - W_DISPLINESIZE, W_DISPLINESIZE, - *ep->utmp.ut_line ? - (strncmp(ep->utmp.ut_line, "tty", 3) && - strncmp(ep->utmp.ut_line, "cua", 3) ? - ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-", + xo_emit("{:user/%-*.*s/%@**@s} {:tty/%-*.*s/%@**@s} ", + W_DISPUSERSIZE, W_DISPUSERSIZE, ep->utmp.ut_user, + W_DISPLINESIZE, W_DISPLINESIZE, + *ep->utmp.ut_line ? + (strncmp(ep->utmp.ut_line, "tty", 3) && + strncmp(ep->utmp.ut_line, "cua", 3) ? + ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-"); + + if (save_p && save_p != p) + xo_attr("address", "%s", save_p); + xo_emit("{:from/%-*.*s/%@**@s} ", W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); t = ep->utmp.ut_tv.tv_sec; longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); - (void)printf("%.*s\n", argwidth - longidle - longattime, + xo_emit("{:command/%.*s/%@*@s}\n", + argwidth - longidle - longattime, ep->args); + + xo_close_instance("user-entry"); } + + xo_close_list("user-entry"); + xo_close_container("user-table"); + xo_close_container("uptime-information"); + xo_finish(); + (void)kvm_close(kd); exit(0); } @@ -443,7 +476,7 @@ pr_header(time_t *nowp, int nusers) */ if (strftime(buf, sizeof(buf), use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp)) != 0) - (void)printf("%s ", buf); + xo_emit("{:time-of-day/%s} ", buf); /* * Print how long system has been up. */ @@ -457,35 +490,45 @@ pr_header(time_t *nowp, int nusers) uptime %= 3600; mins = uptime / 60; secs = uptime % 60; - (void)printf(" up"); + xo_emit(" up"); + xo_attr("seconds", "%lu", (unsigned long) tp.tv_sec); if (days > 0) - (void)printf(" %d day%s,", days, days > 1 ? "s" : ""); + xo_emit(" {:uptime/%d day%s},", + days, days > 1 ? "s" : ""); if (hrs > 0 && mins > 0) - (void)printf(" %2d:%02d,", hrs, mins); + xo_emit(" {:uptime/%2d:%02d},", hrs, mins); else if (hrs > 0) - (void)printf(" %d hr%s,", hrs, hrs > 1 ? "s" : ""); + xo_emit(" {:uptime/%d hr%s},", + hrs, hrs > 1 ? "s" : ""); else if (mins > 0) - (void)printf(" %d min%s,", mins, mins > 1 ? "s" : ""); + xo_emit(" {:uptime/%d min%s},", + mins, mins > 1 ? "s" : ""); else - (void)printf(" %d sec%s,", secs, secs > 1 ? "s" : ""); + xo_emit(" {:uptime/%d sec%s},", + secs, secs > 1 ? "s" : ""); } /* Print number of users logged in to system */ - (void)printf(" %d user%s", nusers, nusers == 1 ? "" : "s"); + xo_emit(" {:users/%d} user%s", nusers, nusers == 1 ? "" : "s"); /* * Print 1, 5, and 15 minute load averages. */ if (getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])) == -1) - (void)printf(", no load average information available\n"); + xo_emit(", no load average information available\n"); else { - (void)printf(", load averages:"); + static const char *format[] = { + " {:load-average-1/%.2f}", + " {:load-average-5/%.2f}", + " {:load-average-15/%.2f}", + }; + xo_emit(", load averages:"); for (i = 0; i < (int)(sizeof(avenrun) / sizeof(avenrun[0])); i++) { if (use_comma && i > 0) - (void)printf(","); - (void)printf(" %.2f", avenrun[i]); + xo_emit(","); + xo_emit(format[i], avenrun[i]); } - (void)printf("\n"); + xo_emit("\n"); } } @@ -506,9 +549,8 @@ static void usage(int wcmd) { if (wcmd) - (void)fprintf(stderr, - "usage: w [-dhin] [-M core] [-N system] [user ...]\n"); + xo_error("usage: w [-dhin] [-M core] [-N system] [user ...]\n"); else - (void)fprintf(stderr, "usage: uptime\n"); + xo_error("usage: uptime\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:57:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E3726C0; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FBC0CB3; Wed, 5 Nov 2014 23:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5NvYCN072816; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5NvYjw072815; Wed, 5 Nov 2014 23:57:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201411052357.sA5NvYjw072815@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 5 Nov 2014 23:57:34 +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: r274152 - stable/9/sys/fs/nfsclient 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:57:34 -0000 Author: rmacklem Date: Wed Nov 5 23:57:33 2014 New Revision: 274152 URL: https://svnweb.freebsd.org/changeset/base/274152 Log: MFC: r273486 Clip the settings for the NFS rsize, wsize mount options to a power of 2. For non-power of 2 settings, intermittent page faults have been reported. Although the bug that causes these page faults/crashes has not been identified, it does not appear to occur when rsize, wsize is a power of 2. Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:54:33 2014 (r274151) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Wed Nov 5 23:57:33 2014 (r274152) @@ -615,17 +615,27 @@ nfs_decode_args(struct mount *mp, struct if ((argp->flags & NFSMNT_WSIZE) && argp->wsize > 0) { nmp->nm_wsize = argp->wsize; - /* Round down to multiple of blocksize */ - nmp->nm_wsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_wsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_wsize > NFS_FABLKSIZE) + nmp->nm_wsize = 1 << (fls(nmp->nm_wsize) - 1); + else nmp->nm_wsize = NFS_FABLKSIZE; } if ((argp->flags & NFSMNT_RSIZE) && argp->rsize > 0) { nmp->nm_rsize = argp->rsize; - /* Round down to multiple of blocksize */ - nmp->nm_rsize &= ~(NFS_FABLKSIZE - 1); - if (nmp->nm_rsize <= 0) + /* + * Clip at the power of 2 below the size. There is an + * issue (not isolated) that causes intermittent page + * faults if this is not done. + */ + if (nmp->nm_rsize > NFS_FABLKSIZE) + nmp->nm_rsize = 1 << (fls(nmp->nm_rsize) - 1); + else nmp->nm_rsize = NFS_FABLKSIZE; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 5 23:59:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C00087C; Wed, 5 Nov 2014 23:59:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481B3CD8; Wed, 5 Nov 2014 23:59:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA5Nxrwj073164; Wed, 5 Nov 2014 23:59:53 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA5Nxrnq073163; Wed, 5 Nov 2014 23:59:53 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411052359.sA5Nxrnq073163@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Wed, 5 Nov 2014 23:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274153 - head/usr.bin/w 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2014 23:59:53 -0000 Author: marcel Date: Wed Nov 5 23:59:52 2014 New Revision: 274153 URL: https://svnweb.freebsd.org/changeset/base/274153 Log: Document that w(1) supports libxo(3). Modified: head/usr.bin/w/w.1 Modified: head/usr.bin/w/w.1 ============================================================================== --- head/usr.bin/w/w.1 Wed Nov 5 23:57:33 2014 (r274152) +++ head/usr.bin/w/w.1 Wed Nov 5 23:59:52 2014 (r274153) @@ -28,7 +28,7 @@ .\" @(#)w.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 21, 2010 +.Dd November 5, 2014 .Dt W 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nd "display who is logged in and what they are doing" .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl dhin .Op Fl M Ar core .Op Fl N Ar system @@ -97,8 +98,10 @@ and flags are no longer supported. .Sh SEE ALSO .Xr finger 1 , +.Xr libxo 3 , .Xr ps 1 , .Xr uptime 1 , +.Xr xo_parse_args 3 , .Xr who 1 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 00:48:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC5A14D0; Thu, 6 Nov 2014 00:48:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9700B204; Thu, 6 Nov 2014 00:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA60md02097629; Thu, 6 Nov 2014 00:48:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA60ma0L097611; Thu, 6 Nov 2014 00:48:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411060048.sA60ma0L097611@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Nov 2014 00:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274154 - in head: sys/cam/ctl sys/cam/scsi sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/geom sys/sys usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 00:48:39 -0000 Author: mav Date: Thu Nov 6 00:48:36 2014 New Revision: 274154 URL: https://svnweb.freebsd.org/changeset/base/274154 Log: Add to CTL support for logical block provisioning threshold notifications. For ZVOL-backed LUNs this allows to inform initiators if storage's used or available spaces get above/below the configured thresholds. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/geom/geom_dev.c head/sys/sys/disk.h head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl.c Thu Nov 6 00:48:36 2014 (r274154) @@ -137,7 +137,7 @@ static struct scsi_da_rw_recovery_page r /*correction_span*/0, /*head_offset_count*/0, /*data_strobe_offset_cnt*/0, - /*byte8*/0, + /*byte8*/SMS_RWER_LBPERE, /*write_retry_count*/0, /*reserved2*/0, /*recovery_time_limit*/{0, 0}, @@ -297,22 +297,58 @@ static struct scsi_info_exceptions_page /*report_count*/{0, 0, 0, 0} }; -static struct scsi_logical_block_provisioning_page lbp_page_default = { +#define CTL_LBPM_LEN (sizeof(struct ctl_logical_block_provisioning_page) - 4) + +static struct ctl_logical_block_provisioning_page lbp_page_default = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, - /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, /*flags*/0, /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - /*descr*/{} + /*descr*/{}}, + {{/*flags*/0, + /*resource*/0x01, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0x02, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0xf1, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0xf2, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}} + } }; -static struct scsi_logical_block_provisioning_page lbp_page_changeable = { +static struct ctl_logical_block_provisioning_page lbp_page_changeable = {{ /*page_code*/SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, /*subpage_code*/0x02, - /*page_length*/{0, sizeof(struct scsi_logical_block_provisioning_page) - 4}, + /*page_length*/{CTL_LBPM_LEN >> 8, CTL_LBPM_LEN}, /*flags*/0, /*reserved*/{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - /*descr*/{} + /*descr*/{}}, + {{/*flags*/0, + /*resource*/0, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}}, + {/*flags*/0, + /*resource*/0, + /*reserved*/{0, 0}, + /*count*/{0, 0, 0, 0}} + } }; /* @@ -447,6 +483,7 @@ static void ctl_datamove_remote_read(uni static void ctl_datamove_remote(union ctl_io *io); static int ctl_process_done(union ctl_io *io); static void ctl_lun_thread(void *arg); +static void ctl_thresh_thread(void *arg); static void ctl_work_thread(void *arg); static void ctl_enqueue_incoming(union ctl_io *io); static void ctl_enqueue_rtr(union ctl_io *io); @@ -1085,6 +1122,15 @@ ctl_init(void) ctl_pool_free(other_pool); return (error); } + error = kproc_kthread_add(ctl_thresh_thread, softc, + &softc->ctl_proc, NULL, 0, 0, "ctl", "thresh"); + if (error != 0) { + printf("error creating CTL threshold thread!\n"); + ctl_pool_free(internal_pool); + ctl_pool_free(emergency_pool); + ctl_pool_free(other_pool); + return (error); + } if (bootverbose) printf("ctl: CAM Target Layer loaded\n"); @@ -3991,6 +4037,52 @@ ctl_copy_io(union ctl_io *src, union ctl dest->io_hdr.flags |= CTL_FLAG_INT_COPY; } +static int +ctl_expand_number(const char *buf, uint64_t *num) +{ + char *endptr; + uint64_t number; + unsigned shift; + + number = strtoq(buf, &endptr, 0); + + switch (tolower((unsigned char)*endptr)) { + case 'e': + shift = 60; + break; + case 'p': + shift = 50; + break; + case 't': + shift = 40; + break; + case 'g': + shift = 30; + break; + case 'm': + shift = 20; + break; + case 'k': + shift = 10; + break; + case 'b': + case '\0': /* No unit. */ + *num = number; + return (0); + default: + /* Unrecognized unit. */ + return (-1); + } + + if ((number << shift) >> shift != number) { + /* Overflow */ + return (-1); + } + *num = number << shift; + return (0); +} + + /* * This routine could be used in the future to load default and/or saved * mode page parameters for a particuar lun. @@ -4001,6 +4093,7 @@ ctl_init_page_index(struct ctl_lun *lun) int i; struct ctl_page_index *page_index; const char *value; + uint64_t ival; memcpy(&lun->mode_pages.index, page_index_template, sizeof(page_index_template)); @@ -4245,22 +4338,77 @@ ctl_init_page_index(struct ctl_lun *lun) page_index->page_data = (uint8_t *)lun->mode_pages.ie_page; break; - case 0x02: - memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_CURRENT], + case 0x02: { + struct ctl_logical_block_provisioning_page *page; + + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_DEFAULT], &lbp_page_default, sizeof(lbp_page_default)); memcpy(&lun->mode_pages.lbp_page[ CTL_PAGE_CHANGEABLE], &lbp_page_changeable, sizeof(lbp_page_changeable)); - memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_DEFAULT], - &lbp_page_default, - sizeof(lbp_page_default)); memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_SAVED], &lbp_page_default, sizeof(lbp_page_default)); + page = &lun->mode_pages.lbp_page[CTL_PAGE_SAVED]; + value = ctl_get_opt(&lun->be_lun->options, + "avail-threshold"); + if (value != NULL && + ctl_expand_number(value, &ival) == 0) { + page->descr[0].flags |= SLBPPD_ENABLED | + SLBPPD_ARMING_DEC; + if (lun->be_lun->blocksize) + ival /= lun->be_lun->blocksize; + else + ival /= 512; + scsi_ulto4b(ival >> CTL_LBP_EXPONENT, + page->descr[0].count); + } + value = ctl_get_opt(&lun->be_lun->options, + "used-threshold"); + if (value != NULL && + ctl_expand_number(value, &ival) == 0) { + page->descr[1].flags |= SLBPPD_ENABLED | + SLBPPD_ARMING_INC; + if (lun->be_lun->blocksize) + ival /= lun->be_lun->blocksize; + else + ival /= 512; + scsi_ulto4b(ival >> CTL_LBP_EXPONENT, + page->descr[1].count); + } + value = ctl_get_opt(&lun->be_lun->options, + "pool-avail-threshold"); + if (value != NULL && + ctl_expand_number(value, &ival) == 0) { + page->descr[2].flags |= SLBPPD_ENABLED | + SLBPPD_ARMING_DEC; + if (lun->be_lun->blocksize) + ival /= lun->be_lun->blocksize; + else + ival /= 512; + scsi_ulto4b(ival >> CTL_LBP_EXPONENT, + page->descr[2].count); + } + value = ctl_get_opt(&lun->be_lun->options, + "pool-used-threshold"); + if (value != NULL && + ctl_expand_number(value, &ival) == 0) { + page->descr[3].flags |= SLBPPD_ENABLED | + SLBPPD_ARMING_INC; + if (lun->be_lun->blocksize) + ival /= lun->be_lun->blocksize; + else + ival /= 512; + scsi_ulto4b(ival >> CTL_LBP_EXPONENT, + page->descr[3].count); + } + memcpy(&lun->mode_pages.lbp_page[CTL_PAGE_CURRENT], + &lun->mode_pages.lbp_page[CTL_PAGE_SAVED], + sizeof(lbp_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.lbp_page; - } + }} break; } case SMS_VENDOR_SPECIFIC_PAGE:{ @@ -4319,13 +4467,13 @@ static int ctl_init_log_page_index(struct ctl_lun *lun) { struct ctl_page_index *page_index; - int i, j, prev; + int i, j, k, prev; memcpy(&lun->log_pages.index, log_page_index_template, sizeof(log_page_index_template)); prev = -1; - for (i = 0, j = 0; i < CTL_NUM_LOG_PAGES; i++) { + for (i = 0, j = 0, k = 0; i < CTL_NUM_LOG_PAGES; i++) { page_index = &lun->log_pages.index[i]; /* @@ -4338,18 +4486,26 @@ ctl_init_log_page_index(struct ctl_lun * && (page_index->page_flags & CTL_PAGE_FLAG_DISK_ONLY)) continue; + if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING && + ((lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || + lun->backend->lun_attr == NULL)) + continue; + if (page_index->page_code != prev) { lun->log_pages.pages_page[j] = page_index->page_code; prev = page_index->page_code; j++; } - lun->log_pages.subpages_page[i*2] = page_index->page_code; - lun->log_pages.subpages_page[i*2+1] = page_index->subpage; + lun->log_pages.subpages_page[k*2] = page_index->page_code; + lun->log_pages.subpages_page[k*2+1] = page_index->subpage; + k++; } lun->log_pages.index[0].page_data = &lun->log_pages.pages_page[0]; lun->log_pages.index[0].page_len = j; lun->log_pages.index[1].page_data = &lun->log_pages.subpages_page[0]; - lun->log_pages.index[1].page_len = i * 2; + lun->log_pages.index[1].page_len = k * 2; + lun->log_pages.index[2].page_data = &lun->log_pages.lbp_page[0]; + lun->log_pages.index[2].page_len = 12*CTL_NUM_LBP_PARAMS; return (CTL_RETVAL_COMPLETE); } @@ -6938,6 +7094,75 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } int +ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc) +{ + struct ctl_lun *lun; + struct scsi_log_param_header *phdr; + uint8_t *data; + uint64_t val; + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + data = page_index->page_data; + + if (lun->backend->lun_attr != NULL && + (val = lun->backend->lun_attr(lun->be_lun->be_lun, "blocksavail")) + != UINT64_MAX) { + phdr = (struct scsi_log_param_header *)data; + scsi_ulto2b(0x0001, phdr->param_code); + phdr->param_control = SLP_LBIN | SLP_LP; + phdr->param_len = 8; + data = (uint8_t *)(phdr + 1); + scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); + data[4] = 0x01; /* per-LUN */ + data += phdr->param_len; + } + + if (lun->backend->lun_attr != NULL && + (val = lun->backend->lun_attr(lun->be_lun->be_lun, "blocksused")) + != UINT64_MAX) { + phdr = (struct scsi_log_param_header *)data; + scsi_ulto2b(0x0002, phdr->param_code); + phdr->param_control = SLP_LBIN | SLP_LP; + phdr->param_len = 8; + data = (uint8_t *)(phdr + 1); + scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); + data[4] = 0x02; /* per-pool */ + data += phdr->param_len; + } + + if (lun->backend->lun_attr != NULL && + (val = lun->backend->lun_attr(lun->be_lun->be_lun, "poolblocksavail")) + != UINT64_MAX) { + phdr = (struct scsi_log_param_header *)data; + scsi_ulto2b(0x00f1, phdr->param_code); + phdr->param_control = SLP_LBIN | SLP_LP; + phdr->param_len = 8; + data = (uint8_t *)(phdr + 1); + scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); + data[4] = 0x02; /* per-pool */ + data += phdr->param_len; + } + + if (lun->backend->lun_attr != NULL && + (val = lun->backend->lun_attr(lun->be_lun->be_lun, "poolblocksused")) + != UINT64_MAX) { + phdr = (struct scsi_log_param_header *)data; + scsi_ulto2b(0x00f2, phdr->param_code); + phdr->param_control = SLP_LBIN | SLP_LP; + phdr->param_len = 8; + data = (uint8_t *)(phdr + 1); + scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); + data[4] = 0x02; /* per-pool */ + data += phdr->param_len; + } + + page_index->page_len = data - page_index->page_data; + return (0); +} + +int ctl_log_sense(struct ctl_scsiio *ctsio) { struct ctl_lun *lun; @@ -10245,9 +10470,10 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->page_code = SVPD_LBP; scsi_ulto2b(sizeof(*lbp_ptr) - 4, lbp_ptr->page_length); if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; - lbp_ptr->prov_type = SVPD_LBP_RESOURCE; + lbp_ptr->prov_type = SVPD_LBP_THIN; } ctsio->scsi_status = SCSI_STATUS_OK; @@ -13994,6 +14220,88 @@ ctl_lun_thread(void *arg) } static void +ctl_thresh_thread(void *arg) +{ + struct ctl_softc *softc = (struct ctl_softc *)arg; + struct ctl_lun *lun; + struct ctl_be_lun *be_lun; + struct scsi_da_rw_recovery_page *rwpage; + struct ctl_logical_block_provisioning_page *page; + const char *attr; + uint64_t thres, val; + int i, e; + + CTL_DEBUG_PRINT(("ctl_thresh_thread starting\n")); + + for (;;) { + mtx_lock(&softc->ctl_lock); + STAILQ_FOREACH(lun, &softc->lun_list, links) { + be_lun = lun->be_lun; + if ((lun->flags & CTL_LUN_DISABLED) || + (lun->flags & CTL_LUN_OFFLINE) || + (be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || + lun->backend->lun_attr == NULL) + continue; + rwpage = &lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT]; + if ((rwpage->byte8 & SMS_RWER_LBPERE) == 0) + continue; + e = 0; + page = &lun->mode_pages.lbp_page[CTL_PAGE_CURRENT]; + for (i = 0; i < CTL_NUM_LBP_THRESH; i++) { + if ((page->descr[i].flags & SLBPPD_ENABLED) == 0) + continue; + thres = scsi_4btoul(page->descr[i].count); + thres <<= CTL_LBP_EXPONENT; + switch (page->descr[i].resource) { + case 0x01: + attr = "blocksavail"; + break; + case 0x02: + attr = "blocksused"; + break; + case 0xf1: + attr = "poolblocksavail"; + break; + case 0xf2: + attr = "poolblocksused"; + break; + default: + continue; + } + mtx_unlock(&softc->ctl_lock); // XXX + val = lun->backend->lun_attr( + lun->be_lun->be_lun, attr); + mtx_lock(&softc->ctl_lock); + if (val == UINT64_MAX) + continue; + if ((page->descr[i].flags & SLBPPD_ARMING_MASK) + == SLBPPD_ARMING_INC) + e |= (val >= thres); + else + e |= (val <= thres); + } + mtx_lock(&lun->lun_lock); + if (e) { + if (lun->lasttpt == 0 || + time_uptime - lun->lasttpt >= CTL_LBP_UA_PERIOD) { + lun->lasttpt = time_uptime; + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_ua[i] |= + CTL_UA_THIN_PROV_THRES; + } + } else { + lun->lasttpt = 0; + for (i = 0; i < CTL_MAX_INITIATORS; i++) + lun->pending_ua[i] &= ~CTL_UA_THIN_PROV_THRES; + } + mtx_unlock(&lun->lun_lock); + } + mtx_unlock(&softc->ctl_lock); + pause("-", CTL_LBP_PERIOD * hz); + } +} + +static void ctl_enqueue_incoming(union ctl_io *io) { struct ctl_softc *softc = control_softc; Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl.h Thu Nov 6 00:48:36 2014 (r274154) @@ -127,7 +127,8 @@ typedef enum { CTL_UA_RES_RELEASE = 0x0800, CTL_UA_REG_PREEMPT = 0x1000, CTL_UA_ASYM_ACC_CHANGE = 0x2000, - CTL_UA_CAPACITY_CHANGED = 0x4000 + CTL_UA_CAPACITY_CHANGED = 0x4000, + CTL_UA_THIN_PROV_THRES = 0x8000 } ctl_ua_type; #ifdef _KERNEL @@ -178,6 +179,9 @@ int ctl_debugconf_sp_sense_handler(struc int ctl_debugconf_sp_select_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr); +int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc); int ctl_config_move_done(union ctl_io *io); void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl_backend.h Thu Nov 6 00:48:36 2014 (r274154) @@ -218,6 +218,7 @@ typedef void (*be_vfunc_t)(union ctl_io typedef int (*be_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); typedef int (*be_luninfo_t)(void *be_lun, struct sbuf *sb); +typedef uint64_t (*be_lunattr_t)(void *be_lun, const char *attrname); struct ctl_backend_driver { char name[CTL_BE_NAME_LEN]; /* passed to CTL */ @@ -229,6 +230,7 @@ struct ctl_backend_driver { be_func_t config_write; /* passed to CTL */ be_ioctl_t ioctl; /* passed to CTL */ be_luninfo_t lun_info; /* passed to CTL */ + be_lunattr_t lun_attr; /* passed to CTL */ #ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED be_func_t config_move_done; /* passed to backend */ #endif Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Nov 6 00:48:36 2014 (r274154) @@ -145,6 +145,8 @@ struct ctl_be_block_lun; typedef void (*cbb_dispatch_t)(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +typedef uint64_t (*cbb_getattr_t)(struct ctl_be_block_lun *be_lun, + const char *attrname); /* * Backend LUN structure. There is a 1:1 mapping between a block device @@ -161,6 +163,7 @@ struct ctl_be_block_lun { cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; cbb_dispatch_t unmap; + cbb_getattr_t getattr; uma_zone_t lun_zone; uint64_t size_blocks; uint64_t size_bytes; @@ -240,6 +243,8 @@ static void ctl_be_block_unmap_dev(struc struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static uint64_t ctl_be_block_getattr_dev(struct ctl_be_block_lun *be_lun, + const char *attrname); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, @@ -272,6 +277,7 @@ static void ctl_be_block_lun_config_stat static int ctl_be_block_config_write(union ctl_io *io); static int ctl_be_block_config_read(union ctl_io *io); static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb); +static uint64_t ctl_be_block_lun_attr(void *be_lun, const char *attrname); int ctl_be_block_init(void); static struct ctl_backend_driver ctl_be_block_driver = @@ -284,7 +290,8 @@ static struct ctl_backend_driver ctl_be_ .config_read = ctl_be_block_config_read, .config_write = ctl_be_block_config_write, .ioctl = ctl_be_block_ioctl, - .lun_info = ctl_be_block_lun_info + .lun_info = ctl_be_block_lun_info, + .lun_attr = ctl_be_block_lun_attr }; MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); @@ -1012,6 +1019,24 @@ ctl_be_block_dispatch_dev(struct ctl_be_ } } +static uint64_t +ctl_be_block_getattr_dev(struct ctl_be_block_lun *be_lun, const char *attrname) +{ + struct ctl_be_block_devdata *dev_data = &be_lun->backend.dev; + struct diocgattr_arg arg; + int error; + + if (dev_data->csw == NULL || dev_data->csw->d_ioctl == NULL) + return (UINT64_MAX); + strlcpy(arg.name, attrname, sizeof(arg.name)); + arg.len = sizeof(arg.value.off); + error = dev_data->csw->d_ioctl(dev_data->cdev, + DIOCGATTR, (caddr_t)&arg, FREAD, curthread); + if (error != 0) + return (UINT64_MAX); + return (arg.value.off); +} + static void ctl_be_block_cw_done_ws(struct ctl_be_block_io *beio) { @@ -1647,6 +1672,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->dispatch = ctl_be_block_dispatch_dev; be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->unmap = ctl_be_block_unmap_dev; + be_lun->getattr = ctl_be_block_getattr_dev; error = VOP_GETATTR(be_lun->vn, &vattr, NOCRED); if (error) { @@ -1993,10 +2019,10 @@ ctl_be_block_create(struct ctl_be_block_ } num_threads = tmp_num_threads; } - unmap = 0; + unmap = (be_lun->dispatch == ctl_be_block_dispatch_zvol); value = ctl_get_opt(&be_lun->ctl_be_lun.options, "unmap"); - if (value != NULL && strcmp(value, "on") == 0) - unmap = 1; + if (value != NULL) + unmap = (strcmp(value, "on") == 0); be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; @@ -2582,6 +2608,16 @@ bailout: return (retval); } +static uint64_t +ctl_be_block_lun_attr(void *be_lun, const char *attrname) +{ + struct ctl_be_block_lun *lun = (struct ctl_be_block_lun *)be_lun; + + if (lun->getattr == NULL) + return (UINT64_MAX); + return (lun->getattr(lun, attrname)); +} + int ctl_be_block_init(void) { Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl_error.c Thu Nov 6 00:48:36 2014 (r274154) @@ -463,6 +463,11 @@ ctl_build_ua(ctl_ua_type *ua_type, struc asc = 0x2A; ascq = 0x09; break; + case CTL_UA_THIN_PROV_THRES: + /* 38h/07n THIN PROVISIONING SOFT THRESHOLD REACHED */ + asc = 0x38; + ascq = 0x07; + break; default: panic("ctl_build_ua: Unknown UA %x", ua_to_build); } Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/ctl/ctl_private.h Thu Nov 6 00:48:36 2014 (r274154) @@ -302,6 +302,17 @@ struct ctl_page_index { #define CTL_PAGE_DEFAULT 0x02 #define CTL_PAGE_SAVED 0x03 +#define CTL_NUM_LBP_PARAMS 4 +#define CTL_NUM_LBP_THRESH 4 +#define CTL_LBP_EXPONENT 11 /* 2048 sectors */ +#define CTL_LBP_PERIOD 10 /* 10 seconds */ +#define CTL_LBP_UA_PERIOD 300 /* 5 minutes */ + +struct ctl_logical_block_provisioning_page { + struct scsi_logical_block_provisioning_page main; + struct scsi_logical_block_provisioning_page_descr descr[CTL_NUM_LBP_THRESH]; +}; + static const struct ctl_page_index page_index_template[] = { {SMS_RW_ERROR_RECOVERY_PAGE, 0, sizeof(struct scsi_da_rw_recovery_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, @@ -316,7 +327,7 @@ static const struct ctl_page_index page_ {SMS_INFO_EXCEPTIONS_PAGE, 0, sizeof(struct scsi_info_exceptions_page), NULL, CTL_PAGE_FLAG_NONE, NULL, NULL}, {SMS_INFO_EXCEPTIONS_PAGE | SMPH_SPF, 0x02, - sizeof(struct scsi_logical_block_provisioning_page), NULL, + sizeof(struct ctl_logical_block_provisioning_page), NULL, CTL_PAGE_FLAG_DISK_ONLY, NULL, NULL}, {SMS_VENDOR_SPECIFIC_PAGE | SMPH_SPF, DBGCNF_SUBPAGE_CODE, sizeof(struct copan_debugconf_subpage), NULL, CTL_PAGE_FLAG_NONE, @@ -333,7 +344,7 @@ struct ctl_mode_pages { struct scsi_caching_page caching_page[4]; struct scsi_control_page control_page[4]; struct scsi_info_exceptions_page ie_page[4]; - struct scsi_logical_block_provisioning_page lbp_page[4]; + struct ctl_logical_block_provisioning_page lbp_page[4]; struct copan_debugconf_subpage debugconf_subpage[4]; struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; @@ -343,6 +354,8 @@ static const struct ctl_page_index log_p CTL_PAGE_FLAG_NONE, NULL, NULL}, {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, CTL_PAGE_FLAG_NONE, NULL, NULL}, + {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, + CTL_PAGE_FLAG_NONE, ctl_lbp_log_sense_handler, NULL}, }; #define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \ @@ -351,6 +364,7 @@ static const struct ctl_page_index log_p struct ctl_log_pages { uint8_t pages_page[CTL_NUM_LOG_PAGES]; uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2]; + uint8_t lbp_page[12*CTL_NUM_LBP_PARAMS]; struct ctl_page_index index[CTL_NUM_LOG_PAGES]; }; @@ -411,6 +425,7 @@ struct ctl_lun { struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; #endif ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; + time_t lasttpt; struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; struct ctl_lun_io_stats stats; Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cam/scsi/scsi_all.h Thu Nov 6 00:48:36 2014 (r274154) @@ -559,6 +559,7 @@ struct scsi_log_sense #define SLS_ERROR_VERIFY_PAGE 0x05 #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 +#define SLS_LOGICAL_BLOCK_PROVISIONING 0x0c #define SLS_SELF_TEST_PAGE 0x10 #define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 @@ -740,6 +741,11 @@ struct scsi_info_exceptions_page { struct scsi_logical_block_provisioning_page_descr { uint8_t flags; +#define SLBPPD_ENABLED 0x80 +#define SLBPPD_TYPE_MASK 0x38 +#define SLBPPD_ARMING_MASK 0x07 +#define SLBPPD_ARMING_DEC 0x02 +#define SLBPPD_ARMING_INC 0x01 uint8_t resource; uint8_t reserved[2]; uint8_t count[4]; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Nov 6 00:48:36 2014 (r274154) @@ -2459,10 +2459,38 @@ zvol_geom_start(struct bio *bp) goto enqueue; zvol_strategy(bp); break; - case BIO_GETATTR: + case BIO_GETATTR: { + spa_t *spa = dmu_objset_spa(zv->zv_objset); + uint64_t refd, avail, usedobjs, availobjs, val; + if (g_handleattr_int(bp, "GEOM::candelete", 1)) return; + if (strcmp(bp->bio_attribute, "blocksavail") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + if (g_handleattr_off_t(bp, "blocksavail", + avail / DEV_BSIZE)) + return; + } else if (strcmp(bp->bio_attribute, "blocksused") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + if (g_handleattr_off_t(bp, "blocksused", + refd / DEV_BSIZE)) + return; + } else if (strcmp(bp->bio_attribute, "poolblocksavail") == 0) { + avail = metaslab_class_get_space(spa_normal_class(spa)); + avail -= metaslab_class_get_alloc(spa_normal_class(spa)); + if (g_handleattr_off_t(bp, "poolblocksavail", + avail / DEV_BSIZE)) + return; + } else if (strcmp(bp->bio_attribute, "poolblocksused") == 0) { + refd = metaslab_class_get_alloc(spa_normal_class(spa)); + if (g_handleattr_off_t(bp, "poolblocksused", + refd / DEV_BSIZE)) + return; + } /* FALLTHROUGH */ + } default: g_io_deliver(bp, EOPNOTSUPP); break; @@ -2861,6 +2889,30 @@ zvol_d_ioctl(struct cdev *dev, u_long cm case DIOCGSTRIPEOFFSET: *(off_t *)data = 0; break; + case DIOCGATTR: { + spa_t *spa = dmu_objset_spa(zv->zv_objset); + struct diocgattr_arg *arg = (struct diocgattr_arg *)data; + uint64_t refd, avail, usedobjs, availobjs; + + if (strcmp(arg->name, "blocksavail") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + arg->value.off = avail / DEV_BSIZE; + } else if (strcmp(arg->name, "blocksused") == 0) { + dmu_objset_space(zv->zv_objset, &refd, &avail, + &usedobjs, &availobjs); + arg->value.off = refd / DEV_BSIZE; + } else if (strcmp(arg->name, "poolblocksavail") == 0) { + avail = metaslab_class_get_space(spa_normal_class(spa)); + avail -= metaslab_class_get_alloc(spa_normal_class(spa)); + arg->value.off = avail / DEV_BSIZE; + } else if (strcmp(arg->name, "poolblocksused") == 0) { + refd = metaslab_class_get_alloc(spa_normal_class(spa)); + arg->value.off = refd / DEV_BSIZE; + } else + error = ENOIOCTL; + break; + } default: error = ENOIOCTL; } Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/geom/geom_dev.c Thu Nov 6 00:48:36 2014 (r274154) @@ -510,6 +510,16 @@ g_dev_ioctl(struct cdev *dev, u_long cmd if (error == 0 && *(char *)data == '\0') error = ENOENT; break; + case DIOCGATTR: { + struct diocgattr_arg *arg = (struct diocgattr_arg *)data; + + if (arg->len > sizeof(arg->value)) { + error = EINVAL; + break; + } + error = g_io_getattr(arg->name, cp, &arg->len, &arg->value); + break; + } default: if (cp->provider->geom->ioctl != NULL) { error = cp->provider->geom->ioctl(cp->provider, cmd, data, fflag, td); Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Wed Nov 5 23:59:52 2014 (r274153) +++ head/sys/sys/disk.h Thu Nov 6 00:48:36 2014 (r274154) @@ -124,4 +124,14 @@ void disk_err(struct bio *bp, const char * occupant of that location. */ +struct diocgattr_arg { + char name[64]; + int len; + union { + char str[DISK_IDENT_SIZE]; + off_t off; + } value; +}; +#define DIOCGATTR _IOWR('d', 142, struct diocgattr_arg) + #endif /* _SYS_DISK_H_ */ Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Wed Nov 5 23:59:52 2014 (r274153) +++ head/usr.sbin/ctladm/ctladm.8 Thu Nov 6 00:48:36 2014 (r274154) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd October 26, 2014 +.Dd November 5, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -1003,6 +1003,14 @@ Specifies nominal form factor of the dev 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". .It Va unmap Set to "on", enables UNMAP support for the LUN, if supported by the backend. +.It Va avail-threshold +.It Va used-threshold +.It Va pool-avail-threshold +.It Va pool-used-threshold +Set per-LUN/-pool thin provisioning soft thresholds for ZVOL-backed LUNs. +LUN will establish UNIT ATTENTION condition if its or pool available space +get below configured avail values, or its or pool used space get above +configured used values. .It Va writecache Set to "off", disables write caching for the LUN, if supported by the backend. .El From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 00:51:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A38D637; Thu, 6 Nov 2014 00:51:05 +0000 (UTC) Received: from st11p02mm-asmtp001.mac.com (st11p02mm-asmtp001.mac.com [17.172.220.236]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2D9C2B2; Thu, 6 Nov 2014 00:51:04 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp001.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NEL00B58ECTX1B0@st11p02mm-asmtp001.mac.com>; Thu, 06 Nov 2014 00:50:55 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-11-06_01:2014-11-05,2014-11-05,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411060006 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r273182 - in head/sys/modules: qlxgb qlxgbe qlxge From: Rui Paulo In-reply-to: <201410162013.s9GKDHIY055100@svn.freebsd.org> Date: Wed, 05 Nov 2014 16:50:52 -0800 Content-transfer-encoding: 7bit Message-id: References: <201410162013.s9GKDHIY055100@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 00:51:05 -0000 On Oct 16, 2014, at 13:13, Warner Losh wrote: > > Author: imp > Date: Thu Oct 16 20:13:16 2014 > New Revision: 273182 > URL: https://svnweb.freebsd.org/changeset/base/273182 > > Log: > There's no need to override the clean target. The clean target works > correctly without doing so. Clearly someone didn't know about make cleandir. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:05:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 271F3942; Thu, 6 Nov 2014 01:05:30 +0000 (UTC) Received: from st11p02mm-asmtp002.mac.com (st11p02mm-asmtpout002.mac.com [17.172.220.237]) (using TLSv1 with cipher DES-CBC3-SHA (112/168 bits)) (Client CN "smtp.me.com", Issuer "VeriSign Class 3 Extended Validation SSL SGC CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CAF93E3; Thu, 6 Nov 2014 01:05:29 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) by st11p02mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.10(7.0.4.27.9) 64bit (built Jun 6 2014)) with ESMTPSA id <0NEL001Z0EZZCO90@st11p02mm-asmtp002.mac.com>; Thu, 06 Nov 2014 01:04:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.12.52,1.0.28,0.0.0000 definitions=2014-11-06_01:2014-11-05,2014-11-05,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1408290000 definitions=main-1411060009 Content-type: text/plain; charset=us-ascii MIME-version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r273382 - head/contrib/libcxxrt From: Rui Paulo In-reply-to: <201410211252.s9LCq2R5053286@svn.freebsd.org> Date: Wed, 05 Nov 2014 17:04:47 -0800 Content-transfer-encoding: quoted-printable Message-id: <7819250D-0FE0-44E6-86DA-718AEA2B261C@me.com> References: <201410211252.s9LCq2R5053286@svn.freebsd.org> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:05:30 -0000 On Oct 21, 2014, at 05:52, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Tue Oct 21 12:52:01 2014 > New Revision: 273382 > URL: https://svnweb.freebsd.org/changeset/base/273382 >=20 > Log: > Fix build by marking the new functions as weak > This is a temporary fix I don't think the non-temporary fix was ever committed. What's the = problem? Is something else defining these methods? -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:30:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F9F0AB; Thu, 6 Nov 2014 01:30:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B68C8B8; Thu, 6 Nov 2014 01:30:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61UEh9016670; Thu, 6 Nov 2014 01:30:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61UEbL016669; Thu, 6 Nov 2014 01:30:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060130.sA61UEbL016669@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:30: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: r274155 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:30:14 -0000 Author: markj Date: Thu Nov 6 01:30:13 2014 New Revision: 274155 URL: https://svnweb.freebsd.org/changeset/base/274155 Log: MFC r273236: Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy PMCs if a process exits or execs without explicitly releasing them. 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 Thu Nov 6 00:48:36 2014 (r274154) +++ stable/10/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:13 2014 (r274155) @@ -192,6 +192,7 @@ static int pmc_detach_process(struct pro static int pmc_detach_one_process(struct proc *p, struct pmc *pm, int flags); static void pmc_destroy_owner_descriptor(struct pmc_owner *po); +static void pmc_destroy_pmc_descriptor(struct pmc *pm); static struct pmc_owner *pmc_find_owner_descriptor(struct proc *p); static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pm); static struct pmc *pmc_find_pmc_descriptor_in_process(struct pmc_owner *po, @@ -753,6 +754,7 @@ pmc_remove_owner(struct pmc_owner *po) ("[pmc,%d] owner %p != po %p", __LINE__, pm->pm_owner, po)); pmc_release_pmc_descriptor(pm); /* will unlink from the list */ + pmc_destroy_pmc_descriptor(pm); } KASSERT(po->po_sscount == 0, @@ -2165,9 +2167,7 @@ pmc_allocate_pmc_descriptor(void) static void pmc_destroy_pmc_descriptor(struct pmc *pm) { - (void) pm; -#ifdef DEBUG KASSERT(pm->pm_state == PMC_STATE_DELETED || pm->pm_state == PMC_STATE_FREE, ("[pmc,%d] destroying non-deleted PMC", __LINE__)); @@ -2178,7 +2178,8 @@ pmc_destroy_pmc_descriptor(struct pmc *p KASSERT(pm->pm_runcount == 0, ("[pmc,%d] pmc has non-zero run count %d", __LINE__, pm->pm_runcount)); -#endif + + free(pm, M_PMC); } static void @@ -2211,10 +2212,10 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * - detaches the PMC from hardware * - unlinks all target threads that were attached to it * - removes the PMC from its owner's list - * - destroy's the PMC private mutex + * - destroys the PMC private mutex * - * Once this function completes, the given pmc pointer can be safely - * FREE'd by the caller. + * Once this function completes, the given pmc pointer can be freed by + * calling pmc_destroy_pmc_descriptor(). */ static void @@ -2364,8 +2365,6 @@ pmc_release_pmc_descriptor(struct pmc *p LIST_REMOVE(pm, pm_next); pm->pm_owner = NULL; } - - pmc_destroy_pmc_descriptor(pm); } /* @@ -3372,7 +3371,6 @@ pmc_syscall_handler(struct thread *td, v if (n == (int) md->pmd_npmc) { pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; error = EINVAL; break; @@ -3408,7 +3406,6 @@ pmc_syscall_handler(struct thread *td, v (error = pcd->pcd_config_pmc(cpu, adjri, pmc)) != 0) { (void) pcd->pcd_release_pmc(cpu, adjri, pmc); pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; pmc_restore_cpu_binding(&pb); error = EPERM; @@ -3436,7 +3433,7 @@ pmc_syscall_handler(struct thread *td, v if ((error = pmc_register_owner(curthread->td_proc, pmc)) != 0) { pmc_release_pmc_descriptor(pmc); - free(pmc, M_PMC); + pmc_destroy_pmc_descriptor(pmc); pmc = NULL; break; } @@ -3679,8 +3676,7 @@ pmc_syscall_handler(struct thread *td, v po = pm->pm_owner; pmc_release_pmc_descriptor(pm); pmc_maybe_remove_owner(po); - - free(pm, M_PMC); + pmc_destroy_pmc_descriptor(pm); } break; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:30:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A27E911A; Thu, 6 Nov 2014 01:30:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6648BA; Thu, 6 Nov 2014 01:30:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61UGWX016724; Thu, 6 Nov 2014 01:30:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61UG68016723; Thu, 6 Nov 2014 01:30:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060130.sA61UG68016723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:30:16 +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: r274156 - stable/9/sys/dev/hwpmc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:30:17 -0000 Author: markj Date: Thu Nov 6 01:30:15 2014 New Revision: 274156 URL: https://svnweb.freebsd.org/changeset/base/274156 Log: MFC r273236: Use pmc_destroy_pmc_descriptor() to actually free the pmc, which is consistent with pmc_destroy_owner_descriptor(). Also be sure to destroy PMCs if a process exits or execs without explicitly releasing them. Modified: stable/9/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:13 2014 (r274155) +++ stable/9/sys/dev/hwpmc/hwpmc_mod.c Thu Nov 6 01:30:15 2014 (r274156) @@ -191,6 +191,7 @@ static int pmc_detach_process(struct pro static int pmc_detach_one_process(struct proc *p, struct pmc *pm, int flags); static void pmc_destroy_owner_descriptor(struct pmc_owner *po); +static void pmc_destroy_pmc_descriptor(struct pmc *pm); static struct pmc_owner *pmc_find_owner_descriptor(struct proc *p); static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pm); static struct pmc *pmc_find_pmc_descriptor_in_process(struct pmc_owner *po, @@ -752,6 +753,7 @@ pmc_remove_owner(struct pmc_owner *po) ("[pmc,%d] owner %p != po %p", __LINE__, pm->pm_owner, po)); pmc_release_pmc_descriptor(pm); /* will unlink from the list */ + pmc_destroy_pmc_descriptor(pm); } KASSERT(po->po_sscount == 0, @@ -2176,9 +2178,7 @@ pmc_allocate_pmc_descriptor(void) static void pmc_destroy_pmc_descriptor(struct pmc *pm) { - (void) pm; -#ifdef DEBUG KASSERT(pm->pm_state == PMC_STATE_DELETED || pm->pm_state == PMC_STATE_FREE, ("[pmc,%d] destroying non-deleted PMC", __LINE__)); @@ -2189,7 +2189,8 @@ pmc_destroy_pmc_descriptor(struct pmc *p KASSERT(pm->pm_runcount == 0, ("[pmc,%d] pmc has non-zero run count %d", __LINE__, pm->pm_runcount)); -#endif + + free(pm, M_PMC); } static void @@ -2222,10 +2223,10 @@ pmc_wait_for_pmc_idle(struct pmc *pm) * - detaches the PMC from hardware * - unlinks all target threads that were attached to it * - removes the PMC from its owner's list - * - destroy's the PMC private mutex + * - destroys the PMC private mutex * - * Once this function completes, the given pmc pointer can be safely - * FREE'd by the caller. + * Once this function completes, the given pmc pointer can be freed by + * calling pmc_destroy_pmc_descriptor(). */ static void @@ -2375,8 +2376,6 @@ pmc_release_pmc_descriptor(struct pmc *p LIST_REMOVE(pm, pm_next); pm->pm_owner = NULL; } - - pmc_destroy_pmc_descriptor(pm); } /* @@ -3383,7 +3382,6 @@ pmc_syscall_handler(struct thread *td, v if (n == (int) md->pmd_npmc) { pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; error = EINVAL; break; @@ -3419,7 +3417,6 @@ pmc_syscall_handler(struct thread *td, v (error = pcd->pcd_config_pmc(cpu, adjri, pmc)) != 0) { (void) pcd->pcd_release_pmc(cpu, adjri, pmc); pmc_destroy_pmc_descriptor(pmc); - free(pmc, M_PMC); pmc = NULL; pmc_restore_cpu_binding(&pb); error = EPERM; @@ -3447,7 +3444,7 @@ pmc_syscall_handler(struct thread *td, v if ((error = pmc_register_owner(curthread->td_proc, pmc)) != 0) { pmc_release_pmc_descriptor(pmc); - free(pmc, M_PMC); + pmc_destroy_pmc_descriptor(pmc); pmc = NULL; break; } @@ -3690,8 +3687,7 @@ pmc_syscall_handler(struct thread *td, v po = pm->pm_owner; pmc_release_pmc_descriptor(pm); pmc_maybe_remove_owner(po); - - free(pm, M_PMC); + pmc_destroy_pmc_descriptor(pm); } break; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:34:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F14336C; Thu, 6 Nov 2014 01:34:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF81397B; Thu, 6 Nov 2014 01:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61Yh9B020706; Thu, 6 Nov 2014 01:34:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61YhQH020705; Thu, 6 Nov 2014 01:34:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060134.sA61YhQH020705@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:34: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: r274157 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:34:44 -0000 Author: markj Date: Thu Nov 6 01:34:43 2014 New Revision: 274157 URL: https://svnweb.freebsd.org/changeset/base/274157 Log: MFC r273342: Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock and unp_link_rwlock. 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 Thu Nov 6 01:30:15 2014 (r274156) +++ stable/10/sys/kern/subr_witness.c Thu Nov 6 01:34:43 2014 (r274157) @@ -527,7 +527,7 @@ static struct witness_order_list_entry o /* * UNIX Domain Sockets */ - { "unp_global_rwlock", &lock_class_rw }, + { "unp_link_rwlock", &lock_class_rw }, { "unp_list_lock", &lock_class_mtx_sleep }, { "unp", &lock_class_mtx_sleep }, { "so_snd", &lock_class_mtx_sleep }, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:34:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5974036D; Thu, 6 Nov 2014 01:34:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45C2097C; Thu, 6 Nov 2014 01:34:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61YjMr020750; Thu, 6 Nov 2014 01:34:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61YjMQ020749; Thu, 6 Nov 2014 01:34:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411060134.sA61YjMQ020749@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 01:34:45 +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: r274158 - stable/9/sys/kern 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:34:45 -0000 Author: markj Date: Thu Nov 6 01:34:44 2014 New Revision: 274158 URL: https://svnweb.freebsd.org/changeset/base/274158 Log: MFC r273342: Fix a typo from r189544, which replaced unp_global_rwlock with unp_list_lock and unp_link_rwlock. Modified: stable/9/sys/kern/subr_witness.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_witness.c ============================================================================== --- stable/9/sys/kern/subr_witness.c Thu Nov 6 01:34:43 2014 (r274157) +++ stable/9/sys/kern/subr_witness.c Thu Nov 6 01:34:44 2014 (r274158) @@ -527,7 +527,7 @@ static struct witness_order_list_entry o /* * UNIX Domain Sockets */ - { "unp_global_rwlock", &lock_class_rw }, + { "unp_link_rwlock", &lock_class_rw }, { "unp_list_lock", &lock_class_mtx_sleep }, { "unp", &lock_class_mtx_sleep }, { "so_snd", &lock_class_mtx_sleep }, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 01:46:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C52BF762; Thu, 6 Nov 2014 01:46:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E50A7A; Thu, 6 Nov 2014 01:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA61kXRf025674; Thu, 6 Nov 2014 01:46:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA61kX1I025673; Thu, 6 Nov 2014 01:46:33 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411060146.sA61kX1I025673@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 6 Nov 2014 01:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274159 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 01:46:33 -0000 Author: dteske Date: Thu Nov 6 01:46:33 2014 New Revision: 274159 URL: https://svnweb.freebsd.org/changeset/base/274159 Log: Upon second-thought (following r274144), remove spurious (unused) line-noise (libdialog never lived in lib/ -- but rather the noise came from translating a comment that was introduced 16 years ago via r40306; translation from comment to code occurred via r267511). MFC after: 3 days Reviewed by: ngie X-MFC-to: stable/10 Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Nov 6 01:34:44 2014 (r274158) +++ head/lib/Makefile Thu Nov 6 01:46:33 2014 (r274159) @@ -130,7 +130,6 @@ SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcapsicum= libnv SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog SUBDIR_DEPEND_libdevstat= libkvm -SUBDIR_DEPEND_libdialog= ncurses SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:23:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF82BD3C; Thu, 6 Nov 2014 02:23:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB80AE1B; Thu, 6 Nov 2014 02:23:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62N1Wx043848; Thu, 6 Nov 2014 02:23:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62N16n043847; Thu, 6 Nov 2014 02:23:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060223.sA62N16n043847@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:23:01 +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: r274160 - stable/9/release/doc/en_US.ISO8859-1/errata 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:23:02 -0000 Author: gjb Date: Thu Nov 6 02:23:01 2014 New Revision: 274160 URL: https://svnweb.freebsd.org/changeset/base/274160 Log: Document SA-14:25, SA-14:26 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 6 01:46:33 2014 (r274159) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.xml Thu Nov 6 02:23:01 2014 (r274160) @@ -139,6 +139,18 @@ 21 October 2014 Multiple vulerabilities. + + + SA-14:25.setlogin + 04 November 2014 + Kernel stack disclosure. + + + + SA-14:26.ftp + 04 November 2014 + Remote code execution. + From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:28:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2162158; Thu, 6 Nov 2014 02:28:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE52DE6A; Thu, 6 Nov 2014 02:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62S8tJ044476; Thu, 6 Nov 2014 02:28:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62S8gH044475; Thu, 6 Nov 2014 02:28:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060228.sA62S8gH044475@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r274161 - releng/10.1/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:28:08 -0000 Author: gjb Date: Thu Nov 6 02:28:08 2014 New Revision: 274161 URL: https://svnweb.freebsd.org/changeset/base/274161 Log: Document SA-14:25, SA-14:26 Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/10.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/10.1/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/10.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Nov 6 02:23:01 2014 (r274160) +++ releng/10.1/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Nov 6 02:28:08 2014 (r274161) @@ -314,6 +314,18 @@ 21 October 2014 Multiple vulerabilities. + + + SA-14:25.setlogin + 04 November 2014 + Kernel stack disclosure. + + + + SA-14:26.ftp + 04 November 2014 + Remote code execution. + From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:41:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F35F3BB; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5BBFE9; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62fdU1053061; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62fdkZ053060; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62fdkZ053060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:41:39 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/8/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 804506 /* Master, propagated to newvers */ +#define __FreeBSD_version 804507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:41:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9690D3BD; Thu, 6 Nov 2014 02:41:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82FC7FEB; Thu, 6 Nov 2014 02:41:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62fexr053075; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62feDa053073; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62feDa053073@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:41:40 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/param.h Changes in other areas also in this revision: Modified: stable/10/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ head/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100044 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100045 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:41:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16A333C0; Thu, 6 Nov 2014 02:41:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B81FED; Thu, 6 Nov 2014 02:41:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62feha053083; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62feas053082; Thu, 6 Nov 2014 02:41:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62feas053082@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41:40 +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: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:41:41 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/10/sys/sys/param.h stable/8/sys/sys/param.h Modified: stable/9/sys/sys/param.h ============================================================================== --- stable/9/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/9/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 903505 /* Master, propagated to newvers */ +#define __FreeBSD_version 903506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 02:41:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0332F3BC; Thu, 6 Nov 2014 02:41:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2A84FEA; Thu, 6 Nov 2014 02:41:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA62fdTG053067; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA62fdix053066; Thu, 6 Nov 2014 02:41:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201411060241.sA62fdix053066@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 6 Nov 2014 02:41: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: r274162 - head/sys/sys stable/10/sys/sys stable/8/sys/sys stable/9/sys/sys 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 02:41:40 -0000 Author: gjb Date: Thu Nov 6 02:41:38 2014 New Revision: 274162 URL: https://svnweb.freebsd.org/changeset/base/274162 Log: Bump __FreeBSD_version after SA-14:23, SA-14:24, SA-14:25. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/sys/param.h Changes in other areas also in this revision: Modified: head/sys/sys/param.h stable/8/sys/sys/param.h stable/9/sys/sys/param.h Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Thu Nov 6 02:28:08 2014 (r274161) +++ stable/10/sys/sys/param.h Thu Nov 6 02:41:38 2014 (r274162) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1001501 /* Master, propagated to newvers */ +#define __FreeBSD_version 1001502 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 04:13:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99FF169F; Thu, 6 Nov 2014 04:13:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D110C45; Thu, 6 Nov 2014 04:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA64DTX8096235; Thu, 6 Nov 2014 04:13:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA64DTie096234; Thu, 6 Nov 2014 04:13:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411060413.sA64DTie096234@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 6 Nov 2014 04:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274163 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 04:13:29 -0000 Author: mav Date: Thu Nov 6 04:13:28 2014 New Revision: 274163 URL: https://svnweb.freebsd.org/changeset/base/274163 Log: Add include missed in r274154, breaking the buildworld. Modified: head/sys/sys/disk.h Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Thu Nov 6 02:41:38 2014 (r274162) +++ head/sys/sys/disk.h Thu Nov 6 04:13:28 2014 (r274163) @@ -14,6 +14,7 @@ #define _SYS_DISK_H_ #include +#include #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 07:27:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CB7E5D8; Thu, 6 Nov 2014 07:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 497BADD; Thu, 6 Nov 2014 07:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA67RFKV084523; Thu, 6 Nov 2014 07:27:15 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA67RFqk084522; Thu, 6 Nov 2014 07:27:15 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <201411060727.sA67RFqk084522@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 6 Nov 2014 07:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274164 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 07:27:15 -0000 Author: jmg Date: Thu Nov 6 07:27:14 2014 New Revision: 274164 URL: https://svnweb.freebsd.org/changeset/base/274164 Log: remove comment about the bug... I don't remeber what it was... It may be an issue w/ using awk which is in /usr (and isn't always present), or another issue... Suggestion by: brooks Modified: head/etc/rc.d/growfs Modified: head/etc/rc.d/growfs ============================================================================== --- head/etc/rc.d/growfs Thu Nov 6 04:13:28 2014 (r274163) +++ head/etc/rc.d/growfs Thu Nov 6 07:27:14 2014 (r274164) @@ -35,9 +35,7 @@ # and have it work on essentially any size drive. # # TODO: Figure out where this should really be ordered. -# I suspect it should go just after fsck but before mountcritlocal -# but it's hard to tell for sure because of the bug described -# below. +# I suspect it should go just after fsck but before mountcritlocal. # . /etc/rc.subr From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 07:37:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 277D37A1; Thu, 6 Nov 2014 07:37:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146E51B4; Thu, 6 Nov 2014 07:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA67bVHj089253; Thu, 6 Nov 2014 07:37:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA67bVBU089252; Thu, 6 Nov 2014 07:37:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411060737.sA67bVBU089252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Nov 2014 07:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274165 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 07:37:32 -0000 Author: mjg Date: Thu Nov 6 07:37:31 2014 New Revision: 274165 URL: https://svnweb.freebsd.org/changeset/base/274165 Log: filedesc: just free old tables without altering the list which is freed anyway No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Nov 6 07:27:14 2014 (r274164) +++ head/sys/kern/kern_descrip.c Thu Nov 6 07:37:31 2014 (r274165) @@ -2026,7 +2026,7 @@ fdescfree(struct thread *td) { struct filedesc0 *fdp0; struct filedesc *fdp; - struct freetable *ft; + struct freetable *ft, *tft; struct filedescent *fde; struct file *fp; struct vnode *cdir, *jdir, *rdir; @@ -2078,10 +2078,8 @@ fdescfree(struct thread *td) free(fdp->fd_files, M_FILEDESC); fdp0 = (struct filedesc0 *)fdp; - while ((ft = SLIST_FIRST(&fdp0->fd_free)) != NULL) { - SLIST_REMOVE_HEAD(&fdp0->fd_free, ft_next); + SLIST_FOREACH_SAFE(ft, &fdp0->fd_free, ft_next, tft) free(ft->ft_table, M_FILEDESC); - } if (cdir != NULL) vrele(cdir); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 07:44:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26FA7947; Thu, 6 Nov 2014 07:44:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1419D26F; Thu, 6 Nov 2014 07:44:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA67iAn0093478; Thu, 6 Nov 2014 07:44:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA67iAT3093477; Thu, 6 Nov 2014 07:44:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411060744.sA67iAT3093477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Nov 2014 07:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274166 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 07:44:11 -0000 Author: mjg Date: Thu Nov 6 07:44:10 2014 New Revision: 274166 URL: https://svnweb.freebsd.org/changeset/base/274166 Log: filedesc: avoid taking fdesc_mtx when not necessary in fddrop No functional changes. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Nov 6 07:37:31 2014 (r274165) +++ head/sys/kern/kern_descrip.c Thu Nov 6 07:44:10 2014 (r274166) @@ -1859,11 +1859,13 @@ fddrop(struct filedesc *fdp) { int i; - mtx_lock(&fdesc_mtx); - i = --fdp->fd_holdcnt; - mtx_unlock(&fdesc_mtx); - if (i > 0) - return; + if (fdp->fd_holdcnt > 1) { + mtx_lock(&fdesc_mtx); + i = --fdp->fd_holdcnt; + mtx_unlock(&fdesc_mtx); + if (i > 0) + return; + } FILEDESC_LOCK_DESTROY(fdp); uma_zfree(filedesc0_zone, fdp); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 08:12:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0897DDA7; Thu, 6 Nov 2014 08:12:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96F779F; Thu, 6 Nov 2014 08:12:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA68CZKX007388; Thu, 6 Nov 2014 08:12:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA68CZ2w007383; Thu, 6 Nov 2014 08:12:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411060812.sA68CZ2w007383@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 6 Nov 2014 08:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274167 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 08:12:36 -0000 Author: mjg Date: Thu Nov 6 08:12:34 2014 New Revision: 274167 URL: https://svnweb.freebsd.org/changeset/base/274167 Log: Add sysctl kern.proc.cwd It returns only current working directory of given process which saves a lot of overhead over kern.proc.filedesc if given proc has a lot of open fds. Submitted by: Tiwei Bie (slightly modified) X-Additional: JuniorJobs project Modified: head/sys/kern/kern_descrip.c head/sys/sys/sysctl.h head/sys/sys/user.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Nov 6 07:44:10 2014 (r274166) +++ head/sys/kern/kern_descrip.c Thu Nov 6 08:12:34 2014 (r274167) @@ -3406,6 +3406,73 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTLFLAG_RD|CTLFLAG_MPSAFE, sysctl_kern_proc_filedesc, "Process filedesc entries"); +/* + * Store a process current working directory information to sbuf. + * + * Takes a locked proc as argument, and returns with the proc unlocked. + */ +int +kern_proc_cwd_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) +{ + struct filedesc *fdp; + struct export_fd_buf *efbuf; + int error; + + PROC_LOCK_ASSERT(p, MA_OWNED); + + fdp = fdhold(p); + PROC_UNLOCK(p); + if (fdp == NULL) + return (EINVAL); + + efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK); + efbuf->fdp = fdp; + efbuf->sb = sb; + efbuf->remainder = maxlen; + + FILEDESC_SLOCK(fdp); + if (fdp->fd_cdir == NULL) + error = EINVAL; + else { + vref(fdp->fd_cdir); + error = export_vnode_to_sb(fdp->fd_cdir, KF_FD_TYPE_CWD, + FREAD, efbuf); + } + FILEDESC_SUNLOCK(fdp); + fddrop(fdp); + free(efbuf, M_TEMP); + return (error); +} + +/* + * Get per-process current working directory. + */ +static int +sysctl_kern_proc_cwd(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct proc *p; + ssize_t maxlen; + int error, error2, *name; + + name = (int *)arg1; + + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_file), req); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + maxlen = req->oldptr != NULL ? req->oldlen : -1; + error = kern_proc_cwd_out(p, &sb, maxlen); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + +static SYSCTL_NODE(_kern_proc, KERN_PROC_CWD, cwd, CTLFLAG_RD|CTLFLAG_MPSAFE, + sysctl_kern_proc_cwd, "Process current working directory"); + #ifdef DDB /* * For the purposes of debugging, generate a human-readable string for the Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Nov 6 07:44:10 2014 (r274166) +++ head/sys/sys/sysctl.h Thu Nov 6 08:12:34 2014 (r274167) @@ -657,6 +657,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e #define KERN_PROC_UMASK 39 /* process umask */ #define KERN_PROC_OSREL 40 /* osreldate for process binary */ #define KERN_PROC_SIGTRAMP 41 /* signal trampoline location */ +#define KERN_PROC_CWD 42 /* process current working directory */ /* * KERN_IPC identifiers Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu Nov 6 07:44:10 2014 (r274166) +++ head/sys/sys/user.h Thu Nov 6 08:12:34 2014 (r274167) @@ -530,6 +530,7 @@ struct sbuf; */ int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_cwd_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:16:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E432D84; Thu, 6 Nov 2014 09:16:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A4D3E0A; Thu, 6 Nov 2014 09:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA69Grkk035526; Thu, 6 Nov 2014 09:16:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA69Gr2V035525; Thu, 6 Nov 2014 09:16:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411060916.sA69Gr2V035525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Nov 2014 09:16: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: r274168 - stable/10/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 09:16:53 -0000 Author: ae Date: Thu Nov 6 09:16:52 2014 New Revision: 274168 URL: https://svnweb.freebsd.org/changeset/base/274168 Log: MFC r273855: Fix mbuf leak in IPv6 multicast code. When multicast capable interface goes away, it leaves multicast groups, this leads to generate MLD reports, but MLD code does deffered send and MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is that in6_multi structures are freed when interface leaves multicast groups and thread that does deffered send will not take these queued packets. PR: 194577 MFC r273857: Move ifq drain into in6m_purge(). Suggested by: bms Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/in6_mcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/in6_mcast.c ============================================================================== --- stable/10/sys/netinet6/in6_mcast.c Thu Nov 6 08:12:34 2014 (r274167) +++ stable/10/sys/netinet6/in6_mcast.c Thu Nov 6 09:16:52 2014 (r274168) @@ -1075,6 +1075,8 @@ in6m_purge(struct in6_multi *inm) free(ims, M_IP6MSOURCE); inm->in6m_nsrc--; } + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); } /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 09:37:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECEED5D3; Thu, 6 Nov 2014 09:37:16 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BD617B8; Thu, 6 Nov 2014 09:37:16 +0000 (UTC) Received: from [192.168.0.106] (cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52]) (authenticated bits=0) by theravensnest.org (8.14.9/8.14.9) with ESMTP id sA69awro081944 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 6 Nov 2014 09:37:00 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: theravensnest.org: Host cpc14-cmbg15-2-0-cust307.5-4.cable.virginm.net [82.26.1.52] claimed to be [192.168.0.106] Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r273382 - head/contrib/libcxxrt From: David Chisnall In-Reply-To: <7819250D-0FE0-44E6-86DA-718AEA2B261C@me.com> Date: Thu, 6 Nov 2014 09:36:52 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9E81312A-E615-49C2-84C5-D4CF9EA96232@FreeBSD.org> References: <201410211252.s9LCq2R5053286@svn.freebsd.org> <7819250D-0FE0-44E6-86DA-718AEA2B261C@me.com> To: Rui Paulo X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 09:37:17 -0000 On 6 Nov 2014, at 01:04, Rui Paulo wrote: > I don't think the non-temporary fix was ever committed. What's the = problem? Is something else defining these methods? Yes, they're defined by libc++ too. The problem is that gcc 4.9 wants = to be able to throw bad_array_new_length exceptions when you do new = foo[x] and sizeof(foo) * x overflows. It does this by calling a support = function defined in the C++ runtime, but that means that the C++ runtime = must have the bad_array_new_length class defined there too. Having the = methods on those classes defined in libcxxrt and libc++ breaks things. The correct fix was to move a #endif in libc++ so that it didn't compile = those functions. There was some discussion about whether we needed to = support the case that old libc++ and new libcxxrt were used, but it's = probably not required. Bapt was going to check whether there were any = symbol versioning issues with code compiled against old libc++/libcxxrt = and dynamically linked against the new one. =20 David From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:07:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32DFEE44; Thu, 6 Nov 2014 10:07:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCD93E4; Thu, 6 Nov 2014 10:07:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6A7QZ7058532; Thu, 6 Nov 2014 10:07:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6A7Qlx058531; Thu, 6 Nov 2014 10:07:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061007.sA6A7Qlx058531@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 10:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274169 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 10:07:27 -0000 Author: bapt Date: Thu Nov 6 10:07:26 2014 New Revision: 274169 URL: https://svnweb.freebsd.org/changeset/base/274169 Log: rpcbind does not need to be linked to libutil Modified: head/usr.sbin/rpcbind/Makefile Modified: head/usr.sbin/rpcbind/Makefile ============================================================================== --- head/usr.sbin/rpcbind/Makefile Thu Nov 6 09:16:52 2014 (r274168) +++ head/usr.sbin/rpcbind/Makefile Thu Nov 6 10:07:26 2014 (r274169) @@ -16,7 +16,7 @@ CFLAGS+= -DINET6 WARNS?= 1 -DPADD= ${LIBWRAP} ${LIBUTIL} -LDADD= -lwrap -lutil +DPADD= ${LIBWRAP} +LDADD= -lwrap .include From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:16:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D22D34E; Thu, 6 Nov 2014 10:16:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29F316C4; Thu, 6 Nov 2014 10:16:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6AG6GM063525; Thu, 6 Nov 2014 10:16:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6AG6R6063524; Thu, 6 Nov 2014 10:16:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061016.sA6AG6R6063524@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 10:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274170 - head/usr.sbin/ntp/sntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 10:16:06 -0000 Author: bapt Date: Thu Nov 6 10:16:05 2014 New Revision: 274170 URL: https://svnweb.freebsd.org/changeset/base/274170 Log: sntp does not depend on libm Modified: head/usr.sbin/ntp/sntp/Makefile Modified: head/usr.sbin/ntp/sntp/Makefile ============================================================================== --- head/usr.sbin/ntp/sntp/Makefile Thu Nov 6 10:07:26 2014 (r274169) +++ head/usr.sbin/ntp/sntp/Makefile Thu Nov 6 10:16:05 2014 (r274170) @@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n -DPACKAGE=\"sntp\" -DVERSION=\"1.6\" \ -I${.CURDIR}/../../../contrib/ntp/libopts -DPADD= ${LIBM} ${LIBOPTS} -LDADD= -lm ${LIBOPTS} +DPADD= ${LIBOPTS} +LDADD= ${LIBOPTS} .include From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:30:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A453E80B; Thu, 6 Nov 2014 10:30:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 916DC8F1; Thu, 6 Nov 2014 10:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6AUBoL068732; Thu, 6 Nov 2014 10:30:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6AUBmx068731; Thu, 6 Nov 2014 10:30:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061030.sA6AUBmx068731@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 10:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274171 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 10:30:11 -0000 Author: bapt Date: Thu Nov 6 10:30:10 2014 New Revision: 274171 URL: https://svnweb.freebsd.org/changeset/base/274171 Log: iscsid does not need to link to libssl Modified: head/usr.sbin/iscsid/Makefile Modified: head/usr.sbin/iscsid/Makefile ============================================================================== --- head/usr.sbin/iscsid/Makefile Thu Nov 6 10:16:05 2014 (r274170) +++ head/usr.sbin/iscsid/Makefile Thu Nov 6 10:30:10 2014 (r274171) @@ -8,8 +8,8 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= iscsid.8 -DPADD= ${LIBCRYPTO} ${LIBSSL} ${LIBUTIL} -LDADD= -lcrypto -lssl -lutil +DPADD= ${LIBCRYPTO} ${LIBUTIL} +LDADD= -lcrypto -lutil WARNS= 6 From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 10:42:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4975DAEB; Thu, 6 Nov 2014 10:42:17 +0000 (UTC) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9332A2E; Thu, 6 Nov 2014 10:42:16 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id x12so843103wgg.4 for ; Thu, 06 Nov 2014 02:42:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=op8KH5Ut+oKCgZHMxC8wQKhlki6vs3uq4lGKUKWuZEY=; b=mF+T0JbfjWnMVWJdj2fdRfM7cQ/H40nVaenIDrJQnxofbf4k+Yi7lmbK8n7uRkC0vj 4flC1eL5veKCX6ZAMdECJq26NF7Ibq+/48rQXpVgbftoyPYDFrZIpl4G61/f0+GUijlw I/xzzBGO9K2jV78Uk9Qe+wo5hU63uQaV17VuxDPLdPJ1zxlRM2N3cNrmeOP4kEGykM19 w/MP83vhiRhWYsdBNOIGWcOmLQ795/wUQEBhB/zxjeUg3U4H1puHypKqaM/HdD3teHwi 230yiiGMkVr80jjQl5TTyVcuhQzKAH24vJlY1Mcu2kGF7jcpuz3DS52L0hcvHZX5DAoQ bD1w== X-Received: by 10.194.241.194 with SMTP id wk2mr2027381wjc.132.1415270535192; Thu, 06 Nov 2014 02:42:15 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id cz3sm7289310wjb.23.2014.11.06.02.42.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 02:42:14 -0800 (PST) Sender: Baptiste Daroussin Date: Thu, 6 Nov 2014 11:42:11 +0100 From: Baptiste Daroussin To: David Chisnall Subject: Re: svn commit: r273382 - head/contrib/libcxxrt Message-ID: <20141106104211.GN10388@ivaldir.etoilebsd.net> References: <201410211252.s9LCq2R5053286@svn.freebsd.org> <7819250D-0FE0-44E6-86DA-718AEA2B261C@me.com> <9E81312A-E615-49C2-84C5-D4CF9EA96232@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AKkMM/tm2Mk6Yn/s" Content-Disposition: inline In-Reply-To: <9E81312A-E615-49C2-84C5-D4CF9EA96232@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 10:42:17 -0000 --AKkMM/tm2Mk6Yn/s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 06, 2014 at 09:36:52AM +0000, David Chisnall wrote: > On 6 Nov 2014, at 01:04, Rui Paulo wrote: >=20 > > I don't think the non-temporary fix was ever committed. What's the pro= blem? Is something else defining these methods? >=20 > Yes, they're defined by libc++ too. The problem is that gcc 4.9 wants to= be able to throw bad_array_new_length exceptions when you do new foo[x] an= d sizeof(foo) * x overflows. It does this by calling a support function de= fined in the C++ runtime, but that means that the C++ runtime must have the= bad_array_new_length class defined there too. Having the methods on those= classes defined in libcxxrt and libc++ breaks things. >=20 > The correct fix was to move a #endif in libc++ so that it didn't compile = those functions. There was some discussion about whether we needed to supp= ort the case that old libc++ and new libcxxrt were used, but it's probably = not required. Bapt was going to check whether there were any symbol versio= ning issues with code compiled against old libc++/libcxxrt and dynamically = linked against the new one. =20 I will backout this change since it is not necessary anymore as well as ups= tream the missing parts of the bad_array_new_lenght exception in libcxxrt in the = next couple of days. regards, Bapt --AKkMM/tm2Mk6Yn/s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRbUIMACgkQ8kTtMUmk6Ewy+wCgrh73wg8kAtG/swlSPyDK7DAt MycAn0QZGzjTSeI64825F3krdgNNQxld =ClBJ -----END PGP SIGNATURE----- --AKkMM/tm2Mk6Yn/s-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 11:07:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE975194; Thu, 6 Nov 2014 11:07:54 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80DEDC49; Thu, 6 Nov 2014 11:07:54 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XmGuL-0006sz-Am; Thu, 06 Nov 2014 10:51:01 +0400 Message-ID: <545B55FA.6070408@FreeBSD.org> Date: Thu, 06 Nov 2014 15:05:30 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe References: <201410150122.s9F1Mudu083306@svn.freebsd.org> In-Reply-To: <201410150122.s9F1Mudu083306@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 11:07:54 -0000 On 15.10.2014 05:22, Adrian Chadd wrote: > Author: adrian > Date: Wed Oct 15 01:22:56 2014 > New Revision: 273112 > URL: https://svnweb.freebsd.org/changeset/base/273112 > > Log: > Set the DROP_EN bit before the RX queue is brought up and active. > > He noticed issues setting this bit in SRRCTL after the queue was up, > so doing it from the sysctl handler isn't enough and may not actually > work correctly. While investigating/measuring ixgbe performance w/ and without flow control I noticed that disabling fc entirely (e.g. disabling 512K skid buffer and turning drop_en on) not only makes things a bit worse, but also makes NIC stop accounting tail-drops as errors at all. It is a bit unhandy with HW counters, since you, for example, see 2M packets being received in netstat, but in reality system receives only 1M (And there is no easy way to determine exact count). > > This commit doesn't remove the sysctl path or try to change its > behaviour. I'll talk with others about how to finish fixing that > before I tackle that. > > PR: kern/194311 > Submitted by: luigi > MFC after: 3 days > Sponsored by: Norse Corp, Inc > > Modified: > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 15 01:16:11 2014 (r273111) > +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 15 01:22:56 2014 (r273112) > @@ -4377,6 +4377,20 @@ ixgbe_initialize_receive_units(struct ad > srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; > srrctl |= bufsz; > srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; > + > + /* > + * Set DROP_EN iff we have no flow control and >1 queue. > + * Note that srrctl was cleared shortly before during reset, > + * so we do not need to clear the bit, but do it just in case > + * this code is moved elsewhere. > + */ > + if (adapter->num_queues > 1 && > + adapter->hw.fc.requested_mode == ixgbe_fc_none) { This code seems to turn drop_en always on HEAD due to hw->fc.requested_mode is inherited from adapter->fc at the end of ixgbe_init_locked(), _after_ calling ixgbe_initialize_receive_units() > + srrctl |= IXGBE_SRRCTL_DROP_EN; > + } else { > + srrctl &= ~IXGBE_SRRCTL_DROP_EN; > + } > + > IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); > > /* Setup the HW Rx Head and Tail Descriptor Pointers */ > > From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 11:08:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C4732CE; Thu, 6 Nov 2014 11:08:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18752C4A; Thu, 6 Nov 2014 11:08:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6B823a087309; Thu, 6 Nov 2014 11:08:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6B821h087308; Thu, 6 Nov 2014 11:08:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201411061108.sA6B821h087308@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Nov 2014 11:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274172 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 11:08:03 -0000 Author: avg Date: Thu Nov 6 11:08:02 2014 New Revision: 274172 URL: https://svnweb.freebsd.org/changeset/base/274172 Log: fix l2arc compression buffers leak We have observed that arc_release() can be called concurrently with a l2arc in-flight write. Also, we have observed that arc_hdr_destroy() can be called from arc_write_done() for a zio with ZIO_FLAG_IO_REWRITE flag in similar circumstances. Previously the l2arc headers would be freed while leaking their associated compression buffers. Now the buffers are placed on l2arc_free_on_write list for delayed freeing. This is similar to what was already done to arc buffers that were supposed to be freed concurrently with in-flight writes of those buffers. In addition to fixing the discovered leaks this change also adds some protective code to assert that a compression buffer associated with a l2arc header is never leaked. A new kstat l2_cdata_free_on_write is added. It keeps a count of delayed compression buffer frees which previously would have been leaks. Tested by: Vitalij Satanivskij et al Requested by: many MFC after: 2 weeks Sponsored by: HybridCluster / ClusterHQ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 6 10:30:10 2014 (r274171) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 6 11:08:02 2014 (r274172) @@ -387,6 +387,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_evict_lock_retry; kstat_named_t arcstat_l2_evict_reading; kstat_named_t arcstat_l2_free_on_write; + kstat_named_t arcstat_l2_cdata_free_on_write; kstat_named_t arcstat_l2_abort_lowmem; kstat_named_t arcstat_l2_cksum_bad; kstat_named_t arcstat_l2_io_error; @@ -464,6 +465,7 @@ static arc_stats_t arc_stats = { { "l2_evict_lock_retry", KSTAT_DATA_UINT64 }, { "l2_evict_reading", KSTAT_DATA_UINT64 }, { "l2_free_on_write", KSTAT_DATA_UINT64 }, + { "l2_cdata_free_on_write", KSTAT_DATA_UINT64 }, { "l2_abort_lowmem", KSTAT_DATA_UINT64 }, { "l2_cksum_bad", KSTAT_DATA_UINT64 }, { "l2_io_error", KSTAT_DATA_UINT64 }, @@ -1655,6 +1657,21 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta data, metadata, hits); } +static void +arc_buf_free_on_write(void *data, size_t size, + void (*free_func)(void *, size_t)) +{ + l2arc_data_free_t *df; + + df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); + df->l2df_data = data; + df->l2df_size = size; + df->l2df_func = free_func; + mutex_enter(&l2arc_free_on_write_mtx); + list_insert_head(l2arc_free_on_write, df); + mutex_exit(&l2arc_free_on_write_mtx); +} + /* * Free the arc data buffer. If it is an l2arc write in progress, * the buffer is placed on l2arc_free_on_write to be freed later. @@ -1665,14 +1682,7 @@ arc_buf_data_free(arc_buf_t *buf, void ( arc_buf_hdr_t *hdr = buf->b_hdr; if (HDR_L2_WRITING(hdr)) { - l2arc_data_free_t *df; - df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); - df->l2df_data = buf->b_data; - df->l2df_size = hdr->b_size; - df->l2df_func = free_func; - mutex_enter(&l2arc_free_on_write_mtx); - list_insert_head(l2arc_free_on_write, df); - mutex_exit(&l2arc_free_on_write_mtx); + arc_buf_free_on_write(buf->b_data, hdr->b_size, free_func); ARCSTAT_BUMP(arcstat_l2_free_on_write); } else { free_func(buf->b_data, hdr->b_size); @@ -1684,6 +1694,23 @@ arc_buf_data_free(arc_buf_t *buf, void ( * arc_buf_t off of the the arc_buf_hdr_t's list and free it. */ static void +arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) +{ + l2arc_buf_hdr_t *l2hdr = hdr->b_l2hdr; + + ASSERT(MUTEX_HELD(&l2arc_buflist_mtx)); + + if (l2hdr->b_tmp_cdata == NULL) + return; + + ASSERT(HDR_L2_WRITING(hdr)); + arc_buf_free_on_write(l2hdr->b_tmp_cdata, hdr->b_size, + zio_data_buf_free); + ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + l2hdr->b_tmp_cdata = NULL; +} + +static void arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1782,6 +1809,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, hdr->b_size, 0); list_remove(l2hdr->b_dev->l2ad_buflist, hdr); + arc_buf_l2_cdata_free(hdr); ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size); ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); vdev_space_update(l2hdr->b_dev->l2ad_vdev, @@ -3675,6 +3703,7 @@ arc_release(arc_buf_t *buf, void *tag) l2hdr = hdr->b_l2hdr; if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); + arc_buf_l2_cdata_free(hdr); hdr->b_l2hdr = NULL; list_remove(l2hdr->b_dev->l2ad_buflist, hdr); } @@ -4964,6 +4993,11 @@ top: ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); bytes_evicted += abl2->b_asize; ab->b_l2hdr = NULL; + /* + * We are destroying l2hdr, so ensure that + * its compressed buffer, if any, is not leaked. + */ + ASSERT(abl2->b_tmp_cdata == NULL); kmem_free(abl2, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -ab->b_size); } @@ -5202,6 +5236,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_de buf_data = l2hdr->b_tmp_cdata; buf_sz = l2hdr->b_asize; + /* + * If the data has not been compressed, then clear b_tmp_cdata + * to make sure that it points only to a temporary compression + * buffer. + */ + if (!L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)) + l2hdr->b_tmp_cdata = NULL; + /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { uint64_t buf_p_sz; @@ -5392,15 +5434,18 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *a { l2arc_buf_hdr_t *l2hdr = ab->b_l2hdr; - if (l2hdr->b_compress == ZIO_COMPRESS_LZ4) { + ASSERT(L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)); + if (l2hdr->b_compress != ZIO_COMPRESS_EMPTY) { /* * If the data was compressed, then we've allocated a * temporary buffer for it, so now we need to release it. */ ASSERT(l2hdr->b_tmp_cdata != NULL); zio_data_buf_free(l2hdr->b_tmp_cdata, ab->b_size); + l2hdr->b_tmp_cdata = NULL; + } else { + ASSERT(l2hdr->b_tmp_cdata == NULL); } - l2hdr->b_tmp_cdata = NULL; } /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 12:19:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B4EA39B; Thu, 6 Nov 2014 12:19:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5869E611; Thu, 6 Nov 2014 12:19:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6CJeJw020287; Thu, 6 Nov 2014 12:19:40 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6CJeCf020286; Thu, 6 Nov 2014 12:19:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201411061219.sA6CJeCf020286@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 6 Nov 2014 12:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274173 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 12:19:40 -0000 Author: bz Date: Thu Nov 6 12:19:39 2014 New Revision: 274173 URL: https://svnweb.freebsd.org/changeset/base/274173 Log: After the changes in r274118 make NOIP kernels compile by hiding an otherwise unused variable declaration behind INET6 || INET. MFC after: 27 days X-MFS with: r274118 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Thu Nov 6 11:08:02 2014 (r274172) +++ head/sys/kern/vfs_export.c Thu Nov 6 12:19:39 2014 (r274173) @@ -103,7 +103,9 @@ vfs_hang_addrlist(struct mount *mp, stru register int i; struct radix_node *rn; struct sockaddr *saddr, *smask = 0; +#if defined(INET6) || defined(INET) int off; +#endif int error; /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:05:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 106ECCB for ; Thu, 6 Nov 2014 13:05:30 +0000 (UTC) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 980C9BFF for ; Thu, 6 Nov 2014 13:05:29 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi2so1419278wib.1 for ; Thu, 06 Nov 2014 05:05:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=xn7HOMRC/VHDV0VslN2190azGwckhk39QdJLxpVZsYA=; b=RH6ZInY/ou+8D+qZ6ZSXyHrWr1tpStiL5soyb+yhYGPtHU5+lwCglBUxGC5GWkj0hP jrm8fsRCLKVXHsDL4Q3At/l8tAYu80bb4WZJXNNP0Mwjqu3r/BjS/B2YXJ7+bJpxtg9D leBXLwIkD/SGnhxbCRqQUfe84i8AduXrxpFqWHplxLvwovpE7e7ixcby0qJcxXr+/Dm2 f6r4TmRCdBWaVDKLU6jipCnka+GHqNBj7uV2V52k0G2oaKfpsXzALVYI8Ny1V7IYMutg qSOO/fQkLTQZNvbNXjAwqtbu590ZASC7i1HJjAl3w9QqltS5o/DqbMMSpXh68wjvsKkC bDhA== X-Gm-Message-State: ALoCoQl79MsLx86hPRWZ7WG8qYgj4at+BV6cimU/fxVpkBKOkiKoss3rsOGFuPoIdxzxE30JcRKs X-Received: by 10.180.104.229 with SMTP id gh5mr40008064wib.42.1415279122461; Thu, 06 Nov 2014 05:05:22 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id gs9sm7718362wjc.47.2014.11.06.05.05.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 05:05:21 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <545B71BE.8000605@freebsd.org> Date: Thu, 06 Nov 2014 13:03:58 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274172 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201411061108.sA6B821h087308@svn.freebsd.org> In-Reply-To: <201411061108.sA6B821h087308@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 13:05:30 -0000 Nice work :) On 06/11/2014 11:08, Andriy Gapon wrote: > Author: avg > Date: Thu Nov 6 11:08:02 2014 > New Revision: 274172 > URL: https://svnweb.freebsd.org/changeset/base/274172 > > Log: > fix l2arc compression buffers leak > > We have observed that arc_release() can be called concurrently with a > l2arc in-flight write. > Also, we have observed that arc_hdr_destroy() can be called from > arc_write_done() for a zio with ZIO_FLAG_IO_REWRITE flag in similar > circumstances. > > Previously the l2arc headers would be freed while leaking their > associated compression buffers. Now the buffers are placed on > l2arc_free_on_write list for delayed freeing. This is similar to what > was already done to arc buffers that were supposed to be freed > concurrently with in-flight writes of those buffers. > > In addition to fixing the discovered leaks this change also adds some > protective code to assert that a compression buffer associated with a > l2arc header is never leaked. > > A new kstat l2_cdata_free_on_write is added. It keeps a count of > delayed compression buffer frees which previously would have been leaks. > > Tested by: Vitalij Satanivskij et al > Requested by: many > MFC after: 2 weeks > Sponsored by: HybridCluster / ClusterHQ > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 6 10:30:10 2014 (r274171) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 6 11:08:02 2014 (r274172) > @@ -387,6 +387,7 @@ typedef struct arc_stats { > kstat_named_t arcstat_l2_evict_lock_retry; > kstat_named_t arcstat_l2_evict_reading; > kstat_named_t arcstat_l2_free_on_write; > + kstat_named_t arcstat_l2_cdata_free_on_write; > kstat_named_t arcstat_l2_abort_lowmem; > kstat_named_t arcstat_l2_cksum_bad; > kstat_named_t arcstat_l2_io_error; > @@ -464,6 +465,7 @@ static arc_stats_t arc_stats = { > { "l2_evict_lock_retry", KSTAT_DATA_UINT64 }, > { "l2_evict_reading", KSTAT_DATA_UINT64 }, > { "l2_free_on_write", KSTAT_DATA_UINT64 }, > + { "l2_cdata_free_on_write", KSTAT_DATA_UINT64 }, > { "l2_abort_lowmem", KSTAT_DATA_UINT64 }, > { "l2_cksum_bad", KSTAT_DATA_UINT64 }, > { "l2_io_error", KSTAT_DATA_UINT64 }, > @@ -1655,6 +1657,21 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta > data, metadata, hits); > } > > +static void > +arc_buf_free_on_write(void *data, size_t size, > + void (*free_func)(void *, size_t)) > +{ > + l2arc_data_free_t *df; > + > + df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); > + df->l2df_data = data; > + df->l2df_size = size; > + df->l2df_func = free_func; > + mutex_enter(&l2arc_free_on_write_mtx); > + list_insert_head(l2arc_free_on_write, df); > + mutex_exit(&l2arc_free_on_write_mtx); > +} > + > /* > * Free the arc data buffer. If it is an l2arc write in progress, > * the buffer is placed on l2arc_free_on_write to be freed later. > @@ -1665,14 +1682,7 @@ arc_buf_data_free(arc_buf_t *buf, void ( > arc_buf_hdr_t *hdr = buf->b_hdr; > > if (HDR_L2_WRITING(hdr)) { > - l2arc_data_free_t *df; > - df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); > - df->l2df_data = buf->b_data; > - df->l2df_size = hdr->b_size; > - df->l2df_func = free_func; > - mutex_enter(&l2arc_free_on_write_mtx); > - list_insert_head(l2arc_free_on_write, df); > - mutex_exit(&l2arc_free_on_write_mtx); > + arc_buf_free_on_write(buf->b_data, hdr->b_size, free_func); > ARCSTAT_BUMP(arcstat_l2_free_on_write); > } else { > free_func(buf->b_data, hdr->b_size); > @@ -1684,6 +1694,23 @@ arc_buf_data_free(arc_buf_t *buf, void ( > * arc_buf_t off of the the arc_buf_hdr_t's list and free it. > */ > static void > +arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) > +{ > + l2arc_buf_hdr_t *l2hdr = hdr->b_l2hdr; > + > + ASSERT(MUTEX_HELD(&l2arc_buflist_mtx)); > + > + if (l2hdr->b_tmp_cdata == NULL) > + return; > + > + ASSERT(HDR_L2_WRITING(hdr)); > + arc_buf_free_on_write(l2hdr->b_tmp_cdata, hdr->b_size, > + zio_data_buf_free); > + ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); > + l2hdr->b_tmp_cdata = NULL; > +} > + > +static void > arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) > { > arc_buf_t **bufp; > @@ -1782,6 +1809,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) > trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, > hdr->b_size, 0); > list_remove(l2hdr->b_dev->l2ad_buflist, hdr); > + arc_buf_l2_cdata_free(hdr); > ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size); > ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); > vdev_space_update(l2hdr->b_dev->l2ad_vdev, > @@ -3675,6 +3703,7 @@ arc_release(arc_buf_t *buf, void *tag) > l2hdr = hdr->b_l2hdr; > if (l2hdr) { > mutex_enter(&l2arc_buflist_mtx); > + arc_buf_l2_cdata_free(hdr); > hdr->b_l2hdr = NULL; > list_remove(l2hdr->b_dev->l2ad_buflist, hdr); > } > @@ -4964,6 +4993,11 @@ top: > ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); > bytes_evicted += abl2->b_asize; > ab->b_l2hdr = NULL; > + /* > + * We are destroying l2hdr, so ensure that > + * its compressed buffer, if any, is not leaked. > + */ > + ASSERT(abl2->b_tmp_cdata == NULL); > kmem_free(abl2, sizeof (l2arc_buf_hdr_t)); > ARCSTAT_INCR(arcstat_l2_size, -ab->b_size); > } > @@ -5202,6 +5236,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_de > buf_data = l2hdr->b_tmp_cdata; > buf_sz = l2hdr->b_asize; > > + /* > + * If the data has not been compressed, then clear b_tmp_cdata > + * to make sure that it points only to a temporary compression > + * buffer. > + */ > + if (!L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)) > + l2hdr->b_tmp_cdata = NULL; > + > /* Compression may have squashed the buffer to zero length. */ > if (buf_sz != 0) { > uint64_t buf_p_sz; > @@ -5392,15 +5434,18 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *a > { > l2arc_buf_hdr_t *l2hdr = ab->b_l2hdr; > > - if (l2hdr->b_compress == ZIO_COMPRESS_LZ4) { > + ASSERT(L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)); > + if (l2hdr->b_compress != ZIO_COMPRESS_EMPTY) { > /* > * If the data was compressed, then we've allocated a > * temporary buffer for it, so now we need to release it. > */ > ASSERT(l2hdr->b_tmp_cdata != NULL); > zio_data_buf_free(l2hdr->b_tmp_cdata, ab->b_size); > + l2hdr->b_tmp_cdata = NULL; > + } else { > + ASSERT(l2hdr->b_tmp_cdata == NULL); > } > - l2hdr->b_tmp_cdata = NULL; > } > > /* > From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:12:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C8A737B; Thu, 6 Nov 2014 13:12:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ECD66CD2; Thu, 6 Nov 2014 13:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6DCCDH047913; Thu, 6 Nov 2014 13:12:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6DCCoW047912; Thu, 6 Nov 2014 13:12:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061312.sA6DCCoW047912@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 13:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274174 - head/usr.sbin/fifolog/fifolog_reader 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 13:12:13 -0000 Author: bapt Date: Thu Nov 6 13:12:12 2014 New Revision: 274174 URL: https://svnweb.freebsd.org/changeset/base/274174 Log: fifolog_reader does not depend on libutil Modified: head/usr.sbin/fifolog/fifolog_reader/Makefile Modified: head/usr.sbin/fifolog/fifolog_reader/Makefile ============================================================================== --- head/usr.sbin/fifolog/fifolog_reader/Makefile Thu Nov 6 12:19:39 2014 (r274173) +++ head/usr.sbin/fifolog/fifolog_reader/Makefile Thu Nov 6 13:12:12 2014 (r274174) @@ -6,8 +6,8 @@ CFLAGS+= -I${.CURDIR}/../lib MAN= -DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} -LDADD= ${LIBFIFOLOG} -lutil -lz +DPADD= ${LIBFIFOLOG} ${LIBZ} +LDADD= ${LIBFIFOLOG} -lz regress: ./${PROG} /tmp/fifolog.0 From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:13:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA62B59C; Thu, 6 Nov 2014 13:13:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94CBDCDE; Thu, 6 Nov 2014 13:13:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6DDDGn048193; Thu, 6 Nov 2014 13:13:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6DD9Gw048172; Thu, 6 Nov 2014 13:13:09 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411061313.sA6DD9Gw048172@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 6 Nov 2014 13:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274175 - in head/sys: net netinet netinet6 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 13:13:13 -0000 Author: melifaro Date: Thu Nov 6 13:13:09 2014 New Revision: 274175 URL: https://svnweb.freebsd.org/changeset/base/274175 Log: Make checks for rt_mtu generic: Some virtual if drivers has (ab)used ifa ifa_rtrequest hook to enforce route MTU to be not bigger that interface MTU. While ifa_rtrequest hooking might be an option in some situation, it is not feasible to do MTU checks there: generic (or per-domain) routing code is perfectly capable of doing this. We currrently have 3 places where MTU is altered: 1) route addition. In this case domain overrides radix _addroute callback (in[6]_addroute) and all necessary checks/fixes are/can be done there. 2) route change (especially, GW change). In this case, there are no explicit per-domain calls, but one can override rte by setting ifa_rtrequest hook to domain handler (inet6 does this). 3) ifconfig ifaceX mtu YYYY In this case, we have no callbacks, but ip[6]_output performes runtime checks and decreases rt_mtu if necessary. Generally, the goals are to be able to handle all MTU changes in control plane, not in runtime part, and properly deal with increased interface MTU. This commit changes the following: * removes hooks setting MTU from drivers side * adds proper per-doman MTU checks for case 1) * adds generic MTU check for case 2) * The latter is done by using new dom_ifmtu callback since if_mtu denotes L3 interface MTU, e.g. maximum trasmitted _packet_ size. However, IPv6 mtu might be different from if_mtu one (e.g. default 1280) for some cases, so we need an abstract way to know maximum MTU size for given interface and domain. * moves rt_setmetrics() before MTU/ifa_rtrequest hooks since it copies user-supplied data which must be checked. * removes RT_LOCK_ASSERT() from other ifa_rtrequest hooks to be able to use this functions on new non-inserted rte. More changes will follow soon. MFC after: 1 month Sponsored by: Yandex LLC Modified: head/sys/net/if.c head/sys/net/if_disc.c head/sys/net/if_faith.c head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/if_var.h head/sys/net/route.c head/sys/netinet/in_rmx.c head/sys/netinet6/in6.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h head/sys/netinet6/nd6.c head/sys/sys/domain.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if.c Thu Nov 6 13:13:09 2014 (r274175) @@ -2009,8 +2009,6 @@ link_rtrequest(int cmd, struct rtentry * struct sockaddr *dst; struct ifnet *ifp; - RT_LOCK_ASSERT(rt); - if (cmd != RTM_ADD || ((ifa = rt->rt_ifa) == 0) || ((ifp = ifa->ifa_ifp) == 0) || ((dst = rt_key(rt)) == 0)) return; @@ -3759,6 +3757,19 @@ if_getmtu(if_t ifp) } int +if_getmtu_family(if_t ifp, int family) +{ + struct domain *dp; + + for (dp = domains; dp; dp = dp->dom_next) { + if (dp->dom_family == family && dp->dom_ifmtu != NULL) + return (dp->dom_ifmtu((struct ifnet *)ifp)); + } + + return (((struct ifnet *)ifp)->if_mtu); +} + +int if_setsoftc(if_t ifp, void *softc) { ((struct ifnet *)ifp)->if_softc = softc; Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if_disc.c Thu Nov 6 13:13:09 2014 (r274175) @@ -67,7 +67,6 @@ struct disc_softc { static int discoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *); static int discioctl(struct ifnet *, u_long, caddr_t); static int disc_clone_create(struct if_clone *, int, caddr_t); static void disc_clone_destroy(struct ifnet *); @@ -198,31 +197,19 @@ discoutput(struct ifnet *ifp, struct mbu return (0); } -/* ARGSUSED */ -static void -discrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) -{ - - RT_LOCK_ASSERT(rt); - rt->rt_mtu = DSMTU; -} - /* * Process an ioctl request. */ static int discioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ifaddr *ifa; struct ifreq *ifr = (struct ifreq *)data; int error = 0; switch (cmd) { case SIOCSIFADDR: ifp->if_flags |= IFF_UP; - ifa = (struct ifaddr *)data; - if (ifa != 0) - ifa->ifa_rtrequest = discrtrequest; + /* * Everything else is done at a higher level. */ Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if_faith.c Thu Nov 6 13:13:09 2014 (r274175) @@ -87,7 +87,6 @@ struct faith_softc { static int faithioctl(struct ifnet *, u_long, caddr_t); static int faithoutput(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *); #ifdef INET6 static int faithprefix(struct in6_addr *); #endif @@ -238,17 +237,6 @@ faithoutput(struct ifnet *ifp, struct mb return (0); } -/* ARGSUSED */ -static void -faithrtrequest(cmd, rt, info) - int cmd; - struct rtentry *rt; - struct rt_addrinfo *info; -{ - RT_LOCK_ASSERT(rt); - rt->rt_mtu = rt->rt_ifp->if_mtu; -} - /* * Process an ioctl request. */ @@ -259,7 +247,6 @@ faithioctl(ifp, cmd, data) u_long cmd; caddr_t data; { - struct ifaddr *ifa; struct ifreq *ifr = (struct ifreq *)data; int error = 0; @@ -268,8 +255,7 @@ faithioctl(ifp, cmd, data) case SIOCSIFADDR: ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifa = (struct ifaddr *)data; - ifa->ifa_rtrequest = faithrtrequest; + /* * Everything else is done at a higher level. */ Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if_loop.c Thu Nov 6 13:13:09 2014 (r274175) @@ -88,7 +88,6 @@ CSUM_SCTP_VALID) int loioctl(struct ifnet *, u_long, caddr_t); -static void lortrequest(int, struct rtentry *, struct rt_addrinfo *); int looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro); static int lo_clone_create(struct if_clone *, int, caddr_t); @@ -364,15 +363,6 @@ if_simloop(struct ifnet *ifp, struct mbu return (0); } -/* ARGSUSED */ -static void -lortrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info) -{ - - RT_LOCK_ASSERT(rt); - rt->rt_mtu = rt->rt_ifp->if_mtu; -} - /* * Process an ioctl request. */ @@ -380,7 +370,6 @@ lortrequest(int cmd, struct rtentry *rt, int loioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct ifaddr *ifa; struct ifreq *ifr = (struct ifreq *)data; int error = 0, mask; @@ -388,8 +377,6 @@ loioctl(struct ifnet *ifp, u_long cmd, c case SIOCSIFADDR: ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifa = (struct ifaddr *)data; - ifa->ifa_rtrequest = lortrequest; /* * Everything else is done at a higher level. */ Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if_stf.c Thu Nov 6 13:13:09 2014 (r274175) @@ -179,7 +179,6 @@ static int stf_checkaddr4(struct stf_sof struct ifnet *); static int stf_checkaddr6(struct stf_softc *, struct in6_addr *, struct ifnet *); -static void stf_rtrequest(int, struct rtentry *, struct rt_addrinfo *); static int stf_ioctl(struct ifnet *, u_long, caddr_t); static int stf_clone_match(struct if_clone *, const char *); @@ -722,17 +721,6 @@ in_stf_input(struct mbuf **mp, int *offp return (IPPROTO_DONE); } -/* ARGSUSED */ -static void -stf_rtrequest(cmd, rt, info) - int cmd; - struct rtentry *rt; - struct rt_addrinfo *info; -{ - RT_LOCK_ASSERT(rt); - rt->rt_mtu = rt->rt_ifp->if_mtu; -} - static int stf_ioctl(ifp, cmd, data) struct ifnet *ifp; @@ -764,7 +752,6 @@ stf_ioctl(ifp, cmd, data) break; } - ifa->ifa_rtrequest = stf_rtrequest; ifp->if_flags |= IFF_UP; break; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/if_var.h Thu Nov 6 13:13:09 2014 (r274175) @@ -556,6 +556,7 @@ void *if_getsoftc(if_t ifp); int if_setflags(if_t ifp, int flags); int if_setmtu(if_t ifp, int mtu); int if_getmtu(if_t ifp); +int if_getmtu_family(if_t ifp, int family); int if_setflagbits(if_t ifp, int set, int clear); int if_getflags(if_t ifp); int if_sendq_empty(if_t ifp); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/net/route.c Thu Nov 6 13:13:09 2014 (r274175) @@ -1279,6 +1279,8 @@ rtrequest1_fib(int req, struct rt_addrin rt->rt_ifp = ifa->ifa_ifp; rt->rt_weight = 1; + rt_setmetrics(info, rt); + #ifdef RADIX_MPATH /* do not permit exactly the same dst/mask/gw pair */ if (rn_mpath_capable(rnh) && @@ -1373,8 +1375,6 @@ rtrequest1_fib(int req, struct rt_addrin if (ifa->ifa_rtrequest) ifa->ifa_rtrequest(req, rt, info); - rt_setmetrics(info, rt); - /* * actually return a resultant rtentry and * give the caller a single reference. @@ -1412,6 +1412,7 @@ rtrequest1_fib_change(struct radix_node_ struct rtentry *rt = NULL; int error = 0; int free_ifa = 0; + int family, mtu; rt = (struct rtentry *)rnh->rnh_lookup(info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], rnh); @@ -1433,6 +1434,8 @@ rtrequest1_fib_change(struct radix_node_ RT_LOCK(rt); + rt_setmetrics(info, rt); + /* * New gateway could require new ifaddr, ifp; * flags may also be different; ifp may be specified @@ -1480,7 +1483,13 @@ rtrequest1_fib_change(struct radix_node_ if (rt->rt_ifa && rt->rt_ifa->ifa_rtrequest != NULL) rt->rt_ifa->ifa_rtrequest(RTM_ADD, rt, info); - rt_setmetrics(info, rt); + /* Ensure route MTU is not bigger than interface MTU */ + if (rt->rt_ifp != NULL) { + family = info->rti_info[RTAX_DST]->sa_family; + mtu = if_getmtu_family(rt->rt_ifp, family); + if (rt->rt_mtu > mtu) + rt->rt_mtu = mtu; + } if (ret_nrt) { *ret_nrt = rt; Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet/in_rmx.c Thu Nov 6 13:13:09 2014 (r274175) @@ -94,8 +94,18 @@ in_addroute(void *v_arg, void *n_arg, st if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) rt->rt_flags |= RTF_MULTICAST; - if (rt->rt_mtu == 0 && rt->rt_ifp != NULL) - rt->rt_mtu = rt->rt_ifp->if_mtu; + if (rt->rt_ifp != NULL) { + + /* + * Check route MTU: + * inherit interface MTU if not set or + * check if MTU is too large. + */ + if (rt->rt_mtu == 0) { + rt->rt_mtu = rt->rt_ifp->if_mtu; + } else if (rt->rt_mtu > rt->rt_ifp->if_mtu) + rt->rt_mtu = rt->rt_ifp->if_mtu; + } return (rn_addroute(v_arg, n_arg, head, treenodes)); } Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet6/in6.c Thu Nov 6 13:13:09 2014 (r274175) @@ -2367,6 +2367,13 @@ in6_domifattach(struct ifnet *ifp) return ext; } +int +in6_domifmtu(struct ifnet *ifp) +{ + + return (IN6_LINKMTU(ifp)); +} + void in6_domifdetach(struct ifnet *ifp, void *aux) { Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet6/in6_proto.c Thu Nov 6 13:13:09 2014 (r274175) @@ -382,7 +382,8 @@ struct domain inet6domain = { .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, - .dom_ifdetach = in6_domifdetach + .dom_ifdetach = in6_domifdetach, + .dom_ifmtu = in6_domifmtu }; VNET_DOMAIN_SET(inet6); Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet6/in6_rmx.c Thu Nov 6 13:13:09 2014 (r274175) @@ -136,8 +136,18 @@ in6_addroute(void *v_arg, void *n_arg, s } } - if (!rt->rt_mtu && rt->rt_ifp) - rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); + if (rt->rt_ifp != NULL) { + + /* + * Check route MTU: + * inherit interface MTU if not set or + * check if MTU is too large. + */ + if (rt->rt_mtu == 0) { + rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); + } else if (rt->rt_mtu > IN6_LINKMTU(rt->rt_ifp)) + rt->rt_mtu = IN6_LINKMTU(rt->rt_ifp); + } ret = rn_addroute(v_arg, n_arg, head, treenodes); if (ret == NULL) { Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet6/in6_var.h Thu Nov 6 13:13:09 2014 (r274175) @@ -807,6 +807,7 @@ int in6if_do_dad(struct ifnet *); void in6_savemkludge(struct in6_ifaddr *); void *in6_domifattach(struct ifnet *); void in6_domifdetach(struct ifnet *, void *); +int in6_domifmtu(struct ifnet *); void in6_setmaxmtu(void); int in6_if2idlen(struct ifnet *); struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/netinet6/nd6.c Thu Nov 6 13:13:09 2014 (r274175) @@ -1188,7 +1188,6 @@ nd6_rtrequest(int req, struct rtentry *r struct nd_defrouter *dr; struct ifnet *ifp; - RT_LOCK_ASSERT(rt); gateway = (struct sockaddr_in6 *)rt->rt_gateway; ifp = rt->rt_ifp; Modified: head/sys/sys/domain.h ============================================================================== --- head/sys/sys/domain.h Thu Nov 6 13:12:12 2014 (r274174) +++ head/sys/sys/domain.h Thu Nov 6 13:13:09 2014 (r274175) @@ -64,6 +64,7 @@ struct domain { int dom_maxrtkey; /* for routing layer */ void *(*dom_ifattach)(struct ifnet *); void (*dom_ifdetach)(struct ifnet *, void *); + int (*dom_ifmtu)(struct ifnet *); /* af-dependent data on ifnet */ }; From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 13:13:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC89B6F7; Thu, 6 Nov 2014 13:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8A97CEF; Thu, 6 Nov 2014 13:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6DDlZJ048320; Thu, 6 Nov 2014 13:13:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6DDlq1048319; Thu, 6 Nov 2014 13:13:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061313.sA6DDlq1048319@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 13:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274176 - head/usr.sbin/fifolog/fifolog_writer 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 13:13:48 -0000 Author: bapt Date: Thu Nov 6 13:13:47 2014 New Revision: 274176 URL: https://svnweb.freebsd.org/changeset/base/274176 Log: fifolog_writer does not depend on libutil Modified: head/usr.sbin/fifolog/fifolog_writer/Makefile Modified: head/usr.sbin/fifolog/fifolog_writer/Makefile ============================================================================== --- head/usr.sbin/fifolog/fifolog_writer/Makefile Thu Nov 6 13:13:09 2014 (r274175) +++ head/usr.sbin/fifolog/fifolog_writer/Makefile Thu Nov 6 13:13:47 2014 (r274176) @@ -6,8 +6,8 @@ CFLAGS+= -I${.CURDIR}/../lib MAN= -DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} -LDADD= ${LIBFIFOLOG} -lutil -lz +DPADD= ${LIBFIFOLOG} ${LIBZ} +LDADD= ${LIBFIFOLOG} -lz regress: date | ./${PROG} -z 0 /tmp/fifolog.0 From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 14:39:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EFA27DD; Thu, 6 Nov 2014 14:39:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC1381F; Thu, 6 Nov 2014 14:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Ed57F086325; Thu, 6 Nov 2014 14:39:05 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Ed4f4086315; Thu, 6 Nov 2014 14:39:04 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411061439.sA6Ed4f4086315@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 6 Nov 2014 14:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274177 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 14:39:06 -0000 Author: melifaro Date: Thu Nov 6 14:39:04 2014 New Revision: 274177 URL: https://svnweb.freebsd.org/changeset/base/274177 Log: Finish r274118: remove useless fields from struct domain. Sponsored by: Yandex LLC Modified: head/share/man/man9/domain.9 head/sys/net/route.c head/sys/netinet/in_proto.c head/sys/netinet6/in6_proto.c head/sys/sys/domain.h Modified: head/share/man/man9/domain.9 ============================================================================== --- head/share/man/man9/domain.9 Thu Nov 6 13:13:47 2014 (r274176) +++ head/share/man/man9/domain.9 Thu Nov 6 14:39:04 2014 (r274177) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2012 +.Dd November 6, 2014 .Dt DOMAIN 9 .Os .Sh NAME @@ -82,10 +82,9 @@ struct domain { (void **, int); int (*dom_rtdetach) /* clean up routing table */ (void **, int); - int dom_rtoffset; /* an arg to rtattach, in bits */ - int dom_maxrtkey; /* for routing layer */ void *(*dom_ifattach)(struct ifnet *); void (*dom_ifdetach)(struct ifnet *, void *); + int (*dom_ifmtu)(struct ifnet *); /* af-dependent data on ifnet */ }; .Ed Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Nov 6 13:13:47 2014 (r274176) +++ head/sys/net/route.c Thu Nov 6 14:39:04 2014 (r274177) @@ -264,15 +264,10 @@ vnet_route_init(const void *unused __unu if (table != 0 && fam != AF_INET6 && fam != AF_INET) break; - /* - * XXX MRT rtattach will be also called from - * vfs_export.c but the offset will be 0 (only for - * AF_INET and AF_INET6 which don't need it anyhow). - */ rnh = rt_tables_get_rnh_ptr(table, fam); if (rnh == NULL) panic("%s: rnh NULL", __func__); - dom->dom_rtattach((void **)rnh, dom->dom_rtoffset); + dom->dom_rtattach((void **)rnh, 0); } } } Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Thu Nov 6 13:13:47 2014 (r274176) +++ head/sys/netinet/in_proto.c Thu Nov 6 14:39:04 2014 (r274177) @@ -365,8 +365,6 @@ struct domain inetdomain = { #ifdef VIMAGE .dom_rtdetach = in_detachhead, #endif - .dom_rtoffset = 32, - .dom_maxrtkey = sizeof(struct sockaddr_in), .dom_ifattach = in_domifattach, .dom_ifdetach = in_domifdetach }; Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Thu Nov 6 13:13:47 2014 (r274176) +++ head/sys/netinet6/in6_proto.c Thu Nov 6 14:39:04 2014 (r274177) @@ -379,8 +379,6 @@ struct domain inet6domain = { #ifdef VIMAGE .dom_rtdetach = in6_detachhead, #endif - .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, - .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach, .dom_ifmtu = in6_domifmtu Modified: head/sys/sys/domain.h ============================================================================== --- head/sys/sys/domain.h Thu Nov 6 13:13:47 2014 (r274176) +++ head/sys/sys/domain.h Thu Nov 6 14:39:04 2014 (r274177) @@ -60,8 +60,6 @@ struct domain { (void **, int); int (*dom_rtdetach) /* clean up routing table */ (void **, int); - int dom_rtoffset; /* an arg to rtattach, in bits */ - int dom_maxrtkey; /* for routing layer */ void *(*dom_ifattach)(struct ifnet *); void (*dom_ifdetach)(struct ifnet *, void *); int (*dom_ifmtu)(struct ifnet *); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 15:17:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67AE33F0; Thu, 6 Nov 2014 15:17:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53C82C64; Thu, 6 Nov 2014 15:17:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6FH5EY004996; Thu, 6 Nov 2014 15:17:05 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6FH5sd004994; Thu, 6 Nov 2014 15:17:05 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411061517.sA6FH5sd004994@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 6 Nov 2014 15:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274178 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 15:17:05 -0000 Author: melifaro Date: Thu Nov 6 15:17:04 2014 New Revision: 274178 URL: https://svnweb.freebsd.org/changeset/base/274178 Log: Finish r274118#2: commit forgotten uipc_debug.c Modified: head/sys/kern/uipc_debug.c Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Thu Nov 6 14:39:04 2014 (r274177) +++ head/sys/kern/uipc_debug.c Thu Nov 6 15:17:04 2014 (r274178) @@ -255,8 +255,6 @@ db_print_domain(struct domain *d, const db_print_indent(indent); db_printf("dom_rtattach: %p ", d->dom_rtattach); - db_printf("dom_rtoffset: %d ", d->dom_rtoffset); - db_printf("dom_maxrtkey: %d\n", d->dom_maxrtkey); db_print_indent(indent); db_printf("dom_ifattach: %p ", d->dom_ifattach); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:16:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E206F97 for ; Thu, 6 Nov 2014 16:16:35 +0000 (UTC) Received: from vfemail.net (nine.vfemail.net [108.76.175.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA9B35C for ; Thu, 6 Nov 2014 16:16:33 +0000 (UTC) Received: (qmail 29329 invoked by uid 89); 6 Nov 2014 16:11:28 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 6 Nov 2014 16:11:23 -0000 Received: (qmail 12229 invoked by uid 89); 6 Nov 2014 15:09:13 -0000 Received: by simscan 1.3.1 ppid: 12189, pid: 12195, t: 0.3134s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 6 Nov 2014 15:09:12 -0000 Received: (qmail 15388 invoked by uid 89); 6 Nov 2014 15:09:12 -0000 Received: by simscan 1.4.0 ppid: 15348, pid: 15370, t: 1.0068s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by 172.16.100.62 with ESMTPA; 6 Nov 2014 15:09:11 -0000 From: Jan Beich To: "Alexander V. Chernikov" Subject: Re: svn commit: r274177 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys References: <201411061439.sA6Ed4f4086315@svn.freebsd.org> Date: Thu, 06 Nov 2014 16:09:05 +0100 In-Reply-To: <201411061439.sA6Ed4f4086315@svn.freebsd.org> (Alexander V. Chernikov's message of "Thu, 6 Nov 2014 14:39:04 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:16:35 -0000 "Alexander V. Chernikov" writes: > Log: > Finish r274118: remove useless fields from struct domain. [...] > Modified: head/sys/sys/domain.h > ============================================================================== > --- head/sys/sys/domain.h Thu Nov 6 13:13:47 2014 (r274176) > +++ head/sys/sys/domain.h Thu Nov 6 14:39:04 2014 (r274177) > @@ -60,8 +60,6 @@ struct domain { > (void **, int); > int (*dom_rtdetach) /* clean up routing table */ > (void **, int); > - int dom_rtoffset; /* an arg to rtattach, in bits */ > - int dom_maxrtkey; /* for routing layer */ > void *(*dom_ifattach)(struct ifnet *); > void (*dom_ifdetach)(struct ifnet *, void *); > int (*dom_ifmtu)(struct ifnet *); It breaks build for options DDB, default in GENERIC on -CURRENT branch. $ make buildkernel ... --- uipc_debug.o --- sys/kern/uipc_debug.c:258:38: error: no member named 'dom_rtoffset' in 'struct domain' db_printf("dom_rtoffset: %d ", d->dom_rtoffset); ~ ^ sys/kern/uipc_debug.c:259:37: error: no member named 'dom_maxrtkey' in 'struct domain' db_printf("dom_maxrtkey: %d\n", d->dom_maxrtkey); ~ ^ ------------------------------------------------- VFEmail.net - http://www.vfemail.net ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options! From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:17:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92112FF5; Thu, 6 Nov 2014 16:17:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EAE3369; Thu, 6 Nov 2014 16:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GHgDf033029; Thu, 6 Nov 2014 16:17:42 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GHgOm033028; Thu, 6 Nov 2014 16:17:42 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411061617.sA6GHgOm033028@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 6 Nov 2014 16:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274179 - head/usr.bin/w 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:17:42 -0000 Author: marcel Date: Thu Nov 6 16:17:41 2014 New Revision: 274179 URL: https://svnweb.freebsd.org/changeset/base/274179 Log: Sort the references in "SEE ALSO" by section first; then alphabetically. Pointed out by: brueffer@ Modified: head/usr.bin/w/w.1 Modified: head/usr.bin/w/w.1 ============================================================================== --- head/usr.bin/w/w.1 Thu Nov 6 15:17:04 2014 (r274178) +++ head/usr.bin/w/w.1 Thu Nov 6 16:17:41 2014 (r274179) @@ -98,11 +98,11 @@ and flags are no longer supported. .Sh SEE ALSO .Xr finger 1 , -.Xr libxo 3 , .Xr ps 1 , .Xr uptime 1 , -.Xr xo_parse_args 3 , -.Xr who 1 +.Xr who 1 , +.Xr libxo 3 , +.Xr xo_parse_args 3 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:19:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A68E1E2; Thu, 6 Nov 2014 16:19:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26A6D37B; Thu, 6 Nov 2014 16:19:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GJMQg033276; Thu, 6 Nov 2014 16:19:22 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GJM9Q033275; Thu, 6 Nov 2014 16:19:22 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411061619.sA6GJM9Q033275@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Thu, 6 Nov 2014 16:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274180 - head/usr.bin/wc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:19:22 -0000 Author: marcel Date: Thu Nov 6 16:19:21 2014 New Revision: 274180 URL: https://svnweb.freebsd.org/changeset/base/274180 Log: Separate references by a comma. Modified: head/usr.bin/wc/wc.1 Modified: head/usr.bin/wc/wc.1 ============================================================================== --- head/usr.bin/wc/wc.1 Thu Nov 6 16:17:41 2014 (r274179) +++ head/usr.bin/wc/wc.1 Thu Nov 6 16:19:21 2014 (r274180) @@ -175,8 +175,8 @@ option of the GNU .Nm utility. .Sh SEE ALSO -.Xr iswspace 3 -.Xr libxo 3 +.Xr iswspace 3 , +.Xr libxo 3 , .Xr xo_parse_args 3 .Sh STANDARDS The From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:20:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA28E325; Thu, 6 Nov 2014 16:20:05 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79FA3384; Thu, 6 Nov 2014 16:20:05 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XmLmR-000Anr-EQ; Thu, 06 Nov 2014 16:03:11 +0400 Message-ID: <545B9F24.9060502@FreeBSD.org> Date: Thu, 06 Nov 2014 20:17:40 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Jan Beich Subject: Re: svn commit: r274177 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys References: <201411061439.sA6Ed4f4086315@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:20:05 -0000 On 06.11.2014 19:09, Jan Beich wrote: > "Alexander V. Chernikov" writes: > >> Log: >> Finish r274118: remove useless fields from struct domain. > [...] >> Modified: head/sys/sys/domain.h >> ============================================================================== >> --- head/sys/sys/domain.h Thu Nov 6 13:13:47 2014 (r274176) >> +++ head/sys/sys/domain.h Thu Nov 6 14:39:04 2014 (r274177) >> @@ -60,8 +60,6 @@ struct domain { >> (void **, int); >> int (*dom_rtdetach) /* clean up routing table */ >> (void **, int); >> - int dom_rtoffset; /* an arg to rtattach, in bits */ >> - int dom_maxrtkey; /* for routing layer */ >> void *(*dom_ifattach)(struct ifnet *); >> void (*dom_ifdetach)(struct ifnet *, void *); >> int (*dom_ifmtu)(struct ifnet *); > It breaks build for options DDB, default in GENERIC on -CURRENT branch. Yes, this was fixed in r274178. Thanks for reporting! > > $ make buildkernel > ... > --- uipc_debug.o --- > sys/kern/uipc_debug.c:258:38: error: no member named 'dom_rtoffset' in 'struct domain' > db_printf("dom_rtoffset: %d ", d->dom_rtoffset); > ~ ^ > sys/kern/uipc_debug.c:259:37: error: no member named 'dom_maxrtkey' in 'struct domain' > db_printf("dom_maxrtkey: %d\n", d->dom_maxrtkey); > ~ ^ > > ------------------------------------------------- > > VFEmail.net - http://www.vfemail.net > ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! > $24.95 ONETIME Lifetime accounts with Privacy Features! > 15GB disk! No bandwidth quotas! > Commercial and Bulk Mail Options! > > From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:31:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B5B7362B; Thu, 6 Nov 2014 16:31:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1B9C765; Thu, 6 Nov 2014 16:31:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GVnTH041002; Thu, 6 Nov 2014 16:31:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GVnVB041001; Thu, 6 Nov 2014 16:31:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411061631.sA6GVnVB041001@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Nov 2014 16:31:49 +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: r274181 - stable/9/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:31:49 -0000 Author: ae Date: Thu Nov 6 16:31:48 2014 New Revision: 274181 URL: https://svnweb.freebsd.org/changeset/base/274181 Log: MFC r273855: Fix mbuf leak in IPv6 multicast code. When multicast capable interface goes away, it leaves multicast groups, this leads to generate MLD reports, but MLD code does deffered send and MLD reports are queued in the in6_multi's in6m_scq ifq. The problem is that in6_multi structures are freed when interface leaves multicast groups and thread that does deffered send will not take these queued packets. PR: 194577 MFC r273857: Move ifq drain into in6m_purge(). Suggested by: bms Sponsored by: Yandex LLC Modified: stable/9/sys/netinet6/in6_mcast.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/in6_mcast.c ============================================================================== --- stable/9/sys/netinet6/in6_mcast.c Thu Nov 6 16:19:21 2014 (r274180) +++ stable/9/sys/netinet6/in6_mcast.c Thu Nov 6 16:31:48 2014 (r274181) @@ -1075,6 +1075,8 @@ in6m_purge(struct in6_multi *inm) free(ims, M_IP6MSOURCE); inm->in6m_nsrc--; } + /* Free state-change requests that might be queued. */ + _IF_DRAIN(&inm->in6m_scq); } /* From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:32:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D53E75E; Thu, 6 Nov 2014 16:32:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED1E769; Thu, 6 Nov 2014 16:32:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GW1v6042162; Thu, 6 Nov 2014 16:32:01 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GW0T5042045; Thu, 6 Nov 2014 16:32:00 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201411061632.sA6GW0T5042045@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Thu, 6 Nov 2014 16:32: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: r274182 - stable/10/usr.bin/bluetooth/rfcomm_sppd 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:32:01 -0000 Author: emax Date: Thu Nov 6 16:32:00 2014 New Revision: 274182 URL: https://svnweb.freebsd.org/changeset/base/274182 Log: MFC r273548 Change the code to use the openpty(3) API which uses the pts(4) driver instead of the pty(4) driver. PR: 184597 Submitted by: tobias.rehbein Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/Makefile Thu Nov 6 16:32:00 2014 (r274182) @@ -6,6 +6,6 @@ SRCS= rfcomm_sppd.c rfcomm_sdp.c WARNS?= 2 DPADD= ${LIBBLUETOOTH} ${LIBSDP} -LDADD= -lbluetooth -lsdp +LDADD= -lbluetooth -lsdp -lutil .include Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.1 Thu Nov 6 16:32:00 2014 (r274182) @@ -33,10 +33,9 @@ .Nd RFCOMM Serial Port Profile daemon .Sh SYNOPSIS .Nm -.Op Fl bhS +.Op Fl bhtS .Fl a Ar address .Fl c Ar channel -.Op Fl t Ar tty .Sh DESCRIPTION The .Nm @@ -53,7 +52,7 @@ Once connection is established, the .Nm utility provides access to the server's remote serial port via stdin/stdout or via -.Xr pty 4 +.Xr pts 4 interface if .Fl t option was specified. @@ -72,8 +71,7 @@ daemon. If .Fl t options was specified, -the server side of the virtual serial port is attached to the pseudo-terminal -.Ar tty . +the server side of the virtual serial port is attached to a pseudo-terminal. Otherwise the virtual serial port is attached to the stdin/stdout. .Nm should be run as root in order to communicate with @@ -146,24 +144,22 @@ Display usage message and exit. .It Fl S Server mode; see .Sx DESCRIPTION . -.It Fl t Ar tty -Slave pseudo tty name. +.It Fl t +Use slave pseudo tty. If not set stdin/stdout will be used. This option is required if .Fl b option was specified. .El .Sh FILES -.Bl -tag -width ".Pa /dev/tty[p-sP-S][0-9a-v]" -compact -.It Pa /dev/pty[p-sP-S][0-9a-v] -master pseudo terminals -.It Pa /dev/tty[p-sP-S][0-9a-v] +.Bl -tag -width ".Pa /dev/pts/[num]" -compact +.It Pa /dev/pts/[num] slave pseudo terminals .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -.Dl "rfcomm_sppd -a 00:01:02:03:04:05 -c 1 -t /dev/ttyp1" +.Dl "rfcomm_sppd -a 00:01:02:03:04:05 -c 1 -t" .Pp Will start the .Nm @@ -171,13 +167,17 @@ utility and open RFCOMM connection to th .Li 00:01:02:03:04:05 and channel .Li 1 . -Once the connection has been established, -.Pa /dev/ttyp1 +Once the connection has been established, a +.Xr pts 4 can be used to talk to the remote serial port on the server. +.Nm +prints the name of the +.Xr pts 4 +to use on stdout. .Sh SEE ALSO .Xr bluetooth 3 , .Xr ng_btsocket 4 , -.Xr pty 4 , +.Xr pts 4 , .Xr rfcomm_pppd 8 , .Xr sdpd 8 .Sh AUTHORS Modified: stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c ============================================================================== --- stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Thu Nov 6 16:31:48 2014 (r274181) +++ stable/10/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c Thu Nov 6 16:32:00 2014 (r274182) @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -49,6 +50,7 @@ #include #include #include +#include #define SPPD_IDENT "rfcomm_sppd" #define SPPD_BUFFER_SIZE 1024 @@ -58,7 +60,7 @@ int rfcomm_channel_lookup (bdaddr_t con bdaddr_t const *remote, int service, int *channel, int *error); -static int sppd_ttys_open (char const *tty, int *amaster, int *aslave); +static int sppd_ttys_open (char **tty, int *amaster, int *aslave); static int sppd_read (int fd, char *buffer, int size); static int sppd_write (int fd, char *buffer, int size); static void sppd_sighandler (int s); @@ -74,7 +76,8 @@ main(int argc, char *argv[]) struct sockaddr_rfcomm ra; bdaddr_t addr; int n, background, channel, service, - s, amaster, aslave, fd, doserver; + s, amaster, aslave, fd, doserver, + dopty; fd_set rfd; char *tty = NULL, *ep = NULL, buf[SPPD_BUFFER_SIZE]; @@ -82,9 +85,10 @@ main(int argc, char *argv[]) background = channel = 0; service = SDP_SERVICE_CLASS_SERIAL_PORT; doserver = 0; + dopty = 0; /* Parse command line options */ - while ((n = getopt(argc, argv, "a:bc:t:hS")) != -1) { + while ((n = getopt(argc, argv, "a:bc:thS")) != -1) { switch (n) { case 'a': /* BDADDR */ if (!bt_aton(optarg, &addr)) { @@ -130,11 +134,8 @@ main(int argc, char *argv[]) background = 1; break; - case 't': /* Slave TTY name */ - if (optarg[0] != '/') - asprintf(&tty, "%s%s", _PATH_DEV, optarg); - else - tty = optarg; + case 't': /* Open pseudo TTY */ + dopty = 1; break; case 'S': @@ -173,18 +174,18 @@ main(int argc, char *argv[]) err(1, "Could not sigaction(SIGCHLD)"); /* Open TTYs */ - if (tty == NULL) { + if (dopty) { + if (sppd_ttys_open(&tty, &amaster, &aslave) < 0) + exit(1); + + fd = amaster; + } else { if (background) usage(); amaster = STDIN_FILENO; fd = STDOUT_FILENO; - } else { - if (sppd_ttys_open(tty, &amaster, &aslave) < 0) - exit(1); - - fd = amaster; - } + } /* Open RFCOMM connection */ @@ -287,6 +288,10 @@ main(int argc, char *argv[]) openlog(SPPD_IDENT, LOG_NDELAY|LOG_PERROR|LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "Starting on %s...", (tty != NULL)? tty : "stdin/stdout"); + /* Print used tty on stdout for wrappers to pick up */ + if (!background) + fprintf(stdout, "%s\n", tty); + for (done = 0; !done; ) { FD_ZERO(&rfd); FD_SET(amaster, &rfd); @@ -359,70 +364,20 @@ main(int argc, char *argv[]) /* Open TTYs */ static int -sppd_ttys_open(char const *tty, int *amaster, int *aslave) +sppd_ttys_open(char **tty, int *amaster, int *aslave) { - char pty[PATH_MAX], *slash; - struct group *gr = NULL; - gid_t ttygid; + char pty[PATH_MAX]; struct termios tio; - /* - * Construct master PTY name. The slave tty name must be less then - * PATH_MAX characters in length, must contain '/' character and - * must not end with '/'. - */ - - if (strlen(tty) >= sizeof(pty)) { - syslog(LOG_ERR, "Slave tty name is too long"); - return (-1); - } - - strlcpy(pty, tty, sizeof(pty)); - slash = strrchr(pty, '/'); - if (slash == NULL || slash[1] == '\0') { - syslog(LOG_ERR, "Invalid slave tty name (%s)", tty); - return (-1); - } - - slash[1] = 'p'; - - if (strcmp(pty, tty) == 0) { - syslog(LOG_ERR, "Master and slave tty are the same (%s)", tty); - return (-1); - } - - if ((*amaster = open(pty, O_RDWR, 0)) < 0) { - syslog(LOG_ERR, "Could not open(%s). %s", pty, strerror(errno)); - return (-1); - } - - /* - * Slave TTY - */ - - if ((gr = getgrnam("tty")) != NULL) - ttygid = gr->gr_gid; - else - ttygid = -1; - - (void) chown(tty, getuid(), ttygid); - (void) chmod(tty, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); - (void) revoke(tty); + cfmakeraw(&tio); - if ((*aslave = open(tty, O_RDWR, 0)) < 0) { - syslog(LOG_ERR, "Could not open(%s). %s", tty, strerror(errno)); - close(*amaster); + if (openpty(amaster, aslave, pty, &tio, NULL) == -1) { + syslog(LOG_ERR, "Could not openpty(). %s", strerror(errno)); return (-1); } - /* - * Make slave TTY raw - */ - - cfmakeraw(&tio); - - if (tcsetattr(*aslave, TCSANOW, &tio) < 0) { - syslog(LOG_ERR, "Could not tcsetattr(). %s", strerror(errno)); + if ((*tty = strdup(pty)) == NULL) { + syslog(LOG_ERR, "Could not strdup(). %s", strerror(errno)); close(*aslave); close(*amaster); return (-1); @@ -496,7 +451,7 @@ usage(void) "\t-a address Peer address (required in client mode)\n" \ "\t-b Run in background\n" \ "\t-c channel RFCOMM channel to connect to or listen on\n" \ -"\t-t tty TTY name (required in background mode)\n" \ +"\t-t use slave pseudo tty (required in background mode)\n" \ "\t-S Server mode\n" \ "\t-h Display this message\n", SPPD_IDENT); exit(255); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:48:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64470D1D; Thu, 6 Nov 2014 16:48:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50CEE91F; Thu, 6 Nov 2014 16:48:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Gmawu047776; Thu, 6 Nov 2014 16:48:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Gma3S047775; Thu, 6 Nov 2014 16:48:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411061648.sA6Gma3S047775@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Nov 2014 16:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274183 - head/sys/modules/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:48:36 -0000 Author: imp Date: Thu Nov 6 16:48:35 2014 New Revision: 274183 URL: https://svnweb.freebsd.org/changeset/base/274183 Log: clean removes @ and machine now, so no need to do it again. Modified: head/sys/modules/mrsas/Makefile Modified: head/sys/modules/mrsas/Makefile ============================================================================== --- head/sys/modules/mrsas/Makefile Thu Nov 6 16:32:00 2014 (r274182) +++ head/sys/modules/mrsas/Makefile Thu Nov 6 16:48:35 2014 (r274183) @@ -27,4 +27,3 @@ cscope: clean_cscope /usr/local/bin/cscope -b *.[ch] cleanall: clean clean_cscope - rm -f '@' machine From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:48:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 761B7E37; Thu, 6 Nov 2014 16:48:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58CDA920; Thu, 6 Nov 2014 16:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6GmdDT047829; Thu, 6 Nov 2014 16:48:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Gmces047822; Thu, 6 Nov 2014 16:48:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411061648.sA6Gmces047822@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Nov 2014 16:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274184 - in head/sys: conf modules/linux modules/sound/sound modules/svr4 modules/vmm 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:48:39 -0000 Author: imp Date: Thu Nov 6 16:48:37 2014 New Revision: 274184 URL: https://svnweb.freebsd.org/changeset/base/274184 Log: Retire the '@' symlink. It isn't really needed and causes more problems than it solves. SYSDIR is already defined almost always and can be used instead. Working around the one case where it isn't is much easier than working around the fact that @ may not exist in 18 other places. Differential Revision: https://reviews.freebsd.org/D1100 Modified: head/sys/conf/kmod.mk head/sys/modules/linux/Makefile head/sys/modules/sound/sound/Makefile head/sys/modules/svr4/Makefile head/sys/modules/vmm/Makefile Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Nov 6 16:48:35 2014 (r274183) +++ head/sys/conf/kmod.mk Thu Nov 6 16:48:37 2014 (r274184) @@ -99,11 +99,11 @@ CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -i # Add -I paths for system headers. Individual module makefiles don't # need any -I paths for this. Similar defaults for .PATH can't be # set because there are no standard paths for non-headers. -CFLAGS+= -I. -I@ +CFLAGS+= -I. -I${SYSDIR} # Add -I path for altq headers as they are included via net/if_var.h # for example. -CFLAGS+= -I@/contrib/altq +CFLAGS+= -I${SYSDIR}/contrib/altq CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=100 @@ -132,12 +132,8 @@ CTFFLAGS+= -g .endif .if defined(FIRMWS) -.if !exists(@) -${KMOD:S/$/.c/}: @ -.else -${KMOD:S/$/.c/}: @/tools/fw_stub.awk -.endif - ${AWK} -f @/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \ +${KMOD:S/$/.c/}: ${SYSDIR}/tools/fw_stub.awk + ${AWK} -f ${SYSDIR}/tools/fw_stub.awk ${FIRMWS} -m${KMOD} -c${KMOD:S/$/.c/g} \ ${FIRMWARE_LICENSE:C/.+/-l/}${FIRMWARE_LICENSE} SRCS+= ${KMOD:S/$/.c/} @@ -216,7 +212,7 @@ ${FULLPROG}: ${OBJS} ${OBJCOPY} --strip-debug ${.TARGET} .endif -_ILINKS=@ machine +_ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} _ILINKS+=${MACHINE_CPUARCH} .endif @@ -255,8 +251,6 @@ ${.OBJDIR}/${_link}: @case ${.TARGET:T} in \ machine) \ path=${SYSDIR}/${MACHINE}/include ;; \ - @) \ - path=${SYSDIR} ;; \ *) \ path=${SYSDIR}/${.TARGET:T}/include ;; \ esac ; \ @@ -390,12 +384,8 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s .for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}} CLEANFILES+= ${_src} .if !target(${_src}) -.if !exists(@) -${_src}: @ -.else -${_src}: @/tools/makeobjops.awk @/${_srcsrc} -.endif - ${AWK} -f @/tools/makeobjops.awk @/${_srcsrc} -${_ext} +${_src}: ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} + ${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} -${_ext} .endif .endfor # _src .endfor # _ext @@ -403,70 +393,46 @@ ${_src}: @/tools/makeobjops.awk @/${_src .if !empty(SRCS:Mvnode_if.c) CLEANFILES+= vnode_if.c -.if !exists(@) -vnode_if.c: @ -.else -vnode_if.c: @/tools/vnode_if.awk @/kern/vnode_if.src -.endif - ${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -c +vnode_if.c: ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src + ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -c .endif .if !empty(SRCS:Mvnode_if.h) CLEANFILES+= vnode_if.h vnode_if_newproto.h vnode_if_typedef.h -.if !exists(@) -vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: @ -.else -vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: @/tools/vnode_if.awk \ - @/kern/vnode_if.src -.endif +vnode_if.h vnode_if_newproto.h vnode_if_typedef.h: ${SYSDIR}/tools/vnode_if.awk \ + ${SYSDIR}/kern/vnode_if.src vnode_if.h: vnode_if_newproto.h vnode_if_typedef.h - ${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -h + ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -h vnode_if_newproto.h: - ${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -p + ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -p vnode_if_typedef.h: - ${AWK} -f @/tools/vnode_if.awk @/kern/vnode_if.src -q + ${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q .endif .for _i in mii pccard .if !empty(SRCS:M${_i}devs.h) CLEANFILES+= ${_i}devs.h -.if !exists(@) -${_i}devs.h: @ -.else -${_i}devs.h: @/tools/${_i}devs2h.awk @/dev/${_i}/${_i}devs -.endif - ${AWK} -f @/tools/${_i}devs2h.awk @/dev/${_i}/${_i}devs +${_i}devs.h: ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs + ${AWK} -f ${SYSDIR}/tools/${_i}devs2h.awk ${SYSDIR}/dev/${_i}/${_i}devs .endif .endfor # _i .if !empty(SRCS:Musbdevs.h) CLEANFILES+= usbdevs.h -.if !exists(@) -usbdevs.h: @ -.else -usbdevs.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs -.endif - ${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -h +usbdevs.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs + ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -h .endif .if !empty(SRCS:Musbdevs_data.h) CLEANFILES+= usbdevs_data.h -.if !exists(@) -usbdevs_data.h: @ -.else -usbdevs_data.h: @/tools/usbdevs2h.awk @/dev/usb/usbdevs -.endif - ${AWK} -f @/tools/usbdevs2h.awk @/dev/usb/usbdevs -d +usbdevs_data.h: ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs + ${AWK} -f ${SYSDIR}/tools/usbdevs2h.awk ${SYSDIR}/dev/usb/usbdevs -d .endif .if !empty(SRCS:Macpi_quirks.h) CLEANFILES+= acpi_quirks.h -.if !exists(@) -acpi_quirks.h: @ -.else -acpi_quirks.h: @/tools/acpi_quirks2h.awk @/dev/acpica/acpi_quirks -.endif - ${AWK} -f @/tools/acpi_quirks2h.awk @/dev/acpica/acpi_quirks +acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks + ${AWK} -f ${SYSDIR}/tools/acpi_quirks2h.awk ${SYSDIR}/dev/acpica/acpi_quirks .endif .if !empty(SRCS:Massym.s) @@ -475,18 +441,12 @@ assym.s: genassym.o .if defined(KERNBUILDDIR) genassym.o: opt_global.h .endif -.if !exists(@) -assym.s: -.else -assym.s: @/kern/genassym.sh -.endif - sh @/kern/genassym.sh genassym.o > ${.TARGET} -.if exists(@) -genassym.o: @/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c -.endif +assym.s: ${SYSDIR}/kern/genassym.sh + sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} +genassym.o: ${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c genassym.o: ${SRCS:Mopt_*.h} ${CC} -c ${CFLAGS:N-fno-common} \ - @/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c + ${SYSDIR}/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c .endif lint: ${SRCS} Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Thu Nov 6 16:48:35 2014 (r274183) +++ head/sys/modules/linux/Makefile Thu Nov 6 16:48:37 2014 (r274184) @@ -40,10 +40,7 @@ EXPORT_SYMS+= linux_ioctl_unregister_han CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_assym.h: linux${SFX}_genassym.o -.if exists(@) -linux${SFX}_assym.h: @/kern/genassym.sh -.endif - sh @/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} + sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET} linux${SFX}_locore.o: linux${SFX}_assym.h assym.s ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ Modified: head/sys/modules/sound/sound/Makefile ============================================================================== --- head/sys/modules/sound/sound/Makefile Thu Nov 6 16:48:35 2014 (r274183) +++ head/sys/modules/sound/sound/Makefile Thu Nov 6 16:48:37 2014 (r274184) @@ -1,9 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../dev/sound -.PATH: ${.CURDIR}/../../../dev/sound/pcm -.PATH: ${.CURDIR}/../../../dev/sound/midi -.PATH: ${.CURDIR}/../../../dev/sound/isa +SYSDIR?=${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/dev/sound +.PATH: ${SYSDIR}/dev/sound/pcm +.PATH: ${SYSDIR}/dev/sound/midi +.PATH: ${SYSDIR}/dev/sound/isa KMOD= sound SRCS= device_if.h bus_if.h isa_if.h pci_if.h opt_isa.h @@ -19,26 +21,14 @@ SRCS+= ac97.c ac97_patch.c buffer.c chan SRCS+= mixer.c sndstat.c sound.c unit.c vchan.c SRCS+= midi.c mpu401.c sequencer.c -.if !exists(@) -feeder_eq_gen.h: @ -.else -feeder_eq_gen.h: @/tools/sound/feeder_eq_mkfilter.awk -.endif - ${AWK} -f @/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET} +feeder_eq_gen.h: ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk + ${AWK} -f ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET} -.if !exists(@) -feeder_rate_gen.h: @ -.else -feeder_rate_gen.h: @/tools/sound/feeder_rate_mkfilter.awk -.endif - ${AWK} -f @/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET} +feeder_rate_gen.h: ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk + ${AWK} -f ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET} -.if !exists(@) -snd_fxdiv_gen.h: @ -.else -snd_fxdiv_gen.h: @/tools/sound/snd_fxdiv_gen.awk -.endif - ${AWK} -f @/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET} +snd_fxdiv_gen.h: ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk + ${AWK} -f ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET} CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h Modified: head/sys/modules/svr4/Makefile ============================================================================== --- head/sys/modules/svr4/Makefile Thu Nov 6 16:48:35 2014 (r274183) +++ head/sys/modules/svr4/Makefile Thu Nov 6 16:48:37 2014 (r274184) @@ -14,16 +14,13 @@ SRCS+= opt_ktrace.h opt_sysvipc.h CLEANFILES= svr4_assym.h svr4_genassym.o svr4_assym.h: svr4_genassym.o -.if exists(@) -svr4_assym.h: @/kern/genassym.sh -.endif - sh @/kern/genassym.sh svr4_genassym.o > ${.TARGET} + sh ${SYSDIR}/kern/genassym.sh svr4_genassym.o > ${.TARGET} svr4_locore.o: svr4_locore.s svr4_assym.h ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -svr4_genassym.o: svr4_genassym.c svr4.h @ machine +svr4_genassym.o: svr4_genassym.c svr4.h ${CC} -c ${CFLAGS:N-fno-common} ${.IMPSRC} .if !defined(KERNBUILDDIR) && defined(DEBUG) Modified: head/sys/modules/vmm/Makefile ============================================================================== --- head/sys/modules/vmm/Makefile Thu Nov 6 16:48:35 2014 (r274183) +++ head/sys/modules/vmm/Makefile Thu Nov 6 16:48:37 2014 (r274184) @@ -58,16 +58,10 @@ SRCS+= vmcb.c \ CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o vmx_assym.h: vmx_genassym.o -.if exists(@) -vmx_assym.h: @/kern/genassym.sh -.endif - sh @/kern/genassym.sh vmx_genassym.o > ${.TARGET} + sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET} svm_assym.h: svm_genassym.o -.if exists(@) -svm_assym.h: @/kern/genassym.sh -.endif - sh @/kern/genassym.sh svm_genassym.o > ${.TARGET} + sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET} vmx_support.o: ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 16:52:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6A60DF; Thu, 6 Nov 2014 16:52:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 931E69F2; Thu, 6 Nov 2014 16:52:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Gqqdw051790; Thu, 6 Nov 2014 16:52:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6GqqNn051788; Thu, 6 Nov 2014 16:52:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411061652.sA6GqqNn051788@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Nov 2014 16:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274185 - in head/sys: compat/svr4 modules/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:52:52 -0000 Author: imp Date: Thu Nov 6 16:52:51 2014 New Revision: 274185 URL: https://svnweb.freebsd.org/changeset/base/274185 Log: These don't belong in the modules directory. Added: head/sys/compat/svr4/README - copied, changed from r274184, head/sys/modules/svr4/README head/sys/compat/svr4/TO-DO - copied, changed from r274184, head/sys/modules/svr4/TO-DO Deleted: head/sys/modules/svr4/README head/sys/modules/svr4/TO-DO Copied and modified: head/sys/compat/svr4/README (from r274184, head/sys/modules/svr4/README) ============================================================================== Copied and modified: head/sys/compat/svr4/TO-DO (from r274184, head/sys/modules/svr4/TO-DO) ============================================================================== From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:19:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 853667C1; Thu, 6 Nov 2014 17:19:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718F3C78; Thu, 6 Nov 2014 17:19:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6HJg4t062139; Thu, 6 Nov 2014 17:19:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6HJgFu062138; Thu, 6 Nov 2014 17:19:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411061719.sA6HJgFu062138@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 6 Nov 2014 17:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274186 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:19:42 -0000 Author: imp Date: Thu Nov 6 17:19:41 2014 New Revision: 274186 URL: https://svnweb.freebsd.org/changeset/base/274186 Log: Ignore errors from rm -rf to support high -j builds. This is, at best, a kludge. However, it also effectively works around the issues for high -j builds on systems that do not have the rm fixes. A better fix would be to rmdir here, and fix the places where we're sloppy and not list all the files we create in CLEANFILES, should anybody have the time to chase them all to ground. Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Thu Nov 6 16:52:51 2014 (r274185) +++ head/share/mk/bsd.obj.mk Thu Nov 6 17:19:41 2014 (r274186) @@ -112,7 +112,7 @@ whereobj: .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) cleanobj: - @rm -rf ${CANONICALOBJDIR} + @-rm -rf ${CANONICALOBJDIR} .else cleanobj: clean cleandepend .endif @@ -130,7 +130,7 @@ clean: rm -f ${CLEANFILES} .endif .if defined(CLEANDIRS) && !empty(CLEANDIRS) - rm -rf ${CLEANDIRS} + -rm -rf ${CLEANDIRS} .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:21:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AC83A38; Thu, 6 Nov 2014 17:21:14 +0000 (UTC) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEEE7CA3; Thu, 6 Nov 2014 17:21:13 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id a1so1746951wgh.6 for ; Thu, 06 Nov 2014 09:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Kj3IqJqICx1qVhI2ZCd8OGbX0fmuKixCG2w4bS2ZVG4=; b=UZ4MC77VWTv0N4pFt8iXaha2gwaRwIifkWWqPPFz7qy3dhYtcSlWhwt9ApBE7+nkLj ADuHbwQX6QKkZz5MAsIVAUTLPRR61i/c8ALFLS6LS72oYNDZLvVkQYOSsNLc217Ti4Pl EEqOw7VOrAjODk1uHZWx4ebe3CCYfim+LKuRbr7C4KNqod/0GZIl+X2U5QIA+6JAWWCW zSrPhFq3JlNyNWPSnV6AQnSttD3xnzxA443HnqGhuPVBgerW4bYXEEM2+sp9tvhJ8M4r 4OkFpztM1Ljcg9F9HNesgZWqyKxjEiNag8/XUNqlJ0Ko5Msh6WL/sAwWB9sm67glMruN 0Mvw== MIME-Version: 1.0 X-Received: by 10.194.47.226 with SMTP id g2mr7680386wjn.68.1415294471527; Thu, 06 Nov 2014 09:21:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Thu, 6 Nov 2014 09:21:11 -0800 (PST) In-Reply-To: <545B55FA.6070408@FreeBSD.org> References: <201410150122.s9F1Mudu083306@svn.freebsd.org> <545B55FA.6070408@FreeBSD.org> Date: Thu, 6 Nov 2014 09:21:11 -0800 X-Google-Sender-Auth: 4OHi_iflqgKlv_KTEiG2Mk_BfdI Message-ID: Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe From: Adrian Chadd To: "Alexander V. Chernikov" Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:21:14 -0000 Hm, are there any other hardware counters that we can use to see what was dropped? I didn't see performance drops doing this; in fact I saw performance increases with FC disabled and DROP_EN set. Thanks, -adrian On 6 November 2014 03:05, Alexander V. Chernikov wrote: > On 15.10.2014 05:22, Adrian Chadd wrote: >> >> Author: adrian >> Date: Wed Oct 15 01:22:56 2014 >> New Revision: 273112 >> URL: https://svnweb.freebsd.org/changeset/base/273112 >> >> Log: >> Set the DROP_EN bit before the RX queue is brought up and active. >> He noticed issues setting this bit in SRRCTL after the queue was up, >> so doing it from the sysctl handler isn't enough and may not actually >> work correctly. > > While investigating/measuring ixgbe performance w/ and without flow control > I noticed that disabling fc entirely (e.g. disabling 512K skid buffer and > turning drop_en on) > not only makes things a bit worse, but also makes NIC stop accounting > tail-drops as errors > at all. > It is a bit unhandy with HW counters, since you, for example, see 2M packets > being received > in netstat, but in reality system receives only 1M (And there is no easy way > to determine exact > count). > >> This commit doesn't remove the sysctl path or try to change its >> behaviour. I'll talk with others about how to finish fixing that >> before I tackle that. >> PR: kern/194311 >> Submitted by: luigi >> MFC after: 3 days >> Sponsored by: Norse Corp, Inc >> >> Modified: >> head/sys/dev/ixgbe/ixgbe.c >> >> Modified: head/sys/dev/ixgbe/ixgbe.c >> >> ============================================================================== >> --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 15 01:16:11 2014 (r273111) >> +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 15 01:22:56 2014 (r273112) >> @@ -4377,6 +4377,20 @@ ixgbe_initialize_receive_units(struct ad >> srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; >> srrctl |= bufsz; >> srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; >> + >> + /* >> + * Set DROP_EN iff we have no flow control and >1 queue. >> + * Note that srrctl was cleared shortly before during >> reset, >> + * so we do not need to clear the bit, but do it just in >> case >> + * this code is moved elsewhere. >> + */ >> + if (adapter->num_queues > 1 && >> + adapter->hw.fc.requested_mode == ixgbe_fc_none) { > > This code seems to turn drop_en always on HEAD due to > hw->fc.requested_mode is inherited from adapter->fc at the end of > ixgbe_init_locked(), _after_ calling ixgbe_initialize_receive_units() > >> + srrctl |= IXGBE_SRRCTL_DROP_EN; >> + } else { >> + srrctl &= ~IXGBE_SRRCTL_DROP_EN; >> + } >> + >> IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); >> /* Setup the HW Rx Head and Tail Descriptor Pointers */ >> >> > From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:21:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0DEFB7F; Thu, 6 Nov 2014 17:21:36 +0000 (UTC) Received: from mail-pd0-x229.google.com (mail-pd0-x229.google.com [IPv6:2607:f8b0:400e:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8487D34; Thu, 6 Nov 2014 17:21:36 +0000 (UTC) Received: by mail-pd0-f169.google.com with SMTP id y10so1513039pdj.28 for ; Thu, 06 Nov 2014 09:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=emTuFFkCKEnVWvO540satq6vHAiUs+/jvQWoFgJ4LEs=; b=OkNE6ZQB6OiSSesBm0D3uGe4N05EQZQx7Kwohvu5JFELGapWAa+keEs+fc/0mBNxF9 m673C4dpUE75gNt+hefKQxg3t7mQI5Vsu4FC+X5QidbfMMCdcpbgFhKOox/IHkm8C2NE qu56TVrhISpsBFLaks/zsPhodAY8jM4arVo4Jq01XbGe2h6XK1FHxWyPRmApakl+jW0N QsSi533s9fvPmvYYsBwXnqaq/F9pj2v3DvPEFPs/knizcll42Y1ck6dRb5jZViesLwg6 p8BMc+6/Bi55uOCzz2Xhv8JONyn73s+XtfjqF/Yi9q2doUZu/Vn+hl28a4e1YQr2VetQ ackQ== X-Received: by 10.70.100.170 with SMTP id ez10mr2399429pdb.73.1415294496242; Thu, 06 Nov 2014 09:21:36 -0800 (PST) Received: from ?IPv6:2601:8:ab80:7d6:65f6:fe4f:cdda:fc9e? ([2601:8:ab80:7d6:65f6:fe4f:cdda:fc9e]) by mx.google.com with ESMTPSA id fv4sm6434141pbd.47.2014.11.06.09.21.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 09:21:35 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_260B7024-AFFF-4E4F-88E1-CF5C5192E3E8"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274186 - head/share/mk From: Garrett Cooper In-Reply-To: <201411061719.sA6HJgFu062138@svn.freebsd.org> Date: Thu, 6 Nov 2014 09:21:33 -0800 Message-Id: References: <201411061719.sA6HJgFu062138@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:21:37 -0000 --Apple-Mail=_260B7024-AFFF-4E4F-88E1-CF5C5192E3E8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 6, 2014, at 9:19, Warner Losh wrote: > Author: imp > Date: Thu Nov 6 17:19:41 2014 > New Revision: 274186 > URL: https://svnweb.freebsd.org/changeset/base/274186 >=20 > Log: > Ignore errors from rm -rf to support high -j builds. This is, at = best, > a kludge. However, it also effectively works around the issues for > high -j builds on systems that do not have the rm fixes. >=20 > A better fix would be to rmdir here, and fix the places where we're > sloppy and not list all the files we create in CLEANFILES, should > anybody have the time to chase them all to ground. I=92ll say that bsd.progs.mk is a huge problem here because CLEANFILES = is handled times. Dealing with bsd.progs.mk and its recursive nature is quite = entertaining... --Apple-Mail=_260B7024-AFFF-4E4F-88E1-CF5C5192E3E8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUW64dAAoJEMZr5QU6S73eANYH/14X+JFZU9dtSbtRUK3k3r08 yd/Zxle6WNXTakFIyMfJJUXrXnJxdDV3X+wkFxV6vo9uogmVtfwEi2+FGZwWB+h9 590It8Nbp25cj+Lo2u8nwy1LOErpL5NufQ1F7Zl9rLtgVczPKvHpdkpuK2bQ/zcI TQ3TK7RBrZElw7J4rb7aMZLANd4vrbRfjnUtIbEIo1TSspu6vZxXc22F1mV6m/oE OHVyGR2q5JuWeVjhpX+FY2cQBqa9dqf8GFGbUta7X2kxAdyaS+e1/dWsZl1L3AJK ENPNYlvh38D0PaFAaPvhRboOcA27qgfrizs3C9AwRerb0rQg0kW6O1P5EWdOG4A= =9GtK -----END PGP SIGNATURE----- --Apple-Mail=_260B7024-AFFF-4E4F-88E1-CF5C5192E3E8-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:47:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23D25266; Thu, 6 Nov 2014 17:47:00 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA44CF61; Thu, 6 Nov 2014 17:46:59 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XmR97-000CPa-KU; Thu, 06 Nov 2014 17:46:57 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sA6HkuGm001412; Thu, 6 Nov 2014 10:46:56 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18lmq6iOv5OWLskK2VeToqc X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r274177 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys From: Ian Lepore To: "Alexander V. Chernikov" In-Reply-To: <201411061439.sA6Ed4f4086315@svn.freebsd.org> References: <201411061439.sA6Ed4f4086315@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Thu, 06 Nov 2014 10:46:56 -0700 Message-ID: <1415296016.1200.175.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:47:00 -0000 On Thu, 2014-11-06 at 14:39 +0000, Alexander V. Chernikov wrote: > Author: melifaro > Date: Thu Nov 6 14:39:04 2014 > New Revision: 274177 > URL: https://svnweb.freebsd.org/changeset/base/274177 > > Log: > Finish r274118: remove useless fields from struct domain. > > Sponsored by: Yandex LLC > > Modified: > head/share/man/man9/domain.9 > head/sys/net/route.c > head/sys/netinet/in_proto.c > head/sys/netinet6/in6_proto.c > head/sys/sys/domain.h > > Modified: head/share/man/man9/domain.9 > ============================================================================== > --- head/share/man/man9/domain.9 Thu Nov 6 13:13:47 2014 (r274176) > +++ head/share/man/man9/domain.9 Thu Nov 6 14:39:04 2014 (r274177) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 7, 2012 > +.Dd November 6, 2014 > .Dt DOMAIN 9 > .Os > .Sh NAME > @@ -82,10 +82,9 @@ struct domain { > (void **, int); > int (*dom_rtdetach) /* clean up routing table */ > (void **, int); > - int dom_rtoffset; /* an arg to rtattach, in bits */ > - int dom_maxrtkey; /* for routing layer */ > void *(*dom_ifattach)(struct ifnet *); > void (*dom_ifdetach)(struct ifnet *, void *); > + int (*dom_ifmtu)(struct ifnet *); > /* af-dependent data on ifnet */ > }; > .Ed > It looks like this breaks VIMAGE builds: /local/build/staging/freebsd/head/src/sys/net/route.c:299:41: error: no member named 'dom_rtoffset' in 'struct domain' dom->dom_rtdetach((void **)rnh, dom->dom_rtoffset); ~~~ ^ -- Ian From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:50:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF73C3D9; Thu, 6 Nov 2014 17:50:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B87F61; Thu, 6 Nov 2014 17:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6HoaFa076132; Thu, 6 Nov 2014 17:50:36 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6HoaQg076131; Thu, 6 Nov 2014 17:50:36 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201411061750.sA6HoaQg076131@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 6 Nov 2014 17:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274187 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:50:36 -0000 Author: melifaro Date: Thu Nov 6 17:50:35 2014 New Revision: 274187 URL: https://svnweb.freebsd.org/changeset/base/274187 Log: Fix build. Pointy hat to: melifaro Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Nov 6 17:19:41 2014 (r274186) +++ head/sys/net/route.c Thu Nov 6 17:50:35 2014 (r274187) @@ -296,7 +296,7 @@ vnet_route_uninit(const void *unused __u rnh = rt_tables_get_rnh_ptr(table, fam); if (rnh == NULL) panic("%s: rnh NULL", __func__); - dom->dom_rtdetach((void **)rnh, dom->dom_rtoffset); + dom->dom_rtdetach((void **)rnh, 0); } } From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:51:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AFF5520; Thu, 6 Nov 2014 17:51:24 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2C56E; Thu, 6 Nov 2014 17:51:24 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XmNCp-000BvV-JB; Thu, 06 Nov 2014 17:34:31 +0400 Message-ID: <545BB48C.5060709@FreeBSD.org> Date: Thu, 06 Nov 2014 21:49:00 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r274177 - in head: share/man/man9 sys/net sys/netinet sys/netinet6 sys/sys References: <201411061439.sA6Ed4f4086315@svn.freebsd.org> <1415296016.1200.175.camel@revolution.hippie.lan> In-Reply-To: <1415296016.1200.175.camel@revolution.hippie.lan> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:51:24 -0000 On 06.11.2014 21:46, Ian Lepore wrote: > On Thu, 2014-11-06 at 14:39 +0000, Alexander V. Chernikov wrote: >> Author: melifaro >> Date: Thu Nov 6 14:39:04 2014 >> New Revision: 274177 >> URL: https://svnweb.freebsd.org/changeset/base/274177 >> >> Log: >> Finish r274118: remove useless fields from struct domain. >> >> Sponsored by: Yandex LLC >> >> Modified: >> head/share/man/man9/domain.9 >> head/sys/net/route.c >> head/sys/netinet/in_proto.c >> head/sys/netinet6/in6_proto.c >> head/sys/sys/domain.h >> >> Modified: head/share/man/man9/domain.9 >> ============================================================================== >> --- head/share/man/man9/domain.9 Thu Nov 6 13:13:47 2014 (r274176) >> +++ head/share/man/man9/domain.9 Thu Nov 6 14:39:04 2014 (r274177) >> @@ -26,7 +26,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd December 7, 2012 >> +.Dd November 6, 2014 >> .Dt DOMAIN 9 >> .Os >> .Sh NAME >> @@ -82,10 +82,9 @@ struct domain { >> (void **, int); >> int (*dom_rtdetach) /* clean up routing table */ >> (void **, int); >> - int dom_rtoffset; /* an arg to rtattach, in bits */ >> - int dom_maxrtkey; /* for routing layer */ >> void *(*dom_ifattach)(struct ifnet *); >> void (*dom_ifdetach)(struct ifnet *, void *); >> + int (*dom_ifmtu)(struct ifnet *); >> /* af-dependent data on ifnet */ >> }; >> .Ed >> > It looks like this breaks VIMAGE builds: Fixed in r274187. Thanks. > > /local/build/staging/freebsd/head/src/sys/net/route.c:299:41: error: no member named 'dom_rtoffset' in 'struct domain' > dom->dom_rtdetach((void **)rnh, dom->dom_rtoffset); > ~~~ ^ > > -- Ian > > > > From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 17:58:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91BD07E9; Thu, 6 Nov 2014 17:58:32 +0000 (UTC) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C7B2EC; Thu, 6 Nov 2014 17:58:32 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id q1so3109841lam.10 for ; Thu, 06 Nov 2014 09:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sPT7XbyUqPx6IvGyt+0z9n1HgVGuadsaD7iD+sdSSNo=; b=iSRCZOTlvhO/VF2oxG8LLLen0Ok3a9Cmcc/LI8VSEMsnSCmMUJUGQBS3ib4s2KHFze quV8ILYy6yjWWa/gvru2P1m9n2a8exXje5jBy5DqtydDGTgzAxAyBbMp+Z/3Bk5aLqDZ NZ9NH6XiYZTePOVONID4AcTCFz4slEKWsdhjgXGkoA0McSFyO0N632TY5Gm/EYV9R3VJ ROU89PK+a7/X5V6xCxcbxCPWvmYQ5O/xCKURo+5DFtR/Eq265HPXI3LpOkhdN9t3dcgq bnUNCU6UNl+Gc+53B9B1xyQaEsycbB/1aEdW4xQzn4pRJIRwK0yeSzqnej3YDB9MvOQR Jg4g== MIME-Version: 1.0 X-Received: by 10.152.36.33 with SMTP id n1mr6601845laj.6.1415296710072; Thu, 06 Nov 2014 09:58:30 -0800 (PST) Received: by 10.25.0.211 with HTTP; Thu, 6 Nov 2014 09:58:30 -0800 (PST) In-Reply-To: References: <201410150122.s9F1Mudu083306@svn.freebsd.org> <545B55FA.6070408@FreeBSD.org> Date: Thu, 6 Nov 2014 12:58:30 -0500 Message-ID: Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe From: Ryan Stone To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Alexander V. Chernikov" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 17:58:32 -0000 On Thu, Nov 6, 2014 at 12:21 PM, Adrian Chadd wrote: > Hm, are there any other hardware counters that we can use to see what > was dropped? On the 82599 and later you need to configure the RQSMR register to map queue pools to indices and then the QPRDC[i] register will contain the number of drops. Note that the 82598 doesn't support the DROPEN bit in the SRRCTL register. There is a separate DROPEN register on the 82598, but I have the following worrisome comment in my version of ixgbe: if (hw->mac.type == ixgbe_mac_82598EB) { /* * The DROPEN register is intended to allow us to immediately * drop packets that cannot be DMA'ed to memory right away to * avoid head-of-line blocking. However we have observed that * enabling this functionality can lead to situations where a * queue will drop every packet destined for it silently, so * we instead accept the HOL blocking and disable the immediate * dropping */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_DROPEN, 0); From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 18:14:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F6FB7D; Thu, 6 Nov 2014 18:14:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1F1E2E7; Thu, 6 Nov 2014 18:14:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6IECxl089355; Thu, 6 Nov 2014 18:14:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6IECfj089354; Thu, 6 Nov 2014 18:14:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411061814.sA6IECfj089354@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Nov 2014 18:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274188 - head/sys/dev/ida 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 18:14:12 -0000 Author: ian Date: Thu Nov 6 18:14:12 2014 New Revision: 274188 URL: https://svnweb.freebsd.org/changeset/base/274188 Log: A dma tag alignment should be 1 (not 0) when a device can dma at any address. Modified: head/sys/dev/ida/ida_eisa.c Modified: head/sys/dev/ida/ida_eisa.c ============================================================================== --- head/sys/dev/ida/ida_eisa.c Thu Nov 6 17:50:35 2014 (r274187) +++ head/sys/dev/ida/ida_eisa.c Thu Nov 6 18:14:12 2014 (r274188) @@ -296,7 +296,7 @@ ida_eisa_attach(device_t dev) error = bus_dma_tag_create( /* parent */ bus_get_dma_tag(dev), - /* alignment */ 0, + /* alignment */ 1, /* boundary */ 0, /* lowaddr */ BUS_SPACE_MAXADDR_32BIT, /* highaddr */ BUS_SPACE_MAXADDR, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 18:15:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77DB3CC1; Thu, 6 Nov 2014 18:15:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 641652F3; Thu, 6 Nov 2014 18:15:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6IFHI4089566; Thu, 6 Nov 2014 18:15:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6IFHNX089565; Thu, 6 Nov 2014 18:15:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411061815.sA6IFHNX089565@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Nov 2014 18:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274189 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 18:15:17 -0000 Author: ian Date: Thu Nov 6 18:15:16 2014 New Revision: 274189 URL: https://svnweb.freebsd.org/changeset/base/274189 Log: A dma tag alignment should be 1 (not 0) when a device can dma at any address. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Nov 6 18:14:12 2014 (r274188) +++ head/sys/dev/ahci/ahci.c Thu Nov 6 18:15:16 2014 (r274189) @@ -217,7 +217,7 @@ ahci_attach(device_t dev) ctlr->emloc = ATA_INL(ctlr->r_mem, AHCI_EM_LOC); /* Create controller-wide DMA tag. */ - if (bus_dma_tag_create(bus_get_dma_tag(dev), 0, 0, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, (ctlr->caps & AHCI_CAP_64BIT) ? BUS_SPACE_MAXADDR : BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE, From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 18:50:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D19B95C2; Thu, 6 Nov 2014 18:50:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD826870; Thu, 6 Nov 2014 18:50:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6IoxdK005210; Thu, 6 Nov 2014 18:50:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6IoxKu005209; Thu, 6 Nov 2014 18:50:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411061850.sA6IoxKu005209@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 18:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274190 - head/usr.sbin/ntp/sntp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 18:50:59 -0000 Author: bapt Date: Thu Nov 6 18:50:59 2014 New Revision: 274190 URL: https://svnweb.freebsd.org/changeset/base/274190 Log: Backout 274170 it breaks for mips Modified: head/usr.sbin/ntp/sntp/Makefile Modified: head/usr.sbin/ntp/sntp/Makefile ============================================================================== --- head/usr.sbin/ntp/sntp/Makefile Thu Nov 6 18:15:16 2014 (r274189) +++ head/usr.sbin/ntp/sntp/Makefile Thu Nov 6 18:50:59 2014 (r274190) @@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n -DPACKAGE=\"sntp\" -DVERSION=\"1.6\" \ -I${.CURDIR}/../../../contrib/ntp/libopts -DPADD= ${LIBOPTS} -LDADD= ${LIBOPTS} +DPADD= ${LIBM} ${LIBOPTS} +LDADD= -lm ${LIBOPTS} .include From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 18:59:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 876097A8 for ; Thu, 6 Nov 2014 18:59:51 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C6C7954 for ; Thu, 6 Nov 2014 18:59:51 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Ixpfg077089 for ; Thu, 6 Nov 2014 18:59:51 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id sA6IxpYO077085 for svn-src-all@freebsd.org; Thu, 6 Nov 2014 18:59:51 GMT (envelope-from bdrewery) Received: (qmail 39740 invoked from network); 6 Nov 2014 12:59:49 -0600 Received: from unknown (HELO blah) (freebsd@shatow.net@67.182.131.225) by sweb.xzibition.com with ESMTPA; 6 Nov 2014 12:59:49 -0600 Message-ID: <545BC523.4030607@FreeBSD.org> Date: Thu, 06 Nov 2014 10:59:47 -0800 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r274184 - in head/sys: conf modules/linux modules/sound/sound modules/svr4 modules/vmm References: <201411061648.sA6Gmces047822@svn.freebsd.org> In-Reply-To: <201411061648.sA6Gmces047822@svn.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 18:59:51 -0000 On 11/6/14 8:48 AM, Warner Losh wrote: > Author: imp > Date: Thu Nov 6 16:48:37 2014 > New Revision: 274184 > URL: https://svnweb.freebsd.org/changeset/base/274184 > > Log: > Retire the '@' symlink. It isn't really needed and causes more Nice, thanks. -- Regards, Bryan Drewery From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 19:14:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2DDCA16; Thu, 6 Nov 2014 19:14:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4ED3B05; Thu, 6 Nov 2014 19:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6JExP3018007; Thu, 6 Nov 2014 19:14:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6JExbo018006; Thu, 6 Nov 2014 19:14:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411061914.sA6JExbo018006@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 6 Nov 2014 19:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274191 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 19:15:00 -0000 Author: ian Date: Thu Nov 6 19:14:58 2014 New Revision: 274191 URL: https://svnweb.freebsd.org/changeset/base/274191 Log: Strengthen the sanity checking of busdma tag parameters. It turns out an alignment of zero can lead to an endless loop in the vm reservations code, so specifically disallow that. The manpage says hardware which can do dma at any address should use a value of one, which hints at the forbiddeness of zero without exactly saying it. Several other conditions which could lead to insanity in working with the tag are also checked now. Every existing call to bus_dma_tag_create() (about 680 of them) was eyeballed for violations of these things, and two alignment=0 glitches were fixed. It's possible something was missed, but overall this shouldn't lead to any arm users suddenly experiencing failures. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Thu Nov 6 18:50:59 2014 (r274190) +++ head/sys/arm/arm/busdma_machdep-v6.c Thu Nov 6 19:14:58 2014 (r274191) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define IS_POWER_OF_2(val) (((val) & ((val) - 1)) == 0) + #define MAX_BPAGES 64 #define MAX_DMA_SEGMENTS 4096 #define BUS_DMA_EXCL_BOUNCE BUS_DMA_BUS2 @@ -466,17 +468,18 @@ bus_dma_tag_create(bus_dma_tag_t parent, parent = arm_root_dma_tag; #endif - /* Basic sanity checking */ - if (boundary != 0 && boundary < maxsegsz) - maxsegsz = boundary; + /* Basic sanity checking. */ + KASSERT(boundary == 0 || IS_POWER_OF_2(boundary), + ("dma tag boundary %lu, must be a power of 2", boundary)); + KASSERT(boundary == 0 || boundary >= maxsegsz, + ("dma tag boundary %lu is < maxsegsz %lu\n", boundary, maxsegsz)); + KASSERT(alignment != 0 && IS_POWER_OF_2(alignment), + ("dma tag alignment %lu, must be non-zero power of 2", alignment)); + KASSERT(maxsegsz != 0, ("dma tag maxsegsz must not be zero")); /* Return a NULL tag on failure */ *dmat = NULL; - if (maxsegsz == 0) { - return (EINVAL); - } - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_ZERO | M_NOWAIT); if (newtag == NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 19:28:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6169E2E; Thu, 6 Nov 2014 19:28:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21BEC37; Thu, 6 Nov 2014 19:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6JS242023448; Thu, 6 Nov 2014 19:28:02 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6JS2UU023442; Thu, 6 Nov 2014 19:28:02 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411061928.sA6JS2UU023442@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 6 Nov 2014 19:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274192 - in head: lib usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 19:28:02 -0000 Author: dteske Date: Thu Nov 6 19:28:01 2014 New Revision: 274192 URL: https://svnweb.freebsd.org/changeset/base/274192 Log: Re-enable dpv(1,3): Introduced via r274116; temporarily disabled shortly thereafter via r274124 until I could get the right recipe down w/respect to SUBDIR_DEPEND. Thanks to: ngie, ian Reviewed by: ian MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 274121 274123 274144 274146 Modified: head/lib/Makefile head/usr.bin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Nov 6 19:14:58 2014 (r274191) +++ head/lib/Makefile Thu Nov 6 19:28:01 2014 (r274192) @@ -42,6 +42,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libcrypt \ libdevinfo \ libdevstat \ + libdpv \ libdwarf \ libedit \ ${_libevent} \ @@ -130,6 +131,7 @@ SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcapsicum= libnv SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog SUBDIR_DEPEND_libdevstat= libkvm +SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 6 19:14:58 2014 (r274191) +++ head/usr.bin/Makefile Thu Nov 6 19:28:01 2014 (r274192) @@ -36,6 +36,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ + dpv \ du \ ee \ elf2aout \ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 19:35:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F209313E; Thu, 6 Nov 2014 19:35:42 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id B47E7CFD; Thu, 6 Nov 2014 19:35:42 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 753BD104566C; Fri, 7 Nov 2014 06:35:29 +1100 (AEDT) Date: Fri, 7 Nov 2014 06:35:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh Subject: Re: svn commit: r274183 - head/sys/modules/mrsas In-Reply-To: <201411061648.sA6Gma3S047775@svn.freebsd.org> Message-ID: <20141107054107.J1777@besplex.bde.org> References: <201411061648.sA6Gma3S047775@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=BdjhjNd2 c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=pozwR4D8IysTOV0LMs0A:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 19:35:43 -0000 On Thu, 6 Nov 2014, Warner Losh wrote: > Log: > clean removes @ and machine now, so no need to do it again. That is a bug in the clean target. It invalidates the pathnames in the generated .depend file. The cleandepend target still documents the care that it takes with this: cleandepend: cleanilinks # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} but this is defeated by adding ${_ILINKS} to CLEANFILES unconditionally :-(. BTW, include pollution is now so bad that generating dependencies now takes longer than building everything (except dependencies) in some cases. E.g., for GENERIC on nfs over slow networks like the FreeBSD cluster. make -ss -j8 depend takes 113 seconds real (52 user 22 sys) on ref11-i386. CC=gcc42 COPTFLAGS=-O make -ss -j8 takes only 93 seconds (536 real 74 sys). FreeBSD-4 kernels with about 1/10 as many dependencies take about 8 seconds for make -ss -j1 depend and 32 seconds for make -ss j4 on 2-core systems with slightly slower CPUs but better tuned networks. nfs (without mount -nocto) over slow networks handles lots of little include files especially badly because cto defeats caching (data is cached but metadata is re-obtained from the server on every open). One workaround is to build with a large -j count so that progress can be made in threads no waiting for the network. This doesn't help for "make depend" because it is still done serially. So .depend files should usually not be created, but when they are they are more precious than they used to be and it is more important than it used to be to keep cleandepend separate from clean and not break it. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 20:23:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66007DBF; Thu, 6 Nov 2014 20:23:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5250C289; Thu, 6 Nov 2014 20:23:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6KNwTU051992; Thu, 6 Nov 2014 20:23:58 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6KNwAK051991; Thu, 6 Nov 2014 20:23:58 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411062023.sA6KNwAK051991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Nov 2014 20:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274193 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 20:23:58 -0000 Author: ae Date: Thu Nov 6 20:23:57 2014 New Revision: 274193 URL: https://svnweb.freebsd.org/changeset/base/274193 Log: When mode isn't explicitly specified (wildcard) and inner protocol isn't IPv4 or IPv6, assume it is the transport mode. Reported by: jmg MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Thu Nov 6 19:28:01 2014 (r274192) +++ head/sys/netipsec/ipsec_input.c Thu Nov 6 20:23:57 2014 (r274193) @@ -432,7 +432,7 @@ ipsec4_common_input_cb(struct mbuf *m, s } #ifdef INET6 /* IPv6-in-IP encapsulation. */ - if (prot == IPPROTO_IPV6 && + else if (prot == IPPROTO_IPV6 && saidx->mode != IPSEC_MODE_TRANSPORT) { if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { @@ -469,6 +469,15 @@ ipsec4_common_input_cb(struct mbuf *m, s #endif /* notyet */ } #endif /* INET6 */ + else if (prot != IPPROTO_IPV6 && saidx->mode == IPSEC_MODE_ANY) { + /* + * When mode is wildcard, inner protocol is IPv6 and + * we have no INET6 support - drop this packet a bit later. + * In other cases we assume transport mode and outer + * header was already stripped in xform_xxx_cb. + */ + prot = IPPROTO_IPIP; + } /* * Record what we've done to the packet (under what SA it was From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:45:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B827B84F; Thu, 6 Nov 2014 22:45:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4707897; Thu, 6 Nov 2014 22:45:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Mj3WD018465; Thu, 6 Nov 2014 22:45:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Mj3nT018464; Thu, 6 Nov 2014 22:45:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411062245.sA6Mj3nT018464@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 6 Nov 2014 22:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274199 - head/tools/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:45:03 -0000 Author: bapt Date: Thu Nov 6 22:45:03 2014 New Revision: 274199 URL: https://svnweb.freebsd.org/changeset/base/274199 Log: Add a quick and dirty script to check validity of links in elf files Added: head/tools/build/check-links.sh (contents, props changed) Added: head/tools/build/check-links.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/check-links.sh Thu Nov 6 22:45:03 2014 (r274199) @@ -0,0 +1,37 @@ +#!/bin/sh +# $FreeBSD$ + +mime=$(file --mime-type $1) +case $mime in +*application/x-executable);; +*application/x-sharedlib);; +*) echo "Not an elf file" >&2 ; exit 1;; +esac + +# Check for useful libs +list_libs="" +for lib in $(readelf -d $1 | awk '$2 == "(NEEDED)" { sub(/\[/,"",$NF); sub(/\]/,"",$NF); print $NF }'); do + echo -n "checking if $lib is needed: " + libpath=$(ldd $1 | awk -v lib=$lib '$1 == lib { print $3 }') + list_libs="$list_libs $libpath" + foundone=0 + for fct in $(nm -D $libpath | awk '$2 == "T" || $2 == "W" || $2 == "B" { print $3 }'); do + nm -D $1 | awk -v s=$fct '$1 == "U" && $2 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' && foundone=1 && break + done + if [ $foundone -eq 1 ]; then + echo "yes" + else + echo "no" + fi +done + +for sym in $(nm -D $1 | awk '$1 == "U" { print $2 }'); do + found=0 + for l in ${list_libs} ; do + nm -D $l | awk -v s=$sym '($2 == "T" || $2 == "W" || $2 == "B") && $3 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' && found=1 && break + done + if [ $found -eq 0 ]; then + echo "Unresolved symbol $sym" + fi +done + From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:46:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D7739C2; Thu, 6 Nov 2014 22:46:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A2E08BC; Thu, 6 Nov 2014 22:46:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Mkfif018719; Thu, 6 Nov 2014 22:46:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6MkeLN018716; Thu, 6 Nov 2014 22:46:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411062246.sA6MkeLN018716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 6 Nov 2014 22:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274200 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:46:41 -0000 Author: markj Date: Thu Nov 6 22:46:40 2014 New Revision: 274200 URL: https://svnweb.freebsd.org/changeset/base/274200 Log: Automatically build with debug symbols when building with WITH_CTF. Otherwise there's nothing for ctfconvert to do, and it ends up emitting an error for each object file. Also remove some redundant checks from bsd.prog.mk and bsd.lib.mk. Differential Revision: https://reviews.freebsd.org/D1111 Reviewed by: imp Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.own.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Thu Nov 6 22:45:03 2014 (r274199) +++ head/share/mk/bsd.lib.mk Thu Nov 6 22:46:40 2014 (r274200) @@ -36,7 +36,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .else Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Nov 6 22:45:03 2014 (r274199) +++ head/share/mk/bsd.own.mk Thu Nov 6 22:46:40 2014 (r274200) @@ -128,6 +128,7 @@ ____: .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +DEBUG_FLAGS+= -g .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Thu Nov 6 22:45:03 2014 (r274199) +++ head/share/mk/bsd.prog.mk Thu Nov 6 22:46:40 2014 (r274200) @@ -20,7 +20,7 @@ NO_WERROR= CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .endif From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:49:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3079B71; Thu, 6 Nov 2014 22:49:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2288EC; Thu, 6 Nov 2014 22:49:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6MnHGc019100; Thu, 6 Nov 2014 22:49:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6MnEcZ019081; Thu, 6 Nov 2014 22:49:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411062249.sA6MnEcZ019081@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 6 Nov 2014 22:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274201 - in vendor/compiler-rt/dist: . SDKs/darwin/usr/include SDKs/darwin/usr/include/sys cmake/Modules include include/sanitizer lib lib/arm lib/asan lib/asan/lit_tests lib/asan/lit_... 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:49:17 -0000 Author: dim Date: Thu Nov 6 22:49:13 2014 New Revision: 274201 URL: https://svnweb.freebsd.org/changeset/base/274201 Log: Import compiler-rt release_34 branch r197381. https://llvm.org/svn/llvm-project/compiler-rt/branches/release_34@197381 Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/errno.h (contents, props changed) vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/errno.h (contents, props changed) vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake vendor/compiler-rt/dist/include/sanitizer/dfsan_interface.h (contents, props changed) vendor/compiler-rt/dist/include/sanitizer/lsan_interface.h (contents, props changed) vendor/compiler-rt/dist/lib/asan/asan.syms.extra vendor/compiler-rt/dist/lib/asan/asan_dll_thunk.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/32bitConfig/ vendor/compiler-rt/dist/lib/asan/lit_tests/32bitConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/64bitConfig/ vendor/compiler-rt/dist/lib/asan/lit_tests/64bitConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/interface_symbols_darwin.c (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/malloc_set_zone_name-mprotect.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/malloc_zone-protected.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/reexec-insert-libraries-env.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Darwin/unset-insert-libraries-on-exec.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/blacklist-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/echo-env.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/init-order-atexit-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/init-order-pthread-create-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-blacklist-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-blacklist-extra2.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-blacklist.txt (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-bug-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-bug-extra2.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-constexpr-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/initialization-nobug-extra.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Helpers/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/asan_prelink_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/clone_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/coverage.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/glob.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/glob_test_root/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/glob_test_root/aa vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/glob_test_root/ab vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/glob_test_root/ba vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/heap-overflow-large.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/heavy_uar_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/initialization-bug-any-order.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/interception_failure_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/interception_malloc_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/interception_readdir_r_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/interception_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/interface_symbols_linux.c (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/malloc-in-qsort.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/malloc_delete_mismatch.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/overflow-in-qsort.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/preinit_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/ptrace.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/rlimit_mmap_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/swapcontext_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/syscalls.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/time_null_regtest.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/tsd_dtor_leak.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/uar_signals.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/unpoison_tls.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/zero-base-shadow32.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/Linux/zero-base-shadow64.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/ vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/darwin-dummy-shared-lib-so.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/dlclose-test-so.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/init-order-dlopen-so.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/SharedLibs/shared-lib-test-so.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/allocator_returns_null.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/allow_user_segv.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/asan-symbolize-sanity-test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/atexit_stats.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/blacklist.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/contiguous_container.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/current_allocated_bytes.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/deep_call_stack.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/deep_stack_uaf.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/deep_tail_call.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/deep_thread_stack.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/default_blacklist.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/default_options.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/dlclose-test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/double-free.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/force_inline_opt0.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/free_hook_realloc.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/global-demangle.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/global-overflow.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/heap-overflow.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/huge_negative_hea_oob.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/init-order-atexit.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/init-order-dlopen.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/init-order-pthread-create.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/initialization-blacklist.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/initialization-bug.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/initialization-constexpr.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/initialization-nobug.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/inline.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/interface_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/invalid-free.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/ioctl.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/large_func_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/log-path_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/log_path_fork_test.cc.disabled vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/lsan_annotations.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/malloc_context_size.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/malloc_fill.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/malloc_hook.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/memcmp_strict_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/memcmp_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/null_deref.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/on_error_callback.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/partial_right.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/poison_partial.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/print_summary.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/readv.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/sanity_check_pure_c.c (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/shared-lib-test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/sleep_before_dying.c (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/stack-buffer-overflow-with-position.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/stack-frame-demangle.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/stack-oob-frames.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/stack-overflow.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/stack-use-after-return.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/strdup_oob_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/strerror_r_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/strip_path_prefix.c (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/strncpy-overflow.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/symbolize_callback.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/throw_call_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/throw_invoke_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/time_interceptor.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/uar_and_exceptions.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/unaligned_loads_and_stores.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-free-right.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-free.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-poison.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-scope-dtor-order.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-scope-inlined.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-scope-nobug.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-scope-temp.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/use-after-scope.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/lit_tests/TestCases/wait.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/tests/asan_fake_stack_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/asan/tests/asan_interface_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/ vendor/compiler-rt/dist/lib/dfsan/CMakeLists.txt (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/Makefile.mk (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/dfsan.cc (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/dfsan.h (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/dfsan.syms.extra vendor/compiler-rt/dist/lib/dfsan/dfsan_custom.cc (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/dfsan_interceptors.cc (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/done_abilist.txt (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/libc_ubuntu1204_abilist.txt (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/ vendor/compiler-rt/dist/lib/dfsan/lit_tests/CMakeLists.txt (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/Inputs/ vendor/compiler-rt/dist/lib/dfsan/lit_tests/Inputs/flags_abilist.txt (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/basic.c (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/custom.c (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/flags.c (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/fncall.c (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/dfsan/lit_tests/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/lit_tests/propagate.c (contents, props changed) vendor/compiler-rt/dist/lib/dfsan/scripts/ vendor/compiler-rt/dist/lib/dfsan/scripts/build-libc-list.py (contents, props changed) vendor/compiler-rt/dist/lib/lit.common.configured.in (contents, props changed) vendor/compiler-rt/dist/lib/lit.common.unit.configured.in (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/AsanConfig/ vendor/compiler-rt/dist/lib/lsan/lit_tests/AsanConfig/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/AsanConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/LsanConfig/ vendor/compiler-rt/dist/lib/lsan/lit_tests/LsanConfig/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/LsanConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/ vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/SharedLibs/ vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/SharedLibs/huge_tls_lib_so.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/cleanup_in_tsd_destructor.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/disabler.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/disabler_in_tsd_destructor.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/do_leak_check_override.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/fork.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/fork_threaded.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/high_allocator_contention.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/ignore_object.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/ignore_object_errors.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/large_allocation_leak.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/leak_check_at_exit.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/link_turned_off.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/pointer_to_self.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/sanity_check_pure_c.c (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/stale_stack_leak.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/suppressions_default.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/suppressions_file.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/suppressions_file.cc.supp vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/swapcontext.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_after_return.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_globals_initialized.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_globals_uninitialized.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_registers.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_stacks.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_stacks_threaded.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_tls_dynamic.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_tls_pthread_specific_dynamic.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_tls_pthread_specific_static.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_tls_static.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/TestCases/use_unaligned.cc (contents, props changed) vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.common.cfg vendor/compiler-rt/dist/lib/lsan/lsan_preinit.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_altdirfunc.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_nomatch.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/tcgetattr.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/SharedLibs/ vendor/compiler-rt/dist/lib/msan/lit_tests/SharedLibs/dso-origin-so.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/SharedLibs/dso-origin.h (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/allocator_returns_null.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/backtrace.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/cxa_atexit.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/dlerror.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/dso-origin.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/errno.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/getline.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/getline_test_data vendor/compiler-rt/dist/lib/msan/lit_tests/initgroups.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/inline.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/insertvalue_origin.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/ioctl.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/ioctl_custom.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/keep-going-dso.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/keep-going.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/malloc_hook.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/poison_in_free.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/ptrace.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/scandir.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/scandir_null.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/scandir_test_root/ vendor/compiler-rt/dist/lib/msan/lit_tests/scandir_test_root/aaa vendor/compiler-rt/dist/lib/msan/lit_tests/scandir_test_root/aab vendor/compiler-rt/dist/lib/msan/lit_tests/scandir_test_root/bbb vendor/compiler-rt/dist/lib/msan/lit_tests/select.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/setlocale.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/signal_stress_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/sigwait.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/sigwaitinfo.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/sync_lock_set_and_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/tzset.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/unaligned_read_origin.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/use-after-free.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/vector_cvt.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/vector_select.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/ vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/caller.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/lit.local.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/one.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/two.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/lit_tests/wrap_indirect_calls/wrapper.cc (contents, props changed) vendor/compiler-rt/dist/lib/msan/msan.syms.extra vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator_internal.h (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libignore.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libignore.h (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_linux.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_suppressions.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_suppressions.h (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/scripts/cpplint.py (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/scripts/gen_dynamic_list.py (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/scripts/sancov.py (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_ioctl_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_nolibc_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_nolibc_test_main.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_posix_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_suppressions_test.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/allocator_returns_null.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/cond.c (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/cond_race.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/cond_version.c (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/deep_stack1.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/default_options.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_close_norace2.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race.c.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/halt_on_error.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_free.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib0.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib0.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib1.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib1.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib2.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib2.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib3.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib3.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_lib_lib.h (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_malloc.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_sync.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_robust.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_robust2.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/sigsuspend.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_global.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_global.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_race.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_race.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_race2.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/suppressions_race2.cc.supp vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_name2.cc (contents, props changed) vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms.extra vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_unit_test_main.cc (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/AsanConfig/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/AsanConfig/lit.cfg vendor/compiler-rt/dist/lib/ubsan/lit_tests/AsanConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Float/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Float/cast-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/add-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/div-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/div-zero.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/incdec-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/mul-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/negate-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/no-recover.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/shift.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/sub-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/uadd-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/uincdec-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/umul-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Integer/usub-overflow.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/bool.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/bounds.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/deduplication.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/enum.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/missing_return.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/unreachable.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/Misc/vla.c (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/Function/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/Function/function.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/Function/lit.local.cfg vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/misaligned.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/null.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/TestCases/TypeCheck/vptr.cpp (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/UbsanConfig/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/UbsanConfig/lit.cfg vendor/compiler-rt/dist/lib/ubsan/lit_tests/UbsanConfig/lit.site.cfg.in (contents, props changed) vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.common.cfg vendor/compiler-rt/dist/lib/ubsan/ubsan.syms.extra vendor/compiler-rt/dist/make/platform/clang_darwin_embedded.mk (contents, props changed) Deleted: vendor/compiler-rt/dist/lib/asan/asan.syms vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/ vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/ vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/ vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/ vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/allow_user_segv.cc vendor/compiler-rt/dist/lib/asan/lit_tests/blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_stack_uaf.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_tail_call.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_thread_stack.cc vendor/compiler-rt/dist/lib/asan/lit_tests/default_blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/default_options.cc vendor/compiler-rt/dist/lib/asan/lit_tests/dlclose-test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/double-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/force_inline_opt0.cc vendor/compiler-rt/dist/lib/asan/lit_tests/global-demangle.cc vendor/compiler-rt/dist/lib/asan/lit_tests/global-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/heap-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/huge_negative_hea_oob.cc vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-atexit.cc vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-dlopen.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-bug.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-constexpr.cc vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-nobug.cc vendor/compiler-rt/dist/lib/asan/lit_tests/interface_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/invalid-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/large_func_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/asan/lit_tests/log-path_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/log_path_fork_test.cc.disabled vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_fill.cc vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_hook.cc vendor/compiler-rt/dist/lib/asan/lit_tests/memcmp_strict_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/memcmp_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/null_deref.cc vendor/compiler-rt/dist/lib/asan/lit_tests/on_error_callback.cc vendor/compiler-rt/dist/lib/asan/lit_tests/partial_right.cc vendor/compiler-rt/dist/lib/asan/lit_tests/sanity_check_pure_c.c vendor/compiler-rt/dist/lib/asan/lit_tests/shared-lib-test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/sleep_before_dying.c vendor/compiler-rt/dist/lib/asan/lit_tests/stack-frame-demangle.cc vendor/compiler-rt/dist/lib/asan/lit_tests/stack-oob-frames.cc vendor/compiler-rt/dist/lib/asan/lit_tests/stack-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/stack-use-after-return.cc vendor/compiler-rt/dist/lib/asan/lit_tests/strip_path_prefix.c vendor/compiler-rt/dist/lib/asan/lit_tests/strncpy-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/symbolize_callback.cc vendor/compiler-rt/dist/lib/asan/lit_tests/throw_call_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/throw_invoke_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/time_interceptor.cc vendor/compiler-rt/dist/lib/asan/lit_tests/unaligned_loads_and_stores.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free-right.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-poison.cc vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-scope-inlined.cc vendor/compiler-rt/dist/lib/asan/lit_tests/wait.cc vendor/compiler-rt/dist/lib/lsan/lit_tests/SharedLibs/ vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/lsan/lit_tests/use_globals_initialized.cc vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/msan/msan.syms vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.cfg vendor/compiler-rt/dist/lib/tsan/rtl/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_suppressions_test.cc vendor/compiler-rt/dist/lib/ubsan/lit_tests/Float/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/ubsan/ubsan.syms Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake vendor/compiler-rt/dist/include/CMakeLists.txt vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h vendor/compiler-rt/dist/include/sanitizer/msan_interface.h vendor/compiler-rt/dist/lib/CMakeLists.txt vendor/compiler-rt/dist/lib/Makefile.mk vendor/compiler-rt/dist/lib/apple_versioning.c vendor/compiler-rt/dist/lib/arm/Makefile.mk vendor/compiler-rt/dist/lib/arm/comparesf2.S vendor/compiler-rt/dist/lib/arm/divmodsi4.S vendor/compiler-rt/dist/lib/arm/divsi3.S vendor/compiler-rt/dist/lib/arm/modsi3.S vendor/compiler-rt/dist/lib/arm/switch16.S vendor/compiler-rt/dist/lib/arm/switch32.S vendor/compiler-rt/dist/lib/arm/switch8.S vendor/compiler-rt/dist/lib/arm/switchu8.S vendor/compiler-rt/dist/lib/arm/udivmodsi4.S vendor/compiler-rt/dist/lib/arm/udivsi3.S vendor/compiler-rt/dist/lib/arm/umodsi3.S vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/asan_allocator.h vendor/compiler-rt/dist/lib/asan/asan_allocator2.cc vendor/compiler-rt/dist/lib/asan/asan_blacklist.txt vendor/compiler-rt/dist/lib/asan/asan_fake_stack.cc vendor/compiler-rt/dist/lib/asan/asan_fake_stack.h vendor/compiler-rt/dist/lib/asan/asan_flags.h vendor/compiler-rt/dist/lib/asan/asan_globals.cc vendor/compiler-rt/dist/lib/asan/asan_intercepted_functions.h vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h vendor/compiler-rt/dist/lib/asan/asan_internal.h vendor/compiler-rt/dist/lib/asan/asan_linux.cc vendor/compiler-rt/dist/lib/asan/asan_mac.cc vendor/compiler-rt/dist/lib/asan/asan_mac.h vendor/compiler-rt/dist/lib/asan/asan_malloc_linux.cc vendor/compiler-rt/dist/lib/asan/asan_malloc_mac.cc vendor/compiler-rt/dist/lib/asan/asan_malloc_win.cc vendor/compiler-rt/dist/lib/asan/asan_mapping.h vendor/compiler-rt/dist/lib/asan/asan_poisoning.cc vendor/compiler-rt/dist/lib/asan/asan_poisoning.h vendor/compiler-rt/dist/lib/asan/asan_posix.cc vendor/compiler-rt/dist/lib/asan/asan_report.cc vendor/compiler-rt/dist/lib/asan/asan_report.h vendor/compiler-rt/dist/lib/asan/asan_rtl.cc vendor/compiler-rt/dist/lib/asan/asan_stack.cc vendor/compiler-rt/dist/lib/asan/asan_stack.h vendor/compiler-rt/dist/lib/asan/asan_stats.cc vendor/compiler-rt/dist/lib/asan/asan_stats.h vendor/compiler-rt/dist/lib/asan/asan_thread.cc vendor/compiler-rt/dist/lib/asan/asan_thread.h vendor/compiler-rt/dist/lib/asan/asan_win.cc vendor/compiler-rt/dist/lib/asan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/asan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test_helpers.mm vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_test_utils.h vendor/compiler-rt/dist/lib/eprintf.c vendor/compiler-rt/dist/lib/int_endianness.h vendor/compiler-rt/dist/lib/int_util.c vendor/compiler-rt/dist/lib/interception/CMakeLists.txt vendor/compiler-rt/dist/lib/interception/interception.h vendor/compiler-rt/dist/lib/interception/interception_linux.cc vendor/compiler-rt/dist/lib/interception/interception_linux.h vendor/compiler-rt/dist/lib/interception/interception_mac.h vendor/compiler-rt/dist/lib/interception/interception_win.h vendor/compiler-rt/dist/lib/lit.common.cfg vendor/compiler-rt/dist/lib/lit.common.unit.cfg vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/Makefile.mk vendor/compiler-rt/dist/lib/lsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/lsan/lsan.cc vendor/compiler-rt/dist/lib/lsan/lsan.h vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.cc vendor/compiler-rt/dist/lib/lsan/lsan_common.h vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc vendor/compiler-rt/dist/lib/lsan/lsan_thread.cc vendor/compiler-rt/dist/lib/lsan/lsan_thread.h vendor/compiler-rt/dist/lib/lsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/lsan/tests/lsan_dummy_unittest.cc vendor/compiler-rt/dist/lib/lsan/tests/lsan_testlib.cc vendor/compiler-rt/dist/lib/msan/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob.cc vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/syscalls.cc vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/msan/lit_tests/getaddrinfo-positive.cc vendor/compiler-rt/dist/lib/msan/lit_tests/heap-origin.cc vendor/compiler-rt/dist/lib/msan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/msan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/msan/lit_tests/no_sanitize_memory_prop.cc vendor/compiler-rt/dist/lib/msan/lit_tests/stack-origin.cc vendor/compiler-rt/dist/lib/msan/msan.cc vendor/compiler-rt/dist/lib/msan/msan.h vendor/compiler-rt/dist/lib/msan/msan_allocator.cc vendor/compiler-rt/dist/lib/msan/msan_flags.h vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc vendor/compiler-rt/dist/lib/msan/msan_interface_internal.h vendor/compiler-rt/dist/lib/msan/msan_linux.cc vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc vendor/compiler-rt/dist/lib/msan/msan_report.cc vendor/compiler-rt/dist/lib/msan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc vendor/compiler-rt/dist/lib/msandr/README.txt vendor/compiler-rt/dist/lib/msandr/msandr.cc vendor/compiler-rt/dist/lib/profile/CMakeLists.txt vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_syscalls.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mutex.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_placement_new.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_quarantine.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_report_decorator.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stackdepot.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stackdepot.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_allocator_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_common_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_libc_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_linux_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_mutex_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_printf_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_main.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/Makefile.old vendor/compiler-rt/dist/lib/tsan/check_cmake.sh vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh vendor/compiler-rt/dist/lib/tsan/go/test.c vendor/compiler-rt/dist/lib/tsan/go/tsan_go.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.site.cfg.in vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_stack.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_location.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_pipe_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_stdout_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race.c vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race2.c vendor/compiler-rt/dist/lib/tsan/lit_tests/global_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/heap_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/inlined_memcpy_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java.h vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_rec_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_race_move.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.site.cfg.in vendor/compiler-rt/dist/lib/tsan/lit_tests/load_shared_lib.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp4.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_overflow.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_stack.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/memcpy_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mop_with_offset.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mop_with_offset2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_destroy_locked.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset1.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset4.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset5.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset6.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset7.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset8.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/oob_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_barrier.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_barrier2.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_heap.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex2.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_read.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_write.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_with_finished_thread.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_errno.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_malloc.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_race.c vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_stack.c vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_stack2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/sleep_sync.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/sleep_sync2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/stack_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/stack_race2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/suppress_same_address.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/suppress_same_stacks.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/test_output.sh vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak3.c vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak5.c vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_name.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/tiny_race.c vendor/compiler-rt/dist/lib/tsan/lit_tests/tls_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/tls_race2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/unaligned_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/write_in_reader_lock.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_defs.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_fd.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_atomic.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_java.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_mutex.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_trace.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_update_shadow_word_inl.h vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/rtl/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/unit/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mman_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_stack_test.cc vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.h vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash.cc vendor/compiler-rt/dist/make/AppleBI.mk vendor/compiler-rt/dist/make/platform/clang_darwin.mk vendor/compiler-rt/dist/make/platform/clang_linux.mk vendor/compiler-rt/dist/make/platform/darwin_bni.mk Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/CMakeLists.txt Thu Nov 6 22:49:13 2014 (r274201) @@ -15,6 +15,9 @@ include(LLVMParseArguments) # runtime libraries. cmake_minimum_required(VERSION 2.8.8) +# Top level target used to build all compiler-rt libraries. +add_custom_target(compiler-rt) + # Compute the Clang version from the LLVM version. # FIXME: We should be able to reuse CLANG_VERSION variable calculated # in Clang cmake files, instead of copying the rules here. @@ -36,21 +39,24 @@ set(CMAKE_MODULE_PATH include(AddCompilerRT) set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) # Setup custom SDK sysroots. set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin) set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux) +include(SanitizerUtils) # Detect whether the current target platform is 32-bit or 64-bit, and setup # the correct commandline flags needed to attempt to target 32-bit and 64-bit. -if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR LLVM_BUILD_32_BITS) +if (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND + NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") +endif() +if (NOT MSVC) set(TARGET_64_BIT_CFLAGS "-m64") - set(TARGET_32_BIT_CFLAGS "") + set(TARGET_32_BIT_CFLAGS "-m32") else() - if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - message(FATAL_ERROR "Please use a sane architecture with 4 or 8 byte pointers.") - endif() set(TARGET_64_BIT_CFLAGS "") - set(TARGET_32_BIT_CFLAGS "-m32") + set(TARGET_32_BIT_CFLAGS "") endif() # List of architectures we can target. @@ -86,13 +92,12 @@ macro(test_target_arch arch) endmacro() if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") - test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) + if (NOT MSVC) + test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) + endif() test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") - # Explicitly set -m flag on powerpc, because on ppc64 defaults for gcc and - # clang are different. - test_target_arch(powerpc64 "-m64") - test_target_arch(powerpc "-m32") + test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS}) endif() # We only support running instrumented tests when we're not cross compiling @@ -119,26 +124,43 @@ function(filter_available_targets out_va set(${out_var} ${archs} PARENT_SCOPE) endfunction() +option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF) + +# COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. +pythonize_bool(COMPILER_RT_DEBUG) + # Provide some common commmandline flags for Sanitizer runtimes. -set(SANITIZER_COMMON_CFLAGS - -fPIC - -fno-builtin - -fno-exceptions - -fomit-frame-pointer - -funwind-tables - -fno-stack-protector - -Wno-gnu # Variadic macros with 0 arguments for ... - -O3 - ) -if(NOT WIN32) - list(APPEND SANITIZER_COMMON_CFLAGS -fvisibility=hidden) -endif() -# Build sanitizer runtimes with debug info. -check_cxx_compiler_flag(-gline-tables-only SUPPORTS_GLINE_TABLES_ONLY_FLAG) -if(SUPPORTS_GLINE_TABLES_ONLY_FLAG) - list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) +if (NOT MSVC) + set(SANITIZER_COMMON_CFLAGS + -fPIC + -fno-builtin + -fno-exceptions + -fomit-frame-pointer + -funwind-tables + -fno-stack-protector + -Wno-gnu # Variadic macros with 0 arguments for ... + -fvisibility=hidden + ) + if (NOT COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -O3) + endif() else() - list(APPEND SANITIZER_COMMON_CFLAGS -g) + set(SANITIZER_COMMON_CFLAGS + /MT + /Zi + /Oy- + /GS- + /wd4722 + ) +endif() +# Build sanitizer runtimes with debug info. (MSVC gets /Zi above) +if (NOT MSVC) + check_cxx_compiler_flag(-gline-tables-only SUPPORTS_GLINE_TABLES_ONLY_FLAG) + if(SUPPORTS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) + list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) + else() + list(APPEND SANITIZER_COMMON_CFLAGS -g) + endif() endif() # Warnings suppressions. check_cxx_compiler_flag(-Wno-variadic-macros SUPPORTS_NO_VARIADIC_MACROS_FLAG) @@ -155,30 +177,50 @@ check_cxx_compiler_flag(-Wno-non-virtual if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG) list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor) endif() +check_cxx_compiler_flag(-Wglobal-constructors SUPPORTS_GLOBAL_CONSTRUCTORS_FLAG) +# Not all sanitizers forbid global constructors. -# Setup min Mac OS X version. if(APPLE) + # Obtain the iOS Simulator SDK path from xcodebuild. + execute_process( + COMMAND xcodebuild -version -sdk iphonesimulator Path + OUTPUT_VARIABLE IOSSIM_SDK_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx) + if (IOSSIM_SDK_DIR) + list(APPEND SANITIZER_COMMON_SUPPORTED_DARWIN_OS iossim) + endif() + if(COMPILER_RT_USES_LIBCXX) set(SANITIZER_MIN_OSX_VERSION 10.7) else() - set(SANITIZER_MIN_OSX_VERSION 10.5) + set(SANITIZER_MIN_OSX_VERSION 10.6) endif() - list(APPEND SANITIZER_COMMON_CFLAGS - -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + set(DARWIN_iossim_CFLAGS + -mios-simulator-version-min=7.0 -isysroot ${IOSSIM_SDK_DIR}) + set(DARWIN_osx_LINKFLAGS) + set(DARWIN_iossim_LINKFLAGS + -Wl,-ios_simulator_version_min,7.0.0 + -mios-simulator-version-min=7.0 + -isysroot ${IOSSIM_SDK_DIR}) endif() # Architectures supported by Sanitizer runtimes. Specific sanitizers may # support only subset of these (e.g. TSan works on x86_64 only). filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH - x86_64 i386 powerpc64 powerpc) + x86_64 i386 powerpc64) -# Add the public header's directory to the includes for all of compiler-rt. -include_directories(include) add_subdirectory(include) set(SANITIZER_COMMON_LIT_TEST_DEPS clang clang-headers FileCheck count not llvm-nm llvm-symbolizer compiler-rt-headers) +# Check code style when running lit tests for sanitizers. +if(UNIX) + list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) +endif() add_subdirectory(lib) Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/errno.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/errno.h Thu Nov 6 22:49:13 2014 (r274201) @@ -0,0 +1,17 @@ +/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#include Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h Thu Nov 6 22:49:13 2014 (r274201) @@ -28,4 +28,25 @@ char *strdup(const char *); size_t strlen(const char *); char *strncpy(char *, const char *, size_t); +/* Determine the appropriate strerror() function. */ +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) +# if defined(__i386) +# define __STRERROR_NAME "_strerror$UNIX2003" +# elif defined(__x86_64__) || defined(__arm) +# define __STRERROR_NAME "_strerror" +# else +# error "unrecognized architecture for targetting OS X" +# endif +#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) +# if defined(__i386) || defined (__x86_64) || defined(__arm) +# define __STRERROR_NAME "_strerror" +# else +# error "unrecognized architecture for targetting iOS" +# endif +#else +# error "unrecognized architecture for targetting Darwin" +#endif + +char *strerror(int) __asm(__STRERROR_NAME); + #endif /* __STRING_H__ */ Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/errno.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/errno.h Thu Nov 6 22:49:13 2014 (r274201) @@ -0,0 +1,31 @@ +/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== + * + * The LLVM Compiler Infrastructure + * + * This file is dual licensed under the MIT and the University of Illinois Open + * Source Licenses. See LICENSE.TXT for details. + * + * ===-----------------------------------------------------------------------=== + * + * This is a stub SDK header file. This file is not part of the interface of + * this library nor an official version of the appropriate SDK header. It is + * intended only to stub the features of this header required by compiler-rt. + * + * ===-----------------------------------------------------------------------=== + */ + +#ifndef _SYS_ERRNO_H_ +#define _SYS_ERRNO_H_ + +#if defined(__cplusplus) +extern "C" { +#endif + +extern int *__error(void); +#define errno (*__error()) + +#if defined(__cplusplus) +} +#endif + +#endif Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Thu Nov 6 22:49:13 2014 (r274201) @@ -6,29 +6,35 @@ include(CompilerRTUtils) # with name "." if architecture can be targeted. # add_compiler_rt_object_library( # SOURCES -# CFLAGS ) +# CFLAGS +# DEFS ) macro(add_compiler_rt_object_library name arch) if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS" "" ${ARGN}) + parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) add_library(${name}.${arch} OBJECT ${LIB_SOURCES}) set_target_compile_flags(${name}.${arch} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set_property(TARGET ${name}.${arch} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) else() message(FATAL_ERROR "Archtecture ${arch} can't be targeted") endif() endmacro() -# Same as above, but adds universal osx library with name ".osx" -# targeting multiple architectures. -# add_compiler_rt_osx_object_library( ARCH -# SOURCES -# CFLAGS ) -macro(add_compiler_rt_osx_object_library name) - parse_arguments(LIB "ARCH;SOURCES;CFLAGS" "" ${ARGN}) - set(libname "${name}.osx") +# Same as above, but adds universal osx library for either OSX or iOS simulator +# with name "." targeting multiple architectures. +# add_compiler_rt_darwin_object_library( ARCH +# SOURCES +# CFLAGS +# DEFS ) +macro(add_compiler_rt_darwin_object_library name os) + parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN}) + set(libname "${name}.${os}") add_library(${libname} OBJECT ${LIB_SOURCES}) - set_target_compile_flags(${libname} ${LIB_CFLAGS}) + set_target_compile_flags(${libname} ${LIB_CFLAGS} ${DARWIN_${os}_CFLAGS}) set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}") + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) endmacro() # Adds static runtime for a given architecture and puts it in the proper @@ -36,11 +42,10 @@ endmacro() # add_compiler_rt_static_runtime( # SOURCES # CFLAGS -# DEFS -# SYMS ) +# DEFS ) macro(add_compiler_rt_static_runtime name arch) if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS;DEFS;SYMS" "" ${ARGN}) + parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) add_library(${name} STATIC ${LIB_SOURCES}) # Setup compile flags and definitions. set_target_compile_flags(${name} @@ -53,13 +58,7 @@ macro(add_compiler_rt_static_runtime nam # Add installation command. install(TARGETS ${name} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - # Generate the .syms file if possible. - if(LIB_SYMS) - get_target_property(libfile ${name} LOCATION) - configure_file(${LIB_SYMS} ${libfile}.syms) - install(FILES ${libfile}.syms - DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - endif(LIB_SYMS) + add_dependencies(compiler-rt ${name}) else() message(FATAL_ERROR "Archtecture ${arch} can't be targeted") endif() @@ -82,19 +81,22 @@ macro(add_compiler_rt_osx_static_runtime ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) install(TARGETS ${name} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + add_dependencies(compiler-rt ${name}) endmacro() -# Adds dynamic runtime library on osx, which supports multiple architectures. -# add_compiler_rt_osx_dynamic_runtime( ARCH -# SOURCES -# CFLAGS -# DEFS -# LINKFLAGS ) -macro(add_compiler_rt_osx_dynamic_runtime name) +# Adds dynamic runtime library on osx/iossim, which supports multiple +# architectures. +# add_compiler_rt_darwin_dynamic_runtime( +# ARCH +# SOURCES +# CFLAGS +# DEFS +# LINKFLAGS ) +macro(add_compiler_rt_darwin_dynamic_runtime name os) parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN}) add_library(${name} SHARED ${LIB_SOURCES}) - set_target_compile_flags(${name} ${LIB_CFLAGS}) - set_target_link_flags(${name} ${LIB_LINKFLAGS}) + set_target_compile_flags(${name} ${LIB_CFLAGS} ${DARWIN_${os}_CFLAGS}) + set_target_link_flags(${name} ${LIB_LINKFLAGS} ${DARWIN_${os}_LINKFLAGS}) set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS ${LIB_DEFS}) set_target_properties(${name} PROPERTIES @@ -102,14 +104,16 @@ macro(add_compiler_rt_osx_dynamic_runtim LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) install(TARGETS ${name} LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + add_dependencies(compiler-rt ${name}) endmacro() # Unittests support. set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) -set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/gtest-all.cc) +set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc) set(COMPILER_RT_GTEST_INCLUDE_CFLAGS -DGTEST_NO_LLVM_RAW_OSTREAM=1 -I${COMPILER_RT_GTEST_PATH}/include + -I${COMPILER_RT_GTEST_PATH} ) # Use Clang to link objects into a single executable with just-built Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Thu Nov 6 22:49:13 2014 (r274201) @@ -26,3 +26,13 @@ function(find_flag_in_string flag_string set(${out_var} FALSE PARENT_SCOPE) endif() endfunction() + +# Set the variable var_PYBOOL to True if var holds a true-ish string, +# otherwise set it to False. +macro(pythonize_bool var) + if (${var}) + set(${var}_PYBOOL True) + else() + set(${var}_PYBOOL False) + endif() +endmacro() Added: vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake Thu Nov 6 22:49:13 2014 (r274201) @@ -0,0 +1,42 @@ +include(LLVMParseArguments) + +set(SANITIZER_GEN_DYNAMIC_LIST + ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py) + +set(SANITIZER_LINT_SCRIPT + ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/check_lint.sh) + +# Create a target "-symbols" that would generate the list of symbols +# that need to be exported from sanitizer runtime "". Function +# interceptors are exported automatically, user can also provide files with +# symbol names that should be exported as well. +# add_sanitizer_rt_symbols( ) +macro(add_sanitizer_rt_symbols name) + get_target_property(libfile ${name} LOCATION) + set(symsfile "${libfile}.syms") + add_custom_command(OUTPUT ${symsfile} + COMMAND ${PYTHON_EXECUTABLE} + ${SANITIZER_GEN_DYNAMIC_LIST} ${libfile} ${ARGN} + > ${symsfile} + DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating exported symbols for ${name}" + VERBATIM) + add_custom_target(${name}-symbols ALL + DEPENDS ${symsfile} + SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN}) + install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + add_dependencies(compiler-rt ${name}-symbols) +endmacro() + +# Add target to check code style for sanitizer runtimes. +if(UNIX) + add_custom_target(SanitizerLintCheck + COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR= + PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + ${SANITIZER_LINT_SCRIPT} + DEPENDS ${SANITIZER_LINT_SCRIPT} + COMMENT "Running lint check for sanitizer sources..." + VERBATIM) +endif() + Modified: vendor/compiler-rt/dist/include/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/include/CMakeLists.txt Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/include/CMakeLists.txt Thu Nov 6 22:49:13 2014 (r274201) @@ -1,7 +1,9 @@ set(SANITIZER_HEADERS sanitizer/asan_interface.h sanitizer/common_interface_defs.h + sanitizer/dfsan_interface.h sanitizer/linux_syscall_hooks.h + sanitizer/lsan_interface.h sanitizer/msan_interface.h) set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) @@ -32,6 +34,7 @@ foreach( f ${SANITIZER_HEADERS} ) endforeach( f ) add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) +add_dependencies(compiler-rt compiler-rt-headers) # Install sanitizer headers. install(FILES ${SANITIZER_HEADERS} Modified: vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Thu Nov 6 22:49:13 2014 (r274201) @@ -27,10 +27,6 @@ extern "C" { // Tell the tools to write their reports to "path." instead of stderr. void __sanitizer_set_report_path(const char *path); - // Tell the tools to write their reports to given file descriptor instead of - // stderr. - void __sanitizer_set_report_fd(int fd); - // Notify the tools that the sandbox is going to be turned on. The reserved // parameter will be used in the future to hold a structure with functions // that the tools may call to bypass the sandbox. @@ -51,6 +47,33 @@ extern "C" { void __sanitizer_unaligned_store32(void *p, uint32_t x); void __sanitizer_unaligned_store64(void *p, uint64_t x); + // Record and dump coverage info. + void __sanitizer_cov_dump(); + + // Annotate the current state of a contiguous container, such as + // std::vector, std::string or similar. + // A contiguous container is a container that keeps all of its elements + // in a contiguous region of memory. The container owns the region of memory + // [beg, end); the memory [beg, mid) is used to store the current elements + // and the memory [mid, end) is reserved for future elements; + // end <= mid <= end. For example, in "std::vector<> v" + // beg = &v[0]; + // end = beg + v.capacity() * sizeof(v[0]); + // mid = beg + v.size() * sizeof(v[0]); + // + // This annotation tells the Sanitizer tool about the current state of the + // container so that the tool can report errors when memory from [mid, end) + // is accessed. Insert this annotation into methods like push_back/pop_back. + // Supply the old and the new values of mid (old_mid/new_mid). + // In the initial state mid == end and so should be the final + // state when the container is destroyed or when it reallocates the storage. + // + // Use with caution and don't use for anything other than vector-like classes. + // + // For AddressSanitizer, 'beg' should be 8-aligned. + void __sanitizer_annotate_contiguous_container(void *beg, void *end, + void *old_mid, void *new_mid); + #ifdef __cplusplus } // extern "C" #endif Added: vendor/compiler-rt/dist/include/sanitizer/dfsan_interface.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/include/sanitizer/dfsan_interface.h Thu Nov 6 22:49:13 2014 (r274201) @@ -0,0 +1,87 @@ +//===-- dfsan_interface.h -------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of DataFlowSanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef DFSAN_INTERFACE_H +#define DFSAN_INTERFACE_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef uint16_t dfsan_label; + +/// Stores information associated with a specific label identifier. A label +/// may be a base label created using dfsan_create_label, with associated +/// text description and user data, or an automatically created union label, +/// which represents the union of two label identifiers (which may themselves +/// be base or union labels). +struct dfsan_label_info { + // Fields for union labels, set to 0 for base labels. + dfsan_label l1; + dfsan_label l2; + + // Fields for base labels. + const char *desc; + void *userdata; +}; + +/// Computes the union of \c l1 and \c l2, possibly creating a union label in +/// the process. +dfsan_label dfsan_union(dfsan_label l1, dfsan_label l2); + +/// Creates and returns a base label with the given description and user data. +dfsan_label dfsan_create_label(const char *desc, void *userdata); + +/// Sets the label for each address in [addr,addr+size) to \c label. +void dfsan_set_label(dfsan_label label, void *addr, size_t size); + +/// Sets the label for each address in [addr,addr+size) to the union of the +/// current label for that address and \c label. +void dfsan_add_label(dfsan_label label, void *addr, size_t size); + +/// Retrieves the label associated with the given data. +/// +/// The type of 'data' is arbitrary. The function accepts a value of any type, +/// which can be truncated or extended (implicitly or explicitly) as necessary. +/// The truncation/extension operations will preserve the label of the original +/// value. +dfsan_label dfsan_get_label(long data); + +/// Retrieves the label associated with the data at the given address. +dfsan_label dfsan_read_label(const void *addr, size_t size); + +/// Retrieves a pointer to the dfsan_label_info struct for the given label. +const struct dfsan_label_info *dfsan_get_label_info(dfsan_label label); + +/// Returns whether the given label label contains the label elem. +int dfsan_has_label(dfsan_label label, dfsan_label elem); + +/// If the given label label contains a label with the description desc, returns +/// that label, else returns 0. +dfsan_label dfsan_has_label_with_desc(dfsan_label label, const char *desc); + +#ifdef __cplusplus +} // extern "C" + +template +void dfsan_set_label(dfsan_label label, T &data) { // NOLINT + dfsan_set_label(label, (void *)&data, sizeof(T)); +} + +#endif + +#endif // DFSAN_INTERFACE_H Modified: vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h Thu Nov 6 22:46:40 2014 (r274200) +++ vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h Thu Nov 6 22:49:13 2014 (r274201) @@ -15,788 +15,3056 @@ // actions for the active sanitizer. // Usage: // __sanitizer_syscall_pre_getfoo(...args...); -// int res = syscall(__NR_getfoo, ...args...); +// long res = syscall(__NR_getfoo, ...args...); // __sanitizer_syscall_post_getfoo(res, ...args...); //===----------------------------------------------------------------------===// #ifndef SANITIZER_LINUX_SYSCALL_HOOKS_H #define SANITIZER_LINUX_SYSCALL_HOOKS_H -#ifdef __cplusplus -extern "C" { +#define __sanitizer_syscall_pre_time(tloc) \ + __sanitizer_syscall_pre_impl_time((long)(tloc)) +#define __sanitizer_syscall_post_time(res, tloc) \ + __sanitizer_syscall_post_impl_time(res, (long)(tloc)) +#define __sanitizer_syscall_pre_stime(tptr) \ + __sanitizer_syscall_pre_impl_stime((long)(tptr)) +#define __sanitizer_syscall_post_stime(res, tptr) \ + __sanitizer_syscall_post_impl_stime(res, (long)(tptr)) +#define __sanitizer_syscall_pre_gettimeofday(tv, tz) \ + __sanitizer_syscall_pre_impl_gettimeofday((long)(tv), (long)(tz)) +#define __sanitizer_syscall_post_gettimeofday(res, tv, tz) \ + __sanitizer_syscall_post_impl_gettimeofday(res, (long)(tv), (long)(tz)) +#define __sanitizer_syscall_pre_settimeofday(tv, tz) \ + __sanitizer_syscall_pre_impl_settimeofday((long)(tv), (long)(tz)) +#define __sanitizer_syscall_post_settimeofday(res, tv, tz) \ + __sanitizer_syscall_post_impl_settimeofday(res, (long)(tv), (long)(tz)) +#define __sanitizer_syscall_pre_adjtimex(txc_p) \ + __sanitizer_syscall_pre_impl_adjtimex((long)(txc_p)) +#define __sanitizer_syscall_post_adjtimex(res, txc_p) \ + __sanitizer_syscall_post_impl_adjtimex(res, (long)(txc_p)) +#define __sanitizer_syscall_pre_times(tbuf) \ + __sanitizer_syscall_pre_impl_times((long)(tbuf)) +#define __sanitizer_syscall_post_times(res, tbuf) \ + __sanitizer_syscall_post_impl_times(res, (long)(tbuf)) +#define __sanitizer_syscall_pre_gettid() __sanitizer_syscall_pre_impl_gettid() +#define __sanitizer_syscall_post_gettid(res) \ + __sanitizer_syscall_post_impl_gettid(res) +#define __sanitizer_syscall_pre_nanosleep(rqtp, rmtp) \ + __sanitizer_syscall_pre_impl_nanosleep((long)(rqtp), (long)(rmtp)) +#define __sanitizer_syscall_post_nanosleep(res, rqtp, rmtp) \ + __sanitizer_syscall_post_impl_nanosleep(res, (long)(rqtp), (long)(rmtp)) +#define __sanitizer_syscall_pre_alarm(seconds) \ + __sanitizer_syscall_pre_impl_alarm((long)(seconds)) +#define __sanitizer_syscall_post_alarm(res, seconds) \ + __sanitizer_syscall_post_impl_alarm(res, (long)(seconds)) +#define __sanitizer_syscall_pre_getpid() __sanitizer_syscall_pre_impl_getpid() +#define __sanitizer_syscall_post_getpid(res) \ + __sanitizer_syscall_post_impl_getpid(res) +#define __sanitizer_syscall_pre_getppid() __sanitizer_syscall_pre_impl_getppid() +#define __sanitizer_syscall_post_getppid(res) \ + __sanitizer_syscall_post_impl_getppid(res) +#define __sanitizer_syscall_pre_getuid() __sanitizer_syscall_pre_impl_getuid() +#define __sanitizer_syscall_post_getuid(res) \ + __sanitizer_syscall_post_impl_getuid(res) +#define __sanitizer_syscall_pre_geteuid() __sanitizer_syscall_pre_impl_geteuid() +#define __sanitizer_syscall_post_geteuid(res) \ + __sanitizer_syscall_post_impl_geteuid(res) +#define __sanitizer_syscall_pre_getgid() __sanitizer_syscall_pre_impl_getgid() +#define __sanitizer_syscall_post_getgid(res) \ + __sanitizer_syscall_post_impl_getgid(res) +#define __sanitizer_syscall_pre_getegid() __sanitizer_syscall_pre_impl_getegid() +#define __sanitizer_syscall_post_getegid(res) \ + __sanitizer_syscall_post_impl_getegid(res) +#define __sanitizer_syscall_pre_getresuid(ruid, euid, suid) \ + __sanitizer_syscall_pre_impl_getresuid((long)(ruid), (long)(euid), \ + (long)(suid)) +#define __sanitizer_syscall_post_getresuid(res, ruid, euid, suid) \ + __sanitizer_syscall_post_impl_getresuid(res, (long)(ruid), (long)(euid), \ + (long)(suid)) +#define __sanitizer_syscall_pre_getresgid(rgid, egid, sgid) \ + __sanitizer_syscall_pre_impl_getresgid((long)(rgid), (long)(egid), \ + (long)(sgid)) +#define __sanitizer_syscall_post_getresgid(res, rgid, egid, sgid) \ + __sanitizer_syscall_post_impl_getresgid(res, (long)(rgid), (long)(egid), \ + (long)(sgid)) +#define __sanitizer_syscall_pre_getpgid(pid) \ + __sanitizer_syscall_pre_impl_getpgid((long)(pid)) +#define __sanitizer_syscall_post_getpgid(res, pid) \ + __sanitizer_syscall_post_impl_getpgid(res, (long)(pid)) +#define __sanitizer_syscall_pre_getpgrp() __sanitizer_syscall_pre_impl_getpgrp() +#define __sanitizer_syscall_post_getpgrp(res) \ + __sanitizer_syscall_post_impl_getpgrp(res) +#define __sanitizer_syscall_pre_getsid(pid) \ + __sanitizer_syscall_pre_impl_getsid((long)(pid)) +#define __sanitizer_syscall_post_getsid(res, pid) \ + __sanitizer_syscall_post_impl_getsid(res, (long)(pid)) +#define __sanitizer_syscall_pre_getgroups(gidsetsize, grouplist) \ + __sanitizer_syscall_pre_impl_getgroups((long)(gidsetsize), (long)(grouplist)) +#define __sanitizer_syscall_post_getgroups(res, gidsetsize, grouplist) \ + __sanitizer_syscall_post_impl_getgroups(res, (long)(gidsetsize), \ + (long)(grouplist)) +#define __sanitizer_syscall_pre_setregid(rgid, egid) \ + __sanitizer_syscall_pre_impl_setregid((long)(rgid), (long)(egid)) +#define __sanitizer_syscall_post_setregid(res, rgid, egid) \ + __sanitizer_syscall_post_impl_setregid(res, (long)(rgid), (long)(egid)) +#define __sanitizer_syscall_pre_setgid(gid) \ + __sanitizer_syscall_pre_impl_setgid((long)(gid)) +#define __sanitizer_syscall_post_setgid(res, gid) \ + __sanitizer_syscall_post_impl_setgid(res, (long)(gid)) +#define __sanitizer_syscall_pre_setreuid(ruid, euid) \ + __sanitizer_syscall_pre_impl_setreuid((long)(ruid), (long)(euid)) +#define __sanitizer_syscall_post_setreuid(res, ruid, euid) \ + __sanitizer_syscall_post_impl_setreuid(res, (long)(ruid), (long)(euid)) +#define __sanitizer_syscall_pre_setuid(uid) \ + __sanitizer_syscall_pre_impl_setuid((long)(uid)) +#define __sanitizer_syscall_post_setuid(res, uid) \ + __sanitizer_syscall_post_impl_setuid(res, (long)(uid)) +#define __sanitizer_syscall_pre_setresuid(ruid, euid, suid) \ + __sanitizer_syscall_pre_impl_setresuid((long)(ruid), (long)(euid), \ + (long)(suid)) +#define __sanitizer_syscall_post_setresuid(res, ruid, euid, suid) \ + __sanitizer_syscall_post_impl_setresuid(res, (long)(ruid), (long)(euid), \ + (long)(suid)) +#define __sanitizer_syscall_pre_setresgid(rgid, egid, sgid) \ + __sanitizer_syscall_pre_impl_setresgid((long)(rgid), (long)(egid), \ + (long)(sgid)) +#define __sanitizer_syscall_post_setresgid(res, rgid, egid, sgid) \ + __sanitizer_syscall_post_impl_setresgid(res, (long)(rgid), (long)(egid), \ + (long)(sgid)) +#define __sanitizer_syscall_pre_setfsuid(uid) \ + __sanitizer_syscall_pre_impl_setfsuid((long)(uid)) +#define __sanitizer_syscall_post_setfsuid(res, uid) \ + __sanitizer_syscall_post_impl_setfsuid(res, (long)(uid)) +#define __sanitizer_syscall_pre_setfsgid(gid) \ + __sanitizer_syscall_pre_impl_setfsgid((long)(gid)) +#define __sanitizer_syscall_post_setfsgid(res, gid) \ + __sanitizer_syscall_post_impl_setfsgid(res, (long)(gid)) +#define __sanitizer_syscall_pre_setpgid(pid, pgid) \ + __sanitizer_syscall_pre_impl_setpgid((long)(pid), (long)(pgid)) +#define __sanitizer_syscall_post_setpgid(res, pid, pgid) \ + __sanitizer_syscall_post_impl_setpgid(res, (long)(pid), (long)(pgid)) +#define __sanitizer_syscall_pre_setsid() __sanitizer_syscall_pre_impl_setsid() +#define __sanitizer_syscall_post_setsid(res) \ + __sanitizer_syscall_post_impl_setsid(res) +#define __sanitizer_syscall_pre_setgroups(gidsetsize, grouplist) \ + __sanitizer_syscall_pre_impl_setgroups((long)(gidsetsize), (long)(grouplist)) +#define __sanitizer_syscall_post_setgroups(res, gidsetsize, grouplist) \ + __sanitizer_syscall_post_impl_setgroups(res, (long)(gidsetsize), \ + (long)(grouplist)) +#define __sanitizer_syscall_pre_acct(name) \ + __sanitizer_syscall_pre_impl_acct((long)(name)) +#define __sanitizer_syscall_post_acct(res, name) \ + __sanitizer_syscall_post_impl_acct(res, (long)(name)) +#define __sanitizer_syscall_pre_capget(header, dataptr) \ + __sanitizer_syscall_pre_impl_capget((long)(header), (long)(dataptr)) +#define __sanitizer_syscall_post_capget(res, header, dataptr) \ + __sanitizer_syscall_post_impl_capget(res, (long)(header), (long)(dataptr)) +#define __sanitizer_syscall_pre_capset(header, data) \ + __sanitizer_syscall_pre_impl_capset((long)(header), (long)(data)) +#define __sanitizer_syscall_post_capset(res, header, data) \ + __sanitizer_syscall_post_impl_capset(res, (long)(header), (long)(data)) +#define __sanitizer_syscall_pre_personality(personality) \ + __sanitizer_syscall_pre_impl_personality((long)(personality)) +#define __sanitizer_syscall_post_personality(res, personality) \ + __sanitizer_syscall_post_impl_personality(res, (long)(personality)) +#define __sanitizer_syscall_pre_sigpending(set) \ + __sanitizer_syscall_pre_impl_sigpending((long)(set)) +#define __sanitizer_syscall_post_sigpending(res, set) \ + __sanitizer_syscall_post_impl_sigpending(res, (long)(set)) +#define __sanitizer_syscall_pre_sigprocmask(how, set, oset) \ + __sanitizer_syscall_pre_impl_sigprocmask((long)(how), (long)(set), \ + (long)(oset)) +#define __sanitizer_syscall_post_sigprocmask(res, how, set, oset) \ + __sanitizer_syscall_post_impl_sigprocmask(res, (long)(how), (long)(set), \ + (long)(oset)) +#define __sanitizer_syscall_pre_getitimer(which, value) \ + __sanitizer_syscall_pre_impl_getitimer((long)(which), (long)(value)) +#define __sanitizer_syscall_post_getitimer(res, which, value) \ + __sanitizer_syscall_post_impl_getitimer(res, (long)(which), (long)(value)) +#define __sanitizer_syscall_pre_setitimer(which, value, ovalue) \ + __sanitizer_syscall_pre_impl_setitimer((long)(which), (long)(value), \ + (long)(ovalue)) +#define __sanitizer_syscall_post_setitimer(res, which, value, ovalue) \ + __sanitizer_syscall_post_impl_setitimer(res, (long)(which), (long)(value), \ + (long)(ovalue)) +#define __sanitizer_syscall_pre_timer_create(which_clock, timer_event_spec, \ + created_timer_id) \ + __sanitizer_syscall_pre_impl_timer_create( \ + (long)(which_clock), (long)(timer_event_spec), (long)(created_timer_id)) +#define __sanitizer_syscall_post_timer_create( \ + res, which_clock, timer_event_spec, created_timer_id) \ + __sanitizer_syscall_post_impl_timer_create(res, (long)(which_clock), \ + (long)(timer_event_spec), \ + (long)(created_timer_id)) +#define __sanitizer_syscall_pre_timer_gettime(timer_id, setting) \ + __sanitizer_syscall_pre_impl_timer_gettime((long)(timer_id), (long)(setting)) +#define __sanitizer_syscall_post_timer_gettime(res, timer_id, setting) \ + __sanitizer_syscall_post_impl_timer_gettime(res, (long)(timer_id), \ + (long)(setting)) +#define __sanitizer_syscall_pre_timer_getoverrun(timer_id) \ + __sanitizer_syscall_pre_impl_timer_getoverrun((long)(timer_id)) +#define __sanitizer_syscall_post_timer_getoverrun(res, timer_id) \ + __sanitizer_syscall_post_impl_timer_getoverrun(res, (long)(timer_id)) +#define __sanitizer_syscall_pre_timer_settime(timer_id, flags, new_setting, \ + old_setting) \ + __sanitizer_syscall_pre_impl_timer_settime((long)(timer_id), (long)(flags), \ + (long)(new_setting), \ + (long)(old_setting)) +#define __sanitizer_syscall_post_timer_settime(res, timer_id, flags, \ + new_setting, old_setting) \ + __sanitizer_syscall_post_impl_timer_settime( \ + res, (long)(timer_id), (long)(flags), (long)(new_setting), \ + (long)(old_setting)) +#define __sanitizer_syscall_pre_timer_delete(timer_id) \ + __sanitizer_syscall_pre_impl_timer_delete((long)(timer_id)) +#define __sanitizer_syscall_post_timer_delete(res, timer_id) \ + __sanitizer_syscall_post_impl_timer_delete(res, (long)(timer_id)) +#define __sanitizer_syscall_pre_clock_settime(which_clock, tp) \ + __sanitizer_syscall_pre_impl_clock_settime((long)(which_clock), (long)(tp)) +#define __sanitizer_syscall_post_clock_settime(res, which_clock, tp) \ + __sanitizer_syscall_post_impl_clock_settime(res, (long)(which_clock), \ + (long)(tp)) +#define __sanitizer_syscall_pre_clock_gettime(which_clock, tp) \ + __sanitizer_syscall_pre_impl_clock_gettime((long)(which_clock), (long)(tp)) +#define __sanitizer_syscall_post_clock_gettime(res, which_clock, tp) \ + __sanitizer_syscall_post_impl_clock_gettime(res, (long)(which_clock), \ + (long)(tp)) +#define __sanitizer_syscall_pre_clock_adjtime(which_clock, tx) \ + __sanitizer_syscall_pre_impl_clock_adjtime((long)(which_clock), (long)(tx)) +#define __sanitizer_syscall_post_clock_adjtime(res, which_clock, tx) \ + __sanitizer_syscall_post_impl_clock_adjtime(res, (long)(which_clock), \ + (long)(tx)) +#define __sanitizer_syscall_pre_clock_getres(which_clock, tp) \ + __sanitizer_syscall_pre_impl_clock_getres((long)(which_clock), (long)(tp)) +#define __sanitizer_syscall_post_clock_getres(res, which_clock, tp) \ + __sanitizer_syscall_post_impl_clock_getres(res, (long)(which_clock), \ + (long)(tp)) +#define __sanitizer_syscall_pre_clock_nanosleep(which_clock, flags, rqtp, \ + rmtp) \ + __sanitizer_syscall_pre_impl_clock_nanosleep( \ + (long)(which_clock), (long)(flags), (long)(rqtp), (long)(rmtp)) +#define __sanitizer_syscall_post_clock_nanosleep(res, which_clock, flags, \ + rqtp, rmtp) \ + __sanitizer_syscall_post_impl_clock_nanosleep( \ + res, (long)(which_clock), (long)(flags), (long)(rqtp), (long)(rmtp)) +#define __sanitizer_syscall_pre_nice(increment) \ + __sanitizer_syscall_pre_impl_nice((long)(increment)) +#define __sanitizer_syscall_post_nice(res, increment) \ + __sanitizer_syscall_post_impl_nice(res, (long)(increment)) +#define __sanitizer_syscall_pre_sched_setscheduler(pid, policy, param) \ + __sanitizer_syscall_pre_impl_sched_setscheduler((long)(pid), (long)(policy), \ + (long)(param)) +#define __sanitizer_syscall_post_sched_setscheduler(res, pid, policy, param) \ + __sanitizer_syscall_post_impl_sched_setscheduler( \ + res, (long)(pid), (long)(policy), (long)(param)) +#define __sanitizer_syscall_pre_sched_setparam(pid, param) \ + __sanitizer_syscall_pre_impl_sched_setparam((long)(pid), (long)(param)) +#define __sanitizer_syscall_post_sched_setparam(res, pid, param) \ + __sanitizer_syscall_post_impl_sched_setparam(res, (long)(pid), (long)(param)) +#define __sanitizer_syscall_pre_sched_getscheduler(pid) \ + __sanitizer_syscall_pre_impl_sched_getscheduler((long)(pid)) +#define __sanitizer_syscall_post_sched_getscheduler(res, pid) \ + __sanitizer_syscall_post_impl_sched_getscheduler(res, (long)(pid)) +#define __sanitizer_syscall_pre_sched_getparam(pid, param) \ + __sanitizer_syscall_pre_impl_sched_getparam((long)(pid), (long)(param)) +#define __sanitizer_syscall_post_sched_getparam(res, pid, param) \ + __sanitizer_syscall_post_impl_sched_getparam(res, (long)(pid), (long)(param)) +#define __sanitizer_syscall_pre_sched_setaffinity(pid, len, user_mask_ptr) \ + __sanitizer_syscall_pre_impl_sched_setaffinity((long)(pid), (long)(len), \ + (long)(user_mask_ptr)) +#define __sanitizer_syscall_post_sched_setaffinity(res, pid, len, \ + user_mask_ptr) \ + __sanitizer_syscall_post_impl_sched_setaffinity( \ + res, (long)(pid), (long)(len), (long)(user_mask_ptr)) +#define __sanitizer_syscall_pre_sched_getaffinity(pid, len, user_mask_ptr) \ + __sanitizer_syscall_pre_impl_sched_getaffinity((long)(pid), (long)(len), \ + (long)(user_mask_ptr)) +#define __sanitizer_syscall_post_sched_getaffinity(res, pid, len, \ + user_mask_ptr) \ + __sanitizer_syscall_post_impl_sched_getaffinity( \ + res, (long)(pid), (long)(len), (long)(user_mask_ptr)) +#define __sanitizer_syscall_pre_sched_yield() \ + __sanitizer_syscall_pre_impl_sched_yield() +#define __sanitizer_syscall_post_sched_yield(res) \ + __sanitizer_syscall_post_impl_sched_yield(res) +#define __sanitizer_syscall_pre_sched_get_priority_max(policy) \ + __sanitizer_syscall_pre_impl_sched_get_priority_max((long)(policy)) +#define __sanitizer_syscall_post_sched_get_priority_max(res, policy) \ + __sanitizer_syscall_post_impl_sched_get_priority_max(res, (long)(policy)) +#define __sanitizer_syscall_pre_sched_get_priority_min(policy) \ + __sanitizer_syscall_pre_impl_sched_get_priority_min((long)(policy)) +#define __sanitizer_syscall_post_sched_get_priority_min(res, policy) \ + __sanitizer_syscall_post_impl_sched_get_priority_min(res, (long)(policy)) +#define __sanitizer_syscall_pre_sched_rr_get_interval(pid, interval) \ + __sanitizer_syscall_pre_impl_sched_rr_get_interval((long)(pid), \ + (long)(interval)) +#define __sanitizer_syscall_post_sched_rr_get_interval(res, pid, interval) \ + __sanitizer_syscall_post_impl_sched_rr_get_interval(res, (long)(pid), \ + (long)(interval)) +#define __sanitizer_syscall_pre_setpriority(which, who, niceval) \ + __sanitizer_syscall_pre_impl_setpriority((long)(which), (long)(who), \ + (long)(niceval)) +#define __sanitizer_syscall_post_setpriority(res, which, who, niceval) \ + __sanitizer_syscall_post_impl_setpriority(res, (long)(which), (long)(who), \ + (long)(niceval)) +#define __sanitizer_syscall_pre_getpriority(which, who) \ + __sanitizer_syscall_pre_impl_getpriority((long)(which), (long)(who)) +#define __sanitizer_syscall_post_getpriority(res, which, who) \ + __sanitizer_syscall_post_impl_getpriority(res, (long)(which), (long)(who)) +#define __sanitizer_syscall_pre_shutdown(arg0, arg1) \ + __sanitizer_syscall_pre_impl_shutdown((long)(arg0), (long)(arg1)) +#define __sanitizer_syscall_post_shutdown(res, arg0, arg1) \ + __sanitizer_syscall_post_impl_shutdown(res, (long)(arg0), (long)(arg1)) +#define __sanitizer_syscall_pre_reboot(magic1, magic2, cmd, arg) \ + __sanitizer_syscall_pre_impl_reboot((long)(magic1), (long)(magic2), \ + (long)(cmd), (long)(arg)) +#define __sanitizer_syscall_post_reboot(res, magic1, magic2, cmd, arg) \ + __sanitizer_syscall_post_impl_reboot(res, (long)(magic1), (long)(magic2), \ + (long)(cmd), (long)(arg)) +#define __sanitizer_syscall_pre_restart_syscall() \ + __sanitizer_syscall_pre_impl_restart_syscall() +#define __sanitizer_syscall_post_restart_syscall(res) \ + __sanitizer_syscall_post_impl_restart_syscall(res) +#define __sanitizer_syscall_pre_kexec_load(entry, nr_segments, segments, \ + flags) \ + __sanitizer_syscall_pre_impl_kexec_load((long)(entry), (long)(nr_segments), \ + (long)(segments), (long)(flags)) +#define __sanitizer_syscall_post_kexec_load(res, entry, nr_segments, segments, \ + flags) \ + __sanitizer_syscall_post_impl_kexec_load(res, (long)(entry), \ + (long)(nr_segments), \ + (long)(segments), (long)(flags)) +#define __sanitizer_syscall_pre_exit(error_code) \ + __sanitizer_syscall_pre_impl_exit((long)(error_code)) +#define __sanitizer_syscall_post_exit(res, error_code) \ + __sanitizer_syscall_post_impl_exit(res, (long)(error_code)) +#define __sanitizer_syscall_pre_exit_group(error_code) \ + __sanitizer_syscall_pre_impl_exit_group((long)(error_code)) +#define __sanitizer_syscall_post_exit_group(res, error_code) \ + __sanitizer_syscall_post_impl_exit_group(res, (long)(error_code)) +#define __sanitizer_syscall_pre_wait4(pid, stat_addr, options, ru) \ + __sanitizer_syscall_pre_impl_wait4((long)(pid), (long)(stat_addr), \ + (long)(options), (long)(ru)) +#define __sanitizer_syscall_post_wait4(res, pid, stat_addr, options, ru) \ + __sanitizer_syscall_post_impl_wait4(res, (long)(pid), (long)(stat_addr), \ + (long)(options), (long)(ru)) +#define __sanitizer_syscall_pre_waitid(which, pid, infop, options, ru) \ + __sanitizer_syscall_pre_impl_waitid( \ + (long)(which), (long)(pid), (long)(infop), (long)(options), (long)(ru)) +#define __sanitizer_syscall_post_waitid(res, which, pid, infop, options, ru) \ + __sanitizer_syscall_post_impl_waitid(res, (long)(which), (long)(pid), \ + (long)(infop), (long)(options), \ + (long)(ru)) +#define __sanitizer_syscall_pre_waitpid(pid, stat_addr, options) \ + __sanitizer_syscall_pre_impl_waitpid((long)(pid), (long)(stat_addr), \ + (long)(options)) +#define __sanitizer_syscall_post_waitpid(res, pid, stat_addr, options) \ + __sanitizer_syscall_post_impl_waitpid(res, (long)(pid), (long)(stat_addr), \ + (long)(options)) +#define __sanitizer_syscall_pre_set_tid_address(tidptr) \ + __sanitizer_syscall_pre_impl_set_tid_address((long)(tidptr)) +#define __sanitizer_syscall_post_set_tid_address(res, tidptr) \ + __sanitizer_syscall_post_impl_set_tid_address(res, (long)(tidptr)) +#define __sanitizer_syscall_pre_init_module(umod, len, uargs) \ + __sanitizer_syscall_pre_impl_init_module((long)(umod), (long)(len), \ + (long)(uargs)) +#define __sanitizer_syscall_post_init_module(res, umod, len, uargs) \ + __sanitizer_syscall_post_impl_init_module(res, (long)(umod), (long)(len), \ + (long)(uargs)) +#define __sanitizer_syscall_pre_delete_module(name_user, flags) \ + __sanitizer_syscall_pre_impl_delete_module((long)(name_user), (long)(flags)) +#define __sanitizer_syscall_post_delete_module(res, name_user, flags) \ + __sanitizer_syscall_post_impl_delete_module(res, (long)(name_user), \ + (long)(flags)) +#define __sanitizer_syscall_pre_rt_sigprocmask(how, set, oset, sigsetsize) \ + __sanitizer_syscall_pre_impl_rt_sigprocmask( \ + (long)(how), (long)(set), (long)(oset), (long)(sigsetsize)) +#define __sanitizer_syscall_post_rt_sigprocmask(res, how, set, oset, \ + sigsetsize) \ + __sanitizer_syscall_post_impl_rt_sigprocmask( \ + res, (long)(how), (long)(set), (long)(oset), (long)(sigsetsize)) +#define __sanitizer_syscall_pre_rt_sigpending(set, sigsetsize) \ + __sanitizer_syscall_pre_impl_rt_sigpending((long)(set), (long)(sigsetsize)) +#define __sanitizer_syscall_post_rt_sigpending(res, set, sigsetsize) \ + __sanitizer_syscall_post_impl_rt_sigpending(res, (long)(set), \ + (long)(sigsetsize)) +#define __sanitizer_syscall_pre_rt_sigtimedwait(uthese, uinfo, uts, \ + sigsetsize) \ + __sanitizer_syscall_pre_impl_rt_sigtimedwait( \ + (long)(uthese), (long)(uinfo), (long)(uts), (long)(sigsetsize)) +#define __sanitizer_syscall_post_rt_sigtimedwait(res, uthese, uinfo, uts, \ + sigsetsize) \ + __sanitizer_syscall_post_impl_rt_sigtimedwait( \ + res, (long)(uthese), (long)(uinfo), (long)(uts), (long)(sigsetsize)) +#define __sanitizer_syscall_pre_rt_tgsigqueueinfo(tgid, pid, sig, uinfo) \ + __sanitizer_syscall_pre_impl_rt_tgsigqueueinfo((long)(tgid), (long)(pid), \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:50:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAB3AD01; Thu, 6 Nov 2014 22:50:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4EB8FA; Thu, 6 Nov 2014 22:50:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Mo0N9019409; Thu, 6 Nov 2014 22:50:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Mo0n0019408; Thu, 6 Nov 2014 22:50:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411062250.sA6Mo0n0019408@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 6 Nov 2014 22:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274202 - vendor/compiler-rt/compiler-rt-r197381 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:50:00 -0000 Author: dim Date: Thu Nov 6 22:50:00 2014 New Revision: 274202 URL: https://svnweb.freebsd.org/changeset/base/274202 Log: Tag compiler-rt release_34 branch r197381. Added: vendor/compiler-rt/compiler-rt-r197381/ - copied from r274201, vendor/compiler-rt/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 22:53:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FF57EC0; Thu, 6 Nov 2014 22:53:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C64E9BE; Thu, 6 Nov 2014 22:53:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6MroZ1023295; Thu, 6 Nov 2014 22:53:50 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Mro6t023294; Thu, 6 Nov 2014 22:53:50 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411062253.sA6Mro6t023294@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 6 Nov 2014 22:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274203 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:53:51 -0000 Author: dteske Date: Thu Nov 6 22:53:50 2014 New Revision: 274203 URL: https://svnweb.freebsd.org/changeset/base/274203 Log: SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. Add to using _prebuild_libs in (top-level) Makefile.inc1. NB: Unbreak build yet again (we'll get this right eventually) Reviewed by: markj, ngie Thanks to: ian, markj, ngie, Nikolai Lifanov MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 274121 274123 274144 274146 274192 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 6 22:50:00 2014 (r274202) +++ head/Makefile.inc1 Thu Nov 6 22:53:50 2014 (r274203) @@ -1537,6 +1537,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libwind} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ + lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ ${_lib_libcapsicum} \ From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:04:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CC7A3C4; Thu, 6 Nov 2014 23:04:32 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2FFAB22; Thu, 6 Nov 2014 23:04:31 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id d1so2981039wiv.1 for ; Thu, 06 Nov 2014 15:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7KsMyZ22XTQzXfAmnDOsf1CgnEKy488nVjTg9pbFmS4=; b=ee1aygnKx5RQdaoAllcfEfe9YwOlGdHcpTSuSUcl16A64nqSL9ecl5/NHi/XBnVSnX WahkBSHVpfbfDRxFScV7WpQ780uDCwReX3WRi+uR+NKv3vYaqnNLnHSMUzrCYoPZQ9sh sRFvs/7druDGhhO3JnLpEKhjE1fUJgaXUF7jtueHcawISfWKAP9SPs3r7NOSN5ZKMx6p SgVmiNwjehvXHFkvrlIW1GMVyW/NlW0/7YbbI7RAOpphYFb56WPuwQr951scYIhxymoP 7TVHQTNN2oXPjjKGVBrK4kbsqHDNq0kefNM6q+JoXVky9zTWWV32cH0P4Do6XFFvD67T yOOg== MIME-Version: 1.0 X-Received: by 10.194.80.100 with SMTP id q4mr10291377wjx.15.1415315070021; Thu, 06 Nov 2014 15:04:30 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Thu, 6 Nov 2014 15:04:29 -0800 (PST) In-Reply-To: References: <201410150122.s9F1Mudu083306@svn.freebsd.org> <545B55FA.6070408@FreeBSD.org> Date: Thu, 6 Nov 2014 15:04:29 -0800 X-Google-Sender-Auth: xoWt17U5OC5LCkzFwmEaKq1uLUc Message-ID: Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe From: Adrian Chadd To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "Alexander V. Chernikov" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:04:32 -0000 On 6 November 2014 09:58, Ryan Stone wrote: > On Thu, Nov 6, 2014 at 12:21 PM, Adrian Chadd wrote: >> Hm, are there any other hardware counters that we can use to see what >> was dropped? > > On the 82599 and later you need to configure the RQSMR register to map > queue pools to indices and then the QPRDC[i] register will contain the > number of drops. Ok. > Note that the 82598 doesn't support the DROPEN bit in the SRRCTL > register. There is a separate DROPEN register on the 82598, but I > have the following worrisome comment in my version of ixgbe: > > if (hw->mac.type == ixgbe_mac_82598EB) { > /* > * The DROPEN register is intended to allow us to immediately > * drop packets that cannot be DMA'ed to memory right away to > * avoid head-of-line blocking. However we have observed that > * enabling this functionality can lead to situations where a > * queue will drop every packet destined for it silently, so > * we instead accept the HOL blocking and disable the immediate > * dropping > */ > IXGBE_WRITE_REG(&adapter->hw, IXGBE_DROPEN, 0); ... even if there's ring slots? -adrian From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:05:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF45751D; Thu, 6 Nov 2014 23:05:16 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D06BB36; Thu, 6 Nov 2014 23:05:16 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sA6N5Apd083804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 6 Nov 2014 15:05:10 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sA6N5AlG083803; Thu, 6 Nov 2014 15:05:10 -0800 (PST) (envelope-from sgk) Date: Thu, 6 Nov 2014 15:05:10 -0800 From: Steve Kargl To: Devin Teske Subject: Re: svn commit: r274203 - head Message-ID: <20141106230509.GA83754@troutmask.apl.washington.edu> References: <201411062253.sA6Mro6t023294@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411062253.sA6Mro6t023294@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:05:16 -0000 On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: > Author: dteske > Date: Thu Nov 6 22:53:50 2014 > New Revision: 274203 > URL: https://svnweb.freebsd.org/changeset/base/274203 > > Log: > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. > Add to using _prebuild_libs in (top-level) Makefile.inc1. > NB: Unbreak build yet again (we'll get this right eventually) Any chance that you can test your changes before committing? -- Steve From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:06:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5CDC66D; Thu, 6 Nov 2014 23:06:03 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFCEBB51; Thu, 6 Nov 2014 23:06:03 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:59955 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XmJBd-0005BQ-66; Thu, 06 Nov 2014 01:17:01 -0800 From: To: "'Steve Kargl'" , "'Devin Teske'" References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> In-Reply-To: <20141106230509.GA83754@troutmask.apl.washington.edu> Subject: RE: svn commit: r274203 - head Date: Thu, 6 Nov 2014 15:06:02 -0800 Message-ID: <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJ7dnudjVNpxU8ewRYQ1gE7quwK8gHgKpJymu4+BmA= Content-Language: en-us Sender: devin@shxd.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:06:03 -0000 > -----Original Message----- > From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] > Sent: Thursday, November 6, 2014 3:05 PM > To: Devin Teske > Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: Re: svn commit: r274203 - head > > On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: > > Author: dteske > > Date: Thu Nov 6 22:53:50 2014 > > New Revision: 274203 > > URL: https://svnweb.freebsd.org/changeset/base/274203 > > > > Log: > > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. > > Add to using _prebuild_libs in (top-level) Makefile.inc1. > > NB: Unbreak build yet again (we'll get this right eventually) > > Any chance that you can test your changes before committing? > I don't have a -CURRENT box; and -CURRENT is giving different results. -- Devin From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:16:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74F42A39; Thu, 6 Nov 2014 23:16:21 +0000 (UTC) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 44306C99; Thu, 6 Nov 2014 23:16:20 +0000 (UTC) Received: from jre-mbp.elischer.org (ppp121-45-239-104.lns20.per1.internode.on.net [121.45.239.104]) (authenticated bits=0) by vps1.elischer.org (8.14.9/8.14.9) with ESMTP id sA6NGF7g038569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 6 Nov 2014 15:16:17 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <545C0139.4000008@freebsd.org> Date: Fri, 07 Nov 2014 07:16:09 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: dteske@FreeBSD.org, "'Steve Kargl'" Subject: Re: svn commit: r274203 - head References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> In-Reply-To: <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:16:21 -0000 On 11/7/14, 7:06 AM, dteske@FreeBSD.org wrote: > >> -----Original Message----- >> From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] >> Sent: Thursday, November 6, 2014 3:05 PM >> To: Devin Teske >> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- >> head@freebsd.org >> Subject: Re: svn commit: r274203 - head >> >> On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: >>> Author: dteske >>> Date: Thu Nov 6 22:53:50 2014 >>> New Revision: 274203 >>> URL: https://svnweb.freebsd.org/changeset/base/274203 >>> >>> Log: >>> SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. >>> Add to using _prebuild_libs in (top-level) Makefile.inc1. >>> NB: Unbreak build yet again (we'll get this right eventually) >> Any chance that you can test your changes before committing? >> > I don't have a -CURRENT box; and -CURRENT is giving different results. You should check inthe cluster...I think there are a set of machines there for just this reason.. not everyone has every machine type.. but you should be able to test on -current so take a look... From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:19:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1D5BBE0; Thu, 6 Nov 2014 23:19:20 +0000 (UTC) Received: from mail-ig0-x231.google.com (mail-ig0-x231.google.com [IPv6:2607:f8b0:4001:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5692CCBE; Thu, 6 Nov 2014 23:19:20 +0000 (UTC) Received: by mail-ig0-f177.google.com with SMTP id hl2so4373580igb.16 for ; Thu, 06 Nov 2014 15:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cc1vBpvehLc1xKgpyvJIJe1hn1r1FVWZyfpj03XkJds=; b=PXm+bj/hOm4NtpvketcEgmNMx4O83kjSQ5/QCk65124x4R2m7i+UvzxvvQL6/DYi2n ENEjjTZ9RRboLkOtba19bxMNegQ5tJhU74YqfJD/65PA2A73GdNM2Mz26Rj84qDu+LXS azcTlLeG4lYOZGmk+bnQlcfdXFL3bybNdV67cHtZ31KRsG/Sjx1wE2zc82MiUKJPbxCf JoNHTxm16vxd/RYRt5ATh4eDtY3cW9rLE8U/j2LV0FK51eKokcgLRL6A9NHe3mZKd0u9 1XuhhVU8ZIY5AkfHwT0Vji4VMKQuKWOtjs7x0xavNvbw0ELULO+tPTtkfhdz5bHnK+0W elTQ== MIME-Version: 1.0 X-Received: by 10.50.93.6 with SMTP id cq6mr17358705igb.7.1415315959855; Thu, 06 Nov 2014 15:19:19 -0800 (PST) Received: by 10.50.235.49 with HTTP; Thu, 6 Nov 2014 15:19:19 -0800 (PST) In-Reply-To: <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> Date: Thu, 6 Nov 2014 15:19:19 -0800 Message-ID: Subject: Re: svn commit: r274203 - head From: NGie Cooper To: Devin Teske Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:19:21 -0000 On Thu, Nov 6, 2014 at 3:06 PM, wrote: > >> -----Original Message----- >> From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] >> Sent: Thursday, November 6, 2014 3:05 PM >> To: Devin Teske >> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- >> head@freebsd.org >> Subject: Re: svn commit: r274203 - head >> >> On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: >> > Author: dteske >> > Date: Thu Nov 6 22:53:50 2014 >> > New Revision: 274203 >> > URL: https://svnweb.freebsd.org/changeset/base/274203 >> > >> > Log: >> > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. >> > Add to using _prebuild_libs in (top-level) Makefile.inc1. >> > NB: Unbreak build yet again (we'll get this right eventually) >> >> Any chance that you can test your changes before committing? >> > > I don't have a -CURRENT box; and -CURRENT is giving different results. freefall's a pretty good build box for starters potentially (just point MAKEOBJDIRPREFIX to $HOME/obj) The real problem is that there's some build tiering that's taking place between different portions of the build, and depending on when and how things get done, things can go awry. There's one race that I asked dteske to fix, which is build gnu/lib/libdialog with _prebuild_libs (it will fail if the stars align properly today because gnu/lib is built in _generic_libs, as-is lib/). SUBDIR_DEPENDS/SUBDIR_PARALLEL doesn't work 100% unfortunately, as I've noticed in my own testing, depending on the order that things get installed/built. At best it only works if things use -L to point to libraries .PATH to point to files produced during the build, etc, and it doesn't work in dteske's case (lib A depends on lib B, which hasn't been installed to ${WORLDTMP}/usr/lib yet, so the linking process fails). make _libraries runs the `make obj; make depend; make all; make install` steps. Some libraries have implicit dependencies that aren't recorded; technically, gnu/lib/libdialog depends on libncurses as a build and runtime dependency, but because make _includes gets run before make _libraries, the build goes through without a hitch. The overlinking work that bapt's doing may unroot additional issues with implied dependencies in the build, or fix other issues if the libraries aren't fully spelled out. It'll be nice once we move away from this tiered building hell :(... From owner-svn-src-all@FreeBSD.ORG Thu Nov 6 23:45:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D777E3A1; Thu, 6 Nov 2014 23:45:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2EA5FDF; Thu, 6 Nov 2014 23:45:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6Nj6iq047065; Thu, 6 Nov 2014 23:45:06 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Nj55a047058; Thu, 6 Nov 2014 23:45:05 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201411062345.sA6Nj55a047058@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Thu, 6 Nov 2014 23:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274205 - in head/sys: dev/ixl modules/ixlv 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 23:45:07 -0000 Author: jfv Date: Thu Nov 6 23:45:05 2014 New Revision: 274205 URL: https://svnweb.freebsd.org/changeset/base/274205 Log: Update the Intel i40e drivers, ixl version 1.2.8, ixlv version 1.1.18 -Improved VF stability, thanks to changes from Ryan Stone, and Juniper. - RSS fixes in the ixlv driver - link detection in the ixlv driver - New sysctl's added in ixl and ixlv - reset timeout increased for ixlv - stability fixes in detach - correct media reporting - Coverity warnings fixed - Many small bug fixes - VF Makefile modified - nvm shared code needed - remove unused sleep channels in ixlv_sc struct Submitted by: Eric Joyner (committed by jfv) MFC after: 1 week Modified: head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c head/sys/modules/ixlv/Makefile Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Thu Nov 6 23:35:22 2014 (r274204) +++ head/sys/dev/ixl/i40e_osdep.c Thu Nov 6 23:45:05 2014 (r274205) @@ -107,6 +107,7 @@ i40e_allocate_dma_mem(struct i40e_hw *hw "error %u\n", err); goto fail_2; } + mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Thu Nov 6 23:35:22 2014 (r274204) +++ head/sys/dev/ixl/i40e_osdep.h Thu Nov 6 23:45:05 2014 (r274205) @@ -147,8 +147,7 @@ void prefetch(void *x) #define prefetch(x) #endif -struct i40e_osdep -{ +struct i40e_osdep { bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Thu Nov 6 23:35:22 2014 (r274204) +++ head/sys/dev/ixl/if_ixl.c Thu Nov 6 23:45:05 2014 (r274205) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.2.2"; +char ixl_driver_version[] = "1.2.8"; /********************************************************************* * PCI Device ID Table @@ -109,6 +109,7 @@ static bool ixl_config_link(struct i40e_ static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); +static int ixl_set_advertised_speeds(struct ixl_pf *, int); static void ixl_enable_rings(struct ixl_vsi *); static void ixl_disable_rings(struct ixl_vsi *); @@ -155,6 +156,7 @@ static void ixl_do_adminq(void *, int); static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); static int ixl_current_speed(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); /* Statistics */ static void ixl_add_hw_stats(struct ixl_pf *); @@ -176,7 +178,8 @@ static void ixl_stat_update32(struct i40 static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); #endif @@ -276,6 +279,7 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif + static char *ixl_fc_string[6] = { "None", "Rx", @@ -398,6 +402,11 @@ ixl_attach(device_t dev) OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_current_speed, "A", "Current Port Speed"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rx_itr", CTLFLAG_RW, @@ -436,8 +445,13 @@ ixl_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hw_res_info", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_hw_res_info, "A", "HW Resource Allocation"); + OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -445,7 +459,7 @@ ixl_attach(device_t dev) pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif - /* Save off the information about this board */ + /* Save off the PCI information */ hw->vendor_id = pci_get_vendor(dev); hw->device_id = pci_get_device(dev); hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); @@ -593,6 +607,7 @@ ixl_attach(device_t dev) bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); i40e_get_port_mac_addr(hw, hw->mac.port_addr); + /* Set up VSI and queues */ if (ixl_setup_stations(pf) != 0) { device_printf(dev, "setup stations failed!\n"); error = ENOMEM; @@ -630,8 +645,11 @@ ixl_attach(device_t dev) "an unqualified module was detected\n"); /* Setup OS specific network interface */ - if (ixl_setup_interface(dev, vsi) != 0) + if (ixl_setup_interface(dev, vsi) != 0) { + device_printf(dev, "interface setup failed!\n"); + error = EIO; goto err_late; + } /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); @@ -642,25 +660,32 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* Reset port's advertised speeds */ + if (!i40e_is_40G_device(hw->device_id)) { + pf->advertised_speed = 0x7; + ixl_set_advertised_speeds(pf, 0x7); + } + /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); + INIT_DEBUGOUT("ixl_attach: end"); return (0); err_late: - ixl_free_vsi(vsi); + if (vsi->ifp != NULL) + if_free(vsi->ifp); err_mac_hmc: i40e_shutdown_lan_hmc(hw); err_get_cap: i40e_shutdown_adminq(hw); err_out: - if (vsi->ifp != NULL) - if_free(vsi->ifp); ixl_free_pci_resources(pf); + ixl_free_vsi(vsi); IXL_PF_LOCK_DESTROY(pf); return (error); } @@ -725,6 +750,7 @@ ixl_detach(device_t dev) ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); + ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2246,6 +2272,34 @@ early: return; } +static void +ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type) +{ + /* Display supported media types */ + if (phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); +} /********************************************************************* * @@ -2276,7 +2330,7 @@ ixl_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixl_ioctl; -#if __FreeBSD_version >= 1100000 +#if __FreeBSD_version >= 1100036 if_setgetcounterfn(ifp, ixl_get_counter); #endif @@ -2286,8 +2340,6 @@ ixl_setup_interface(device_t dev, struct ifp->if_snd.ifq_maxlen = que->num_desc - 2; - ether_ifattach(ifp, hw->mac.addr); - vsi->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; @@ -2328,40 +2380,26 @@ ixl_setup_interface(device_t dev, struct ixl_media_status); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); - if (aq_error) { - printf("Error getting supported media types, AQ error %d\n", aq_error); - return (EPERM); - } - - /* Display supported media types */ - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) { + /* Need delay to detect fiber correctly */ + i40e_msec_delay(200); + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) + device_printf(dev, "Unknown PHY type detected!\n"); + else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); + } else if (aq_error) { + device_printf(dev, "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + } else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&vsi->media, IFM_ETHER | IFM_AUTO); + ether_ifattach(ifp, hw->mac.addr); + return (0); } @@ -3728,10 +3766,6 @@ ixl_update_stats_counters(struct ixl_pf pf->stat_offsets_loaded, &osd->eth.rx_discards, &nsd->eth.rx_discards); - ixl_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), - pf->stat_offsets_loaded, - &osd->eth.tx_discards, - &nsd->eth.tx_discards); ixl_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port), I40E_GLPRT_UPRCL(hw->port), pf->stat_offsets_loaded, @@ -3915,8 +3949,8 @@ ixl_do_adminq(void *context, int pending u32 reg, loop = 0; u16 opcode, result; - event.msg_len = IXL_AQ_BUF_SZ; - event.msg_buf = malloc(event.msg_len, + event.buf_len = IXL_AQ_BUF_SZ; + event.msg_buf = malloc(event.buf_len, M_DEVBUF, M_NOWAIT | M_ZERO); if (!event.msg_buf) { printf("Unable to allocate adminq memory\n"); @@ -4300,6 +4334,52 @@ ixl_current_speed(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_set_advertised_speeds(struct ixl_pf *pf, int speeds) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + /* Prepare new config */ + bzero(&config, sizeof(config)); + config.phy_type = abilities.phy_type; + config.abilities = abilities.abilities + | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + /* Translate into aq cmd link_speed */ + if (speeds & 0x4) + config.link_speed |= I40E_LINK_SPEED_10GB; + if (speeds & 0x2) + config.link_speed |= I40E_LINK_SPEED_1GB; + if (speeds & 0x1) + config.link_speed |= I40E_LINK_SPEED_100MB; + + /* Do aq command & restart link */ + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + return (0); +} + /* ** Control link advertise speed: ** Flags: @@ -4315,10 +4395,7 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - struct i40e_aq_get_phy_abilities_resp abilities; - struct i40e_aq_set_phy_config config; int requested_ls = 0; - enum i40e_status_code aq_error = 0; int error = 0; /* @@ -4343,39 +4420,9 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) if (pf->advertised_speed == requested_ls) return (0); - /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); - if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } - - /* Prepare new config */ - bzero(&config, sizeof(config)); - config.phy_type = abilities.phy_type; - config.abilities = abilities.abilities - | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; - config.eee_capability = abilities.eee_capability; - config.eeer = abilities.eeer_val; - config.low_power_ctrl = abilities.d3_lpan; - /* Translate into aq cmd link_speed */ - if (requested_ls & 0x4) - config.link_speed |= I40E_LINK_SPEED_10GB; - if (requested_ls & 0x2) - config.link_speed |= I40E_LINK_SPEED_1GB; - if (requested_ls & 0x1) - config.link_speed |= I40E_LINK_SPEED_100MB; - - /* Do aq command & restart link */ - aq_error = i40e_aq_set_phy_config(hw, &config, NULL); - if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } + error = ixl_set_advertised_speeds(pf, requested_ls); + if (error) + return (error); pf->advertised_speed = requested_ls; ixl_update_link_status(pf); @@ -4454,6 +4501,26 @@ ixl_get_bus_info(struct i40e_hw *hw, dev return (link); } +static int +ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + char buf[32]; + + snprintf(buf, sizeof(buf), + "f%d.%d a%d.%d n%02x.%02x e%08x", + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, + hw->aq.api_maj_ver, hw->aq.api_min_ver, + (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> + IXL_NVM_VERSION_HI_SHIFT, + (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> + IXL_NVM_VERSION_LO_SHIFT, + hw->nvm.eetrack); + return (sysctl_handle_string(oidp, buf, strlen(buf), req)); +} + + #ifdef IXL_DEBUG static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) @@ -4563,7 +4630,7 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER #define IXL_SW_RES_SIZE 0x14 static int -ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS) +ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; @@ -4620,7 +4687,120 @@ ixl_sysctl_hw_res_info(SYSCTL_HANDLER_AR device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return error; +} + +/* +** Caller must init and delete sbuf; this function will clear and +** finish it for caller. +*/ +static char * +ixl_switch_element_string(struct sbuf *s, u16 seid, bool uplink) +{ + sbuf_clear(s); + if (seid == 0 && uplink) + sbuf_cat(s, "Network"); + else if (seid == 0) + sbuf_cat(s, "Host"); + else if (seid == 1) + sbuf_cat(s, "EMP"); + else if (seid <= 5) + sbuf_printf(s, "MAC %d", seid - 2); + else if (seid <= 15) + sbuf_cat(s, "Reserved"); + else if (seid <= 31) + sbuf_printf(s, "PF %d", seid - 16); + else if (seid <= 159) + sbuf_printf(s, "VF %d", seid - 32); + else if (seid <= 287) + sbuf_cat(s, "Reserved"); + else if (seid <= 511) + sbuf_cat(s, "Other"); // for other structures + else if (seid <= 895) + sbuf_printf(s, "VSI %d", seid - 512); + else if (seid <= 1023) + sbuf_printf(s, "Reserved"); + else + sbuf_cat(s, "Invalid"); + + sbuf_finish(s); + return sbuf_data(s); +} + +static int +ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct sbuf *buf; + struct sbuf *nmbuf; + int error = 0; + u8 aq_buf[I40E_AQ_LARGE_BUF]; + + u16 next = 0; + struct i40e_aqc_get_switch_config_resp *sw_config; + sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; + + buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + if (!buf) { + device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); + return (ENOMEM); + } + + error = i40e_aq_get_switch_config(hw, sw_config, + sizeof(aq_buf), &next, NULL); + if (error) { + device_printf(dev, "%s: aq_get_switch_config() error %d, aq error %d\n", + __func__, error, hw->aq.asq_last_status); + sbuf_delete(buf); + return error; + } + + nmbuf = sbuf_new_auto(); + if (!nmbuf) { + device_printf(dev, "Could not allocate sbuf for name output.\n"); + return (ENOMEM); + } + + sbuf_cat(buf, "\n"); + // Assuming <= 255 elements in switch + sbuf_printf(buf, "# of elements: %d\n", sw_config->header.num_reported); + /* Exclude: + ** Revision -- all elements are revision 1 for now + */ + sbuf_printf(buf, + "SEID ( Name ) | Uplink | Downlink | Conn Type\n" + " | | | (uplink)\n"); + for (int i = 0; i < sw_config->header.num_reported; i++) { + // "%4d (%8s) | %8s %8s %#8x", + sbuf_printf(buf, "%4d", sw_config->element[i].seid); + sbuf_cat(buf, " "); + sbuf_printf(buf, "(%8s)", ixl_switch_element_string(nmbuf, sw_config->element[i].seid, false)); + sbuf_cat(buf, " | "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].uplink_seid, true)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%8s", ixl_switch_element_string(nmbuf, sw_config->element[i].downlink_seid, false)); + sbuf_cat(buf, " "); + sbuf_printf(buf, "%#8x", sw_config->element[i].connection_type); + if (i < sw_config->header.num_reported - 1) + sbuf_cat(buf, "\n"); + } + sbuf_delete(nmbuf); + + error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + sbuf_delete(buf); + return error; + } + + error = sysctl_handle_string(oidp, sbuf_data(buf), sbuf_len(buf), req); + if (error) + device_printf(dev, "sysctl error: %d\n", error); + sbuf_delete(buf); + + return (error); } /* Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Thu Nov 6 23:35:22 2014 (r274204) +++ head/sys/dev/ixl/if_ixlv.c Thu Nov 6 23:45:05 2014 (r274205) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.1.4"; +char ixlv_driver_version[] = "1.1.18"; /********************************************************************* * PCI Device ID Table @@ -87,7 +87,6 @@ static void ixlv_config_rss(struct ixlv_ static void ixlv_stop(struct ixlv_sc *); static void ixlv_add_multi(struct ixl_vsi *); static void ixlv_del_multi(struct ixl_vsi *); -static void ixlv_update_link_status(struct ixlv_sc *); static void ixlv_free_queues(struct ixl_vsi *); static int ixlv_setup_interface(device_t, struct ixlv_sc *); @@ -97,18 +96,21 @@ static void ixlv_media_status(struct ifn static void ixlv_local_timer(void *); static int ixlv_add_mac_filter(struct ixlv_sc *, u8 *, u16); +static int ixlv_del_mac_filter(struct ixlv_sc *sc, u8 *macaddr); static void ixlv_init_filters(struct ixlv_sc *); static void ixlv_free_filters(struct ixlv_sc *); static void ixlv_msix_que(void *); static void ixlv_msix_adminq(void *); static void ixlv_do_adminq(void *, int); -static void ixlv_sched_aq(void *); +static void ixlv_do_adminq_locked(struct ixlv_sc *sc); static void ixlv_handle_que(void *, int); static int ixlv_reset(struct ixlv_sc *); static int ixlv_reset_complete(struct i40e_hw *); static void ixlv_set_queue_rx_itr(struct ixl_queue *); static void ixlv_set_queue_tx_itr(struct ixl_queue *); +static void ixl_init_cmd_complete(struct ixl_vc_cmd *, void *, + enum i40e_status_code); static void ixlv_enable_adminq_irq(struct i40e_hw *); static void ixlv_disable_adminq_irq(struct i40e_hw *); @@ -119,10 +121,16 @@ static void ixlv_setup_vlan_filters(stru static void ixlv_register_vlan(void *, struct ifnet *, u16); static void ixlv_unregister_vlan(void *, struct ifnet *, u16); +static void ixlv_init_hw(struct ixlv_sc *); +static int ixlv_setup_vc(struct ixlv_sc *); +static int ixlv_vf_config(struct ixlv_sc *); + static void ixlv_cap_txcsum_tso(struct ixl_vsi *, struct ifnet *, int); -static void ixlv_add_stats_sysctls(struct ixlv_sc *); +static void ixlv_add_sysctls(struct ixlv_sc *); +static int ixlv_sysctl_qtx_tail_handler(SYSCTL_HANDLER_ARGS); +static int ixlv_sysctl_qrx_tail_handler(SYSCTL_HANDLER_ARGS); /********************************************************************* * FreeBSD Device Interface Entry Points @@ -271,7 +279,7 @@ ixlv_attach(device_t dev) struct ixlv_sc *sc; struct i40e_hw *hw; struct ixl_vsi *vsi; - int bufsz, error = 0, retries = 0; + int error = 0; INIT_DBG_DEV(dev, "begin"); @@ -282,30 +290,18 @@ ixlv_attach(device_t dev) vsi = &sc->vsi; vsi->dev = dev; + /* Initialize hw struct */ + ixlv_init_hw(sc); + /* Allocate filter lists */ ixlv_init_filters(sc); /* Core Lock Init*/ mtx_init(&sc->mtx, device_get_nameunit(dev), "IXL SC Lock", MTX_DEF); - mtx_init(&sc->aq_task_mtx, device_get_nameunit(dev), - "IXL AQ Task Lock", MTX_DEF); - /* Set up the timer & aq watchdog callouts */ + /* Set up the timer callout */ callout_init_mtx(&sc->timer, &sc->mtx, 0); - callout_init_mtx(&sc->aq_task, &sc->aq_task_mtx, 0); - - /* Save off the information about this board */ - hw->vendor_id = pci_get_vendor(dev); - hw->device_id = pci_get_device(dev); - hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); - hw->subsystem_vendor_id = - pci_read_config(dev, PCIR_SUBVEND_0, 2); - hw->subsystem_device_id = - pci_read_config(dev, PCIR_SUBDEV_0, 2); - - hw->bus.device = pci_get_slot(dev); - hw->bus.func = pci_get_function(dev); /* Do PCI setup - map BAR0, etc */ if (ixlv_allocate_pci_resources(sc)) { @@ -333,50 +329,16 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF Device is ready for configuration"); - hw->aq.num_arq_entries = IXL_AQ_LEN; - hw->aq.num_asq_entries = IXL_AQ_LEN; - hw->aq.arq_buf_size = IXL_AQ_BUFSZ; - hw->aq.asq_buf_size = IXL_AQ_BUFSZ; - - error = i40e_init_adminq(hw); + error = ixlv_setup_vc(sc); if (error) { - device_printf(dev, "%s: init_adminq failed: %d\n", + device_printf(dev, "%s: Error setting up PF comms, %d\n", __func__, error); goto err_pci_res; } - INIT_DBG_DEV(dev, "Initialized Admin Queue"); - - error = ixlv_send_api_ver(sc); - if (error) { - device_printf(dev, "%s: unable to send to PF (%d)\n", - __func__, error); - goto err_aq; - } - - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_api_ver)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent API version message to PF"); - - /* Wait for API version msg to arrive */ - error = ixlv_verify_api_ver(sc); - if (error) { - device_printf(dev, - "%s: Unable to verify API version, error %d\n", - __func__, error); - goto err_aq; - } - INIT_DBG_DEV(dev, "PF API version verified"); + /* TODO: Figure out why MDD events occur when this reset is removed. */ /* Need API version before sending reset message */ error = ixlv_reset(sc); if (error) { @@ -387,49 +349,14 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "VF reset complete"); /* Ask for VF config from PF */ - error = ixlv_send_vf_config_msg(sc); + error = ixlv_vf_config(sc); if (error) { - device_printf(dev, - "%s: Unable to send VF config request, error %d\n", - __func__, error); - goto err_aq; - } - - retries = 0; - while (!i40e_asq_done(hw)) { - if (++retries > IXLV_AQ_MAX_ERR) { - device_printf(dev, "%s: Admin Queue timeout " - "(waiting for send_vf_config_msg)\n", __func__); - error = ENXIO; - goto err_aq; - } - i40e_msec_delay(10); - } - - INIT_DBG_DEV(dev, "Sent VF config message to PF"); - - bufsz = sizeof(struct i40e_virtchnl_vf_resource) + - (I40E_MAX_VF_VSI * sizeof(struct i40e_virtchnl_vsi_resource)); - sc->vf_res = malloc(bufsz, M_DEVBUF, M_NOWAIT); - if (!sc->vf_res) { - device_printf(dev, - "%s: Unable to allocate memory for VF configuration" - " message from PF\n", __func__); - error = ENOMEM; + device_printf(dev, "Error getting configuration from PF: %d\n", + error); goto err_aq; } - /* Check for VF config response */ - error = ixlv_get_vf_config(sc); - if (error) { - device_printf(dev, - "%s: Unable to get VF configuration from PF\n", - __func__); - error = EBUSY; - goto err_res_buf; - } - - INIT_DBG_DEV(dev, "Received valid VF config from PF"); + INIT_DBG_DEV(dev, "VF config from PF:"); INIT_DBG_DEV(dev, "VSIs %d, Queues %d, Max Vectors %d, Max MTU %d", sc->vf_res->num_vsis, sc->vf_res->num_queue_pairs, @@ -438,6 +365,7 @@ ixlv_attach(device_t dev) INIT_DBG_DEV(dev, "Offload flags: %#010x", sc->vf_res->vf_offload_flags); + // TODO: Move this into ixlv_vf_config? /* got VF config message back from PF, now we can parse it */ for (int i = 0; i < sc->vf_res->num_vsis; i++) { if (sc->vf_res->vsi_res[i].vsi_type == I40E_VSI_SRIOV) @@ -445,6 +373,7 @@ ixlv_attach(device_t dev) } if (!sc->vsi_res) { device_printf(dev, "%s: no LAN VSI found\n", __func__); + error = EIO; goto err_res_buf; } @@ -461,14 +390,13 @@ ixlv_attach(device_t dev) vsi->id = sc->vsi_res->vsi_id; vsi->back = (void *)sc; - - /* Link in this virtual environment is always 'up' */ vsi->link_up = TRUE; /* This allocates the memory and early settings */ if (ixlv_setup_queues(sc) != 0) { device_printf(dev, "%s: setup queues failed!\n", __func__); + error = EIO; goto out; } @@ -476,6 +404,7 @@ ixlv_attach(device_t dev) if (ixlv_setup_interface(dev, sc) != 0) { device_printf(dev, "%s: setup interface failed!\n", __func__); + error = EIO; goto out; } @@ -487,12 +416,9 @@ ixlv_attach(device_t dev) /* Start AdminQ taskqueue */ ixlv_init_taskqueue(sc); - /* Start the admin queue scheduler timer */ - callout_reset(&sc->aq_task, 2 * hz, ixlv_sched_aq, sc); - /* Initialize stats */ bzero(&sc->vsi.eth_stats, sizeof(struct i40e_eth_stats)); - ixlv_add_stats_sysctls(sc); + ixlv_add_sysctls(sc); /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, @@ -504,10 +430,10 @@ ixlv_attach(device_t dev) ixlv_enable_adminq_irq(hw); /* Set things up to run init */ - sc->aq_pending = 0; - sc->aq_required = 0; sc->init_state = IXLV_INIT_READY; + ixl_vc_init_mgr(sc, &sc->vc_mgr); + INIT_DBG_DEV(dev, "end"); return (error); @@ -521,7 +447,6 @@ err_pci_res: ixlv_free_pci_resources(sc); err_early: mtx_destroy(&sc->mtx); - mtx_destroy(&sc->aq_task_mtx); ixlv_free_filters(sc); INIT_DBG_DEV(dev, "end: error %d", error); return (error); @@ -542,7 +467,6 @@ ixlv_detach(device_t dev) { struct ixlv_sc *sc = device_get_softc(dev); struct ixl_vsi *vsi = &sc->vsi; - int retries = 0; INIT_DBG_DEV(dev, "begin"); @@ -554,23 +478,11 @@ ixlv_detach(device_t dev) } /* Stop driver */ + ether_ifdetach(vsi->ifp); if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { mtx_lock(&sc->mtx); ixlv_stop(sc); mtx_unlock(&sc->mtx); - - /* - ** Ensure queues are disabled before examining - ** admin queue state later in detach. - */ - while (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING - && ++retries < IXLV_AQ_MAX_ERR) { - i40e_msec_delay(10); - } -#ifdef IXL_DEBUG - if (retries >= IXLV_AQ_MAX_ERR) - device_printf(dev, "Issue disabling queues for detach\n"); -#endif } /* Unregister VLAN events */ @@ -579,37 +491,16 @@ ixlv_detach(device_t dev) if (vsi->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); - /* Stop AQ callout */ - callout_drain(&sc->aq_task); - callout_stop(&sc->aq_task); - -#ifdef IXL_DEBUG - /* Report on possible AQ failures */ - if (sc->aq_required || sc->aq_pending) { - device_printf(dev, "AQ status on detach:\n"); - device_printf(dev, "required : 0x%4b\n", sc->aq_required, - IXLV_FLAGS); - device_printf(dev, "pending : 0x%4b\n", sc->aq_pending, - IXLV_FLAGS); - device_printf(dev, "current_op: %d\n", sc->current_op); - } -#endif + /* Drain VC mgr */ + callout_drain(&sc->vc_mgr.callout); i40e_shutdown_adminq(&sc->hw); - while (taskqueue_cancel(sc->tq, &sc->aq_irq, NULL) != 0) - taskqueue_drain(sc->tq, &sc->aq_irq); taskqueue_free(sc->tq); - - /* force the state down */ - vsi->ifp->if_flags &= ~IFF_UP; - ether_ifdetach(vsi->ifp); if_free(vsi->ifp); - free(sc->vf_res, M_DEVBUF); ixlv_free_pci_resources(sc); ixlv_free_queues(vsi); mtx_destroy(&sc->mtx); - mtx_destroy(&sc->aq_task_mtx); ixlv_free_filters(sc); bus_generic_detach(dev); @@ -754,7 +645,7 @@ ixlv_ioctl(struct ifnet *ifp, u_long com if (avoid_reset) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - ixlv_init(sc); + ixlv_init(vsi); #ifdef INET if (!(ifp->if_flags & IFF_NOARP)) arp_ifinit(ifp, ifa); @@ -773,11 +664,10 @@ ixlv_ioctl(struct ifnet *ifp, u_long com } else { IOCTL_DBG_IF2(ifp, "mtu: %lu -> %d", ifp->if_mtu, ifr->ifr_mtu); // ERJ: Interestingly enough, these types don't match - ifp->if_mtu = ifr->ifr_mtu; + ifp->if_mtu = (u_long)ifr->ifr_mtu; vsi->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; - ixlv_init_locked(sc); } mtx_unlock(&sc->mtx); @@ -839,7 +729,7 @@ ixlv_ioctl(struct ifnet *ifp, u_long com if (mask & IFCAP_VLAN_HWTSO) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ixlv_init(sc); + ixlv_init(vsi); } VLAN_CAPABILITIES(ifp); @@ -869,6 +759,7 @@ ixlv_reinit_locked(struct ixlv_sc *sc) struct i40e_hw *hw = &sc->hw; struct ixl_vsi *vsi = &sc->vsi; struct ifnet *ifp = vsi->ifp; + struct ixlv_mac_filter *mf, *mf_temp; struct ixlv_vlan_filter *vf; int error = 0; @@ -877,13 +768,25 @@ ixlv_reinit_locked(struct ixlv_sc *sc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) ixlv_stop(sc); - if ((sc->init_state == IXLV_RESET_REQUIRED) || - (sc->init_state == IXLV_RESET_PENDING)) - error = ixlv_reset(sc); + error = ixlv_reset(sc); + + INIT_DBG_IF(ifp, "VF was reset"); /* set the state in case we went thru RESET */ sc->init_state = IXLV_RUNNING; + /* + ** Resetting the VF drops all filters from hardware; + ** we need to mark them to be re-added in init. + */ + SLIST_FOREACH_SAFE(mf, sc->mac_filters, next, mf_temp) { + if (mf->flags & IXL_FILTER_DEL) { + SLIST_REMOVE(sc->mac_filters, mf, + ixlv_mac_filter, next); + free(mf, M_DEVBUF); + } else + mf->flags |= IXL_FILTER_ADD; + } if (vsi->num_vlans != 0) SLIST_FOREACH(vf, sc->vlan_filters, next) vf->flags = IXL_FILTER_ADD; @@ -896,13 +799,31 @@ ixlv_reinit_locked(struct ixlv_sc *sc) } ixlv_enable_adminq_irq(hw); - sc->aq_pending = 0; - sc->aq_required = 0; + ixl_vc_flush(&sc->vc_mgr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:10:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE030F37; Fri, 7 Nov 2014 00:10:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AEB2662; Fri, 7 Nov 2014 00:10:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA70A8RJ060298; Fri, 7 Nov 2014 00:10:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA70A8gF060295; Fri, 7 Nov 2014 00:10:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411070010.sA70A8gF060295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Nov 2014 00:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274206 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:10:08 -0000 Author: mav Date: Fri Nov 7 00:10:07 2014 New Revision: 274206 URL: https://svnweb.freebsd.org/changeset/base/274206 Log: Synchronize medium rotation rate in legacy Rigid Disk Drive Geometry mode page with modern Block Device Characteristics VPD page. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Nov 6 23:45:05 2014 (r274205) +++ head/sys/cam/ctl/ctl.c Fri Nov 7 00:10:07 2014 (r274206) @@ -4197,17 +4197,11 @@ ctl_init_page_index(struct ctl_lun *lun) * works out a fake geometry based on the capacity. */ memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_CURRENT], &rigid_disk_page_default, + CTL_PAGE_DEFAULT], &rigid_disk_page_default, sizeof(rigid_disk_page_default)); memcpy(&lun->mode_pages.rigid_disk_page[ CTL_PAGE_CHANGEABLE],&rigid_disk_page_changeable, sizeof(rigid_disk_page_changeable)); - memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_DEFAULT], &rigid_disk_page_default, - sizeof(rigid_disk_page_default)); - memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_SAVED], &rigid_disk_page_default, - sizeof(rigid_disk_page_default)); sectors_per_cylinder = CTL_DEFAULT_SECTORS_PER_TRACK * CTL_DEFAULT_HEADS; @@ -4244,16 +4238,21 @@ ctl_init_page_index(struct ctl_lun *lun) cylinders = 0xffffff; rigid_disk_page = &lun->mode_pages.rigid_disk_page[ - CTL_PAGE_CURRENT]; - scsi_ulto3b(cylinders, rigid_disk_page->cylinders); - - rigid_disk_page = &lun->mode_pages.rigid_disk_page[ CTL_PAGE_DEFAULT]; scsi_ulto3b(cylinders, rigid_disk_page->cylinders); - rigid_disk_page = &lun->mode_pages.rigid_disk_page[ - CTL_PAGE_SAVED]; - scsi_ulto3b(cylinders, rigid_disk_page->cylinders); + if ((value = ctl_get_opt(&lun->be_lun->options, + "rpm")) != NULL) { + scsi_ulto2b(strtol(value, NULL, 0), + rigid_disk_page->rotation_rate); + } + + memcpy(&lun->mode_pages.rigid_disk_page[CTL_PAGE_CURRENT], + &lun->mode_pages.rigid_disk_page[CTL_PAGE_DEFAULT], + sizeof(rigid_disk_page_default)); + memcpy(&lun->mode_pages.rigid_disk_page[CTL_PAGE_SAVED], + &lun->mode_pages.rigid_disk_page[CTL_PAGE_DEFAULT], + sizeof(rigid_disk_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.rigid_disk_page; @@ -10413,7 +10412,7 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) i = strtol(value, NULL, 0); else - i = SVPD_NON_ROTATING; + i = CTL_DEFAULT_ROTATION_RATE; scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); if (lun != NULL && (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Thu Nov 6 23:45:05 2014 (r274205) +++ head/sys/cam/ctl/ctl_private.h Fri Nov 7 00:10:07 2014 (r274206) @@ -271,7 +271,7 @@ union ctl_softcs { #define CTL_DEFAULT_SECTORS_PER_TRACK 256 #define CTL_DEFAULT_HEADS 128 -#define CTL_DEFAULT_ROTATION_RATE 10000 +#define CTL_DEFAULT_ROTATION_RATE SVPD_NON_ROTATING struct ctl_page_index; From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:11:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B5D711D; Fri, 7 Nov 2014 00:11:16 +0000 (UTC) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id DF872676; Fri, 7 Nov 2014 00:11:15 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 913CA7300A; Fri, 7 Nov 2014 01:15:07 +0100 (CET) Date: Fri, 7 Nov 2014 01:15:07 +0100 From: Luigi Rizzo To: "Alexander V. Chernikov" Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe Message-ID: <20141107001507.GD17502@onelab2.iet.unipi.it> References: <201410150122.s9F1Mudu083306@svn.freebsd.org> <545B55FA.6070408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <545B55FA.6070408@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:11:16 -0000 On Thu, Nov 06, 2014 at 03:05:30PM +0400, Alexander V. Chernikov wrote: > On 15.10.2014 05:22, Adrian Chadd wrote: > > Author: adrian > > Date: Wed Oct 15 01:22:56 2014 > > New Revision: 273112 > > URL: https://svnweb.freebsd.org/changeset/base/273112 > > > > Log: > > Set the DROP_EN bit before the RX queue is brought up and active. > > > > He noticed issues setting this bit in SRRCTL after the queue was up, > > so doing it from the sysctl handler isn't enough and may not actually > > work correctly. > While investigating/measuring ixgbe performance w/ and without flow control > I noticed that disabling fc entirely (e.g. disabling 512K skid buffer > and turning drop_en on) > not only makes things a bit worse, but also makes NIC stop accounting > tail-drops as errors > at all. > It is a bit unhandy with HW counters, since you, for example, see 2M > packets being received > in netstat, but in reality system receives only 1M (And there is no easy > way to determine exact > count). i'd like to point out that the default does not change (flow control is still enabled by default) and the previous handling of DROP_EN was ineffective. One may argue that FC and DROP_EN should be set independently, and i am all for it. In fact that would be the right thing to do in terms of POLA. This said, i do not understand what kind of performance degradation you experienced, can you be more specific ? cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:20:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B202A42D; Fri, 7 Nov 2014 00:20:44 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 323207CE; Fri, 7 Nov 2014 00:20:43 +0000 (UTC) Received: from secured.by.ipfw.ru ([95.143.220.47] helo=[10.0.0.120]) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XmTHa-000GZn-3K; Fri, 07 Nov 2014 00:03:50 +0400 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r273112 - head/sys/dev/ixgbe From: "Alexander V. Chernikov" In-Reply-To: <20141107001507.GD17502@onelab2.iet.unipi.it> Date: Fri, 7 Nov 2014 03:20:39 +0300 Message-Id: <67A66ECA-2550-4ABE-8405-8EC332FB84DA@ipfw.ru> References: <201410150122.s9F1Mudu083306@svn.freebsd.org> <545B55FA.6070408@FreeBSD.org> <20141107001507.GD17502@onelab2.iet.unipi.it> To: Luigi Rizzo X-Mailer: Apple Mail (2.1990.1) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, "Alexander V. Chernikov" , svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:20:44 -0000 > On 07 Nov 2014, at 03:15, Luigi Rizzo wrote: >=20 > On Thu, Nov 06, 2014 at 03:05:30PM +0400, Alexander V. Chernikov = wrote: >> On 15.10.2014 05:22, Adrian Chadd wrote: >>> Author: adrian >>> Date: Wed Oct 15 01:22:56 2014 >>> New Revision: 273112 >>> URL: https://svnweb.freebsd.org/changeset/base/273112 >>>=20 >>> Log: >>> Set the DROP_EN bit before the RX queue is brought up and active. >>>=20 >>> He noticed issues setting this bit in SRRCTL after the queue was = up, >>> so doing it from the sysctl handler isn't enough and may not = actually >>> work correctly. >> While investigating/measuring ixgbe performance w/ and without flow = control >> I noticed that disabling fc entirely (e.g. disabling 512K skid buffer=20= >> and turning drop_en on) >> not only makes things a bit worse, but also makes NIC stop accounting=20= >> tail-drops as errors >> at all. >> It is a bit unhandy with HW counters, since you, for example, see 2M=20= >> packets being received >> in netstat, but in reality system receives only 1M (And there is no = easy=20 >> way to determine exact >> count). >=20 > i'd like to point out that the default does not change (flow control > is still enabled by default) and the previous handling of DROP_EN The default did change: now drop_en is turned on by default due to a = small mistake (see my comment to commit). > was ineffective. >=20 > One may argue that FC and DROP_EN should be set independently, > and i am all for it. In fact that would be the right thing to do > in terms of POLA. >=20 > This said, i do not understand what kind of performance degradation > you experienced, can you be more specific ? Well, I haven=E2=80=99t tested it in great details, but for my = traditional shooting (IPv4 200 dsts to single rte) I observed some = notable change, like 9.2->8.6 MPPS or similar. I=E2=80=99m not insisting that something = should be done about it, since there is no silver bullet here. My point was that we=E2=80=99ve lost an ability to count ingress errors = in stock HEAD. >=20 > cheers > luigi From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:56:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0174CF2F; Fri, 7 Nov 2014 00:56:13 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CF24EBCE; Fri, 7 Nov 2014 00:56:13 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sA70uCik084303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 6 Nov 2014 16:56:12 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sA70uB1d084302; Thu, 6 Nov 2014 16:56:11 -0800 (PST) (envelope-from sgk) Date: Thu, 6 Nov 2014 16:56:11 -0800 From: Steve Kargl To: NGie Cooper Subject: Re: svn commit: r274203 - head Message-ID: <20141107005611.GA84277@troutmask.apl.washington.edu> References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Devin Teske , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:56:14 -0000 On Thu, Nov 06, 2014 at 03:19:19PM -0800, NGie Cooper wrote: > On Thu, Nov 6, 2014 at 3:06 PM, wrote: > > > >> -----Original Message----- > >> From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] > >> Sent: Thursday, November 6, 2014 3:05 PM > >> To: Devin Teske > >> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > >> head@freebsd.org > >> Subject: Re: svn commit: r274203 - head > >> > >> On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: > >> > Author: dteske > >> > Date: Thu Nov 6 22:53:50 2014 > >> > New Revision: 274203 > >> > URL: https://svnweb.freebsd.org/changeset/base/274203 > >> > > >> > Log: > >> > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. > >> > Add to using _prebuild_libs in (top-level) Makefile.inc1. > >> > NB: Unbreak build yet again (we'll get this right eventually) > >> > >> Any chance that you can test your changes before committing? > >> > > > > I don't have a -CURRENT box; and -CURRENT is giving different results. > > freefall's a pretty good build box for starters potentially (just > point MAKEOBJDIRPREFIX to $HOME/obj) > > The real problem is that there's some build tiering that's taking > place between different portions of the build, and depending on when > and how things get done, things can go awry. > Yes, things can sometimes go awry. But, getting a daily email (if not more than one a day) from jenkins-admin is verging on spam (i.e., a procmail rule to send these messages to /dev/null). And to be clear, I'm not picking specifically on Devin. Jenkins seems to be upset with a few other committers, too. -- Steve From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:58:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D30211C; Fri, 7 Nov 2014 00:58:58 +0000 (UTC) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 995E4BEF; Fri, 7 Nov 2014 00:58:57 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id w7so1875589lbi.31 for ; Thu, 06 Nov 2014 16:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GVSBrSKYIi2Nfg7g4hQ+6pyYAxSCY0MFci1ySZdI9IQ=; b=L4T0Vts3H2H5PS2pgcq718mxAW0/ZcFsjgS5rOk2WMBhx1O2HwbWLT4VA89o4ttIZA elcUWGQ6T2ROSGvhqTTHuC1avPLBrY1boVpkkjlXJ/3e4wvYQJQblxtrg355qw+tbw1K 8OjjumckR8g4mzjpzI0KJH7N6ZwU24yqtw0ZjZmUA6MP4WRaq4y4IL6i+mtsX3y4WeLy gnomIGDShwd1FoM90Zy/Q914cZaoPz8yq71SYmTI0ceryiFu2cXDhIi6A5LeQYuYE8kA qgzAUuyjAQitg/oNRlpa6uhVCAJYuA36kA4ySKP6l+VY+K/+TQMRrgy57uqUGTvpEeL3 /C5Q== MIME-Version: 1.0 X-Received: by 10.152.27.97 with SMTP id s1mr8055694lag.55.1415321935723; Thu, 06 Nov 2014 16:58:55 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Thu, 6 Nov 2014 16:58:55 -0800 (PST) In-Reply-To: <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> Date: Thu, 6 Nov 2014 16:58:55 -0800 X-Google-Sender-Auth: dAgswqt8a5M5H5fn64de3M9lamY Message-ID: Subject: Re: svn commit: r274203 - head From: Craig Rodrigues To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:58:58 -0000 On Thu, Nov 6, 2014 at 3:06 PM, wrote: > > I don't have a -CURRENT box; and -CURRENT is giving different results. > > Then use one of the CURRENT machines listed here: https://www.freebsd.org/internal/machines.html -- Craig From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 00:59:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DAB4265; Fri, 7 Nov 2014 00:59:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69F73BFB; Fri, 7 Nov 2014 00:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA70xfHV081767; Fri, 7 Nov 2014 00:59:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA70xfPi081766; Fri, 7 Nov 2014 00:59:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201411070059.sA70xfPi081766@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 7 Nov 2014 00:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274209 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 00:59:41 -0000 Author: dteske Date: Fri Nov 7 00:59:40 2014 New Revision: 274209 URL: https://svnweb.freebsd.org/changeset/base/274209 Log: For really fast machines, an edge-case may exist where dpv(3) may be built before contrib dependency, dialog(3). Add dialog(3) to the list of _prebuild_libs to ensure that this does not happen. Tested on: 11.0-CURRENT amd64 @ r274205 Thanks to: kargl, Larry Rosenman , ngie, markj Recommended by: ngie Reviewed by: ngie, markj MFC after: 21 days X-MFC-to: stable/10 stable/9 X-MFC-with: 274116 274120 274121 274123 274144 274146 274192 274203 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 7 00:29:00 2014 (r274208) +++ head/Makefile.inc1 Fri Nov 7 00:59:40 2014 (r274209) @@ -1552,7 +1552,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libctf} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} + ${_secure_lib_libssh} ${_secure_lib_libssl} \ + gnu/lib/libdialog .if ${MK_GNUCXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L @@ -1670,6 +1671,8 @@ _lib_libypclnt= lib/libypclnt lib/libradius__L: lib/libmd__L .endif +gnu/lib/libdialog__L: lib/ncurses/ncursesw__L + .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 01:32:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6C0CB9DE; Fri, 7 Nov 2014 01:32:58 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52EDFFE2; Fri, 7 Nov 2014 01:32:58 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:61854 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XmLTp-0006Hf-Lk; Thu, 06 Nov 2014 03:43:57 -0800 From: To: "'Steve Kargl'" , "'NGie Cooper'" References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> <20141107005611.GA84277@troutmask.apl.washington.edu> In-Reply-To: <20141107005611.GA84277@troutmask.apl.washington.edu> Subject: RE: svn commit: r274203 - head Date: Thu, 6 Nov 2014 17:32:56 -0800 Message-ID: <0b1d01cffa2a$c26086b0$47219410$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJ7dnudjVNpxU8ewRYQ1gE7quwK8gHgKpJyAOuoD6kBzICW6gFbDnowms3MXlA= Content-Language: en-us Sender: devin@shxd.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, 'Devin Teske' , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 01:32:58 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of Steve Kargl > Sent: Thursday, November 6, 2014 4:56 PM > To: NGie Cooper > Cc: Devin Teske; src-committers@freebsd.org; svn-src-all@freebsd.org; svn- > src-head@freebsd.org > Subject: Re: svn commit: r274203 - head > > On Thu, Nov 06, 2014 at 03:19:19PM -0800, NGie Cooper wrote: > > On Thu, Nov 6, 2014 at 3:06 PM, wrote: > > > > > >> -----Original Message----- > > >> From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] > > >> Sent: Thursday, November 6, 2014 3:05 PM > > >> To: Devin Teske > > >> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > > >> head@freebsd.org > > >> Subject: Re: svn commit: r274203 - head > > >> > > >> On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: > > >> > Author: dteske > > >> > Date: Thu Nov 6 22:53:50 2014 > > >> > New Revision: 274203 > > >> > URL: https://svnweb.freebsd.org/changeset/base/274203 > > >> > > > >> > Log: > > >> > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for me. > > >> > Add to using _prebuild_libs in (top-level) Makefile.inc1. > > >> > NB: Unbreak build yet again (we'll get this right eventually) > > >> > > >> Any chance that you can test your changes before committing? > > >> > > > > > > I don't have a -CURRENT box; and -CURRENT is giving different results. > > > > freefall's a pretty good build box for starters potentially (just > > point MAKEOBJDIRPREFIX to $HOME/obj) > > > > The real problem is that there's some build tiering that's taking > > place between different portions of the build, and depending on when > > and how things get done, things can go awry. > > > > Yes, things can sometimes go awry. But, getting a daily email (if > not more than one a day) from jenkins-admin is verging on spam > (i.e., a procmail rule to send these messages to /dev/null). > > And to be clear, I'm not picking specifically on Devin. Jenkins > seems to be upset with a few other committers, too. > Ugh; I fixed *my* build issue, but yeah... the build appears to still be broken. This time appears to not be related to anything I've done. --- rescue.all__D --- echo "int _crunched_cat_stub(int argc, char **argv, char **envp){return main(argc,argv,envp);}" >cat_stub.c make[5]: make[5]: don't know how to make /home/dteske/obj/home/dteske/src/freebsd_svn/base/head/rescue/rescue//home/d teske/src/freebsd_svn/base/head/bin/cat/cat.o. Stop make[5]: stopped in /home/dteske/obj/home/dteske/src/freebsd_svn/base/head/rescue/rescue *** [rescue] Error code 2 -- Devin From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 01:36:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13BF5B6F; Fri, 7 Nov 2014 01:36:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 003DA71; Fri, 7 Nov 2014 01:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA71aKq9000272; Fri, 7 Nov 2014 01:36:20 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA71aKJm000271; Fri, 7 Nov 2014 01:36:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411070136.sA71aKJm000271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Nov 2014 01:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274210 - head/usr.bin/wc 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 01:36:21 -0000 Author: marcel Date: Fri Nov 7 01:36:20 2014 New Revision: 274210 URL: https://svnweb.freebsd.org/changeset/base/274210 Log: Fix a SIGSEGV when emitting XML or JSON when reading stdin. In that case the file variable is NULL. Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Fri Nov 7 00:59:40 2014 (r274209) +++ head/usr.bin/wc/wc.c Fri Nov 7 01:36:20 2014 (r274210) @@ -164,8 +164,6 @@ show_cnt(const char *file, uintmax_t lin siginfo = 0; } - xo_emit("{ek:filename/%s}", file); - if (doline) xo_emit_h(xop, " {:lines/%7ju/%ju}", linect); if (doword) @@ -175,7 +173,7 @@ show_cnt(const char *file, uintmax_t lin if (dolongline) xo_emit_h(xop, " {:long-lines/%7ju/%ju}", llct); if (file != NULL) - xo_emit_h(xop, " {d:filename/%s}\n", file); + xo_emit_h(xop, " {:filename/%s}\n", file); else xo_emit_h(xop, "\n"); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 01:46:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4AEAEAA; Fri, 7 Nov 2014 01:46:12 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C2A61CD; Fri, 7 Nov 2014 01:46:12 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:61973 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XmLgd-0006Qf-1E; Thu, 06 Nov 2014 03:57:12 -0800 From: To: , "'Steve Kargl'" , "'NGie Cooper'" References: <201411062253.sA6Mro6t023294@svn.freebsd.org> <20141106230509.GA83754@troutmask.apl.washington.edu> <0ab001cffa16$3cab7d90$b60278b0$@FreeBSD.org> <20141107005611.GA84277@troutmask.apl.washington.edu> <0b1d01cffa2a$c26086b0$47219410$@FreeBSD.org> In-Reply-To: <0b1d01cffa2a$c26086b0$47219410$@FreeBSD.org> Subject: RE: svn commit: r274203 - head Date: Thu, 6 Nov 2014 17:46:03 -0800 Message-ID: <0b1f01cffa2c$9b267e90$d1737bb0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQJ7dnudjVNpxU8ewRYQ1gE7quwK8gHgKpJyAOuoD6kBzICW6gFbDnowAZTIPVGawSpSEA== Content-Language: en-us Sender: devin@shxd.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 01:46:12 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of dteske@FreeBSD.org > Sent: Thursday, November 6, 2014 5:33 PM > To: 'Steve Kargl'; 'NGie Cooper' > Cc: 'Devin Teske'; src-committers@freebsd.org; svn-src-all@freebsd.org; > svn-src-head@freebsd.org > Subject: RE: svn commit: r274203 - head > > > > > -----Original Message----- > > From: owner-src-committers@freebsd.org [mailto:owner-src- > > committers@freebsd.org] On Behalf Of Steve Kargl > > Sent: Thursday, November 6, 2014 4:56 PM > > To: NGie Cooper > > Cc: Devin Teske; src-committers@freebsd.org; svn-src-all@freebsd.org; > svn- > > src-head@freebsd.org > > Subject: Re: svn commit: r274203 - head > > > > On Thu, Nov 06, 2014 at 03:19:19PM -0800, NGie Cooper wrote: > > > On Thu, Nov 6, 2014 at 3:06 PM, wrote: > > > > > > > >> -----Original Message----- > > > >> From: Steve Kargl [mailto:sgk@troutmask.apl.washington.edu] > > > >> Sent: Thursday, November 6, 2014 3:05 PM > > > >> To: Devin Teske > > > >> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > > > >> head@freebsd.org > > > >> Subject: Re: svn commit: r274203 - head > > > >> > > > >> On Thu, Nov 06, 2014 at 10:53:50PM +0000, Devin Teske wrote: > > > >> > Author: dteske > > > >> > Date: Thu Nov 6 22:53:50 2014 > > > >> > New Revision: 274203 > > > >> > URL: https://svnweb.freebsd.org/changeset/base/274203 > > > >> > > > > >> > Log: > > > >> > SUBDIR_DEPENDS__ in lib/Makefile is not working out so well for > me. > > > >> > Add to using _prebuild_libs in (top-level) Makefile.inc1. > > > >> > NB: Unbreak build yet again (we'll get this right eventually) > > > >> > > > >> Any chance that you can test your changes before committing? > > > >> > > > > > > > > I don't have a -CURRENT box; and -CURRENT is giving different results. > > > > > > freefall's a pretty good build box for starters potentially (just > > > point MAKEOBJDIRPREFIX to $HOME/obj) > > > > > > The real problem is that there's some build tiering that's taking > > > place between different portions of the build, and depending on when > > > and how things get done, things can go awry. > > > > > > > Yes, things can sometimes go awry. But, getting a daily email (if > > not more than one a day) from jenkins-admin is verging on spam > > (i.e., a procmail rule to send these messages to /dev/null). > > > > And to be clear, I'm not picking specifically on Devin. Jenkins > > seems to be upset with a few other committers, too. > > > > Ugh; I fixed *my* build issue, but yeah... the build appears to still > be broken. This time appears to not be related to anything I've done. > > --- rescue.all__D --- > echo "int _crunched_cat_stub(int argc, char **argv, char **envp){return > main(argc,argv,envp);}" >cat_stub.c > make[5]: make[5]: don't know how to make > /home/dteske/obj/home/dteske/src/freebsd_svn/base/head/rescue/rescu > e//home/d > teske/src/freebsd_svn/base/head/bin/cat/cat.o. Stop > > make[5]: stopped in > /home/dteske/obj/home/dteske/src/freebsd_svn/base/head/rescue/rescu > e > *** [rescue] Error code 2 > -- > Devin > Command I used was: time make -j10 SRCCONF=/dev/null MAKEOBJDIRPREFIX=$HOME/obj buildworld It took 32m49s to get to the error. Here's the hardware: CPU: Intel(R) Xeon(R) CPU E5410 @ 2.33GHz (2327.55-MHz K8-class CPU) real memory = 68719476736 (65536 MB) avail memory = 65626365952 (62586 MB) FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs -- Devin From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 01:54:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7B66254; Fri, 7 Nov 2014 01:54:42 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A22072EA; Fri, 7 Nov 2014 01:54:42 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:62144 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XmLoq-0006Um-SU; Thu, 06 Nov 2014 04:05:42 -0800 From: "Devin Teske" To: "'Jack F Vogel'" , , , References: <201411062345.sA6Nj55a047058@svn.freebsd.org> In-Reply-To: <201411062345.sA6Nj55a047058@svn.freebsd.org> Subject: RE: svn commit: r274205 - in head/sys: dev/ixl modules/ixlv Date: Thu, 6 Nov 2014 17:54:31 -0800 Message-ID: <0b2701cffa2d$caf63880$60e2a980$@shxd.cx> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQFODKUrGawE9rVOeoHpD8WC/toZN51YQdRQ Content-Language: en-us Cc: dteske@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 01:54:42 -0000 > -----Original Message----- > From: owner-src-committers@freebsd.org [mailto:owner-src- > committers@freebsd.org] On Behalf Of Jack F Vogel > Sent: Thursday, November 6, 2014 3:45 PM > To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- > head@freebsd.org > Subject: svn commit: r274205 - in head/sys: dev/ixl modules/ixlv >=20 > Author: jfv > Date: Thu Nov 6 23:45:05 2014 > New Revision: 274205 > URL: https://svnweb.freebsd.org/changeset/base/274205 >=20 > Log: > Update the Intel i40e drivers, ixl version 1.2.8, ixlv version = 1.1.18 > -Improved VF stability, thanks to changes from Ryan Stone, > and Juniper. > - RSS fixes in the ixlv driver > - link detection in the ixlv driver > - New sysctl's added in ixl and ixlv > - reset timeout increased for ixlv > - stability fixes in detach > - correct media reporting > - Coverity warnings fixed > - Many small bug fixes > - VF Makefile modified - nvm shared code needed > - remove unused sleep channels in ixlv_sc struct >=20 > Submitted by: Eric Joyner (committed by jfv) > MFC after: 1 week >=20 > Modified: > head/sys/dev/ixl/i40e_osdep.c > head/sys/dev/ixl/i40e_osdep.h > head/sys/dev/ixl/if_ixl.c > head/sys/dev/ixl/if_ixlv.c > head/sys/dev/ixl/ixl.h > head/sys/dev/ixl/ixl_txrx.c > head/sys/dev/ixl/ixlv.h > head/sys/dev/ixl/ixlvc.c > head/sys/modules/ixlv/Makefile >=20 [snip] It appears that Jenkins is currently unhappy with this commit: https://jenkins.freebsd.org/jenkins/view/FreeBSD_src_head/job/FreeBSD_HEA= D/lastBuild/console NB: Build #1787 =3D=3D=3D> kbdmux (depend) --- depend_subdir_ixlv --- mkdep: compile failed *** [.depend] Error code 1 make[4]: stopped in /builds/FreeBSD_HEAD/sys/modules/ixlv 1 error --=20 Devin From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 02:05:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41C3C537; Fri, 7 Nov 2014 02:05:40 +0000 (UTC) Received: from mail-pd0-x22e.google.com (mail-pd0-x22e.google.com [IPv6:2607:f8b0:400e:c02::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07E533F4; Fri, 7 Nov 2014 02:05:40 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id p10so2314325pdj.19 for ; Thu, 06 Nov 2014 18:05:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=BRaxa//wt79MuBSIeq0vAcJxGdEqKvsP+TeEpoBjrJM=; b=sLxRLzpso+eSATt+QHR+H0Xu/Bbj6TouKM//q3KHRqEWnttgDxdvl1KLmqBoh4kNOG 3wDGGABL7l4TWcX1CaKq5AOxZxrXNLvNdY7I7kgVMQXrle5VGOgrmXKOA+xuV/kC+rim Mb4zPIy+XnwbDNO6yLksrp1+5YATnmGzQ3zgLuW1F76sB+fYP1tY6fKeiBpHFS7Vw5JM 04MiVnu7kXPgziT6aS3WUU06lO6SKxHwyeRP/Of2jJ/bPI92J0uqRmTX+A2GFx2iYjur WswYttbgVzCmpQQ0XOOXQXxwof19kZKGTL9tejEcouBcefZtt2zpjLzggGdHEV1Vo4fo NbGg== X-Received: by 10.70.45.40 with SMTP id j8mr8732900pdm.130.1415325939562; Thu, 06 Nov 2014 18:05:39 -0800 (PST) Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by mx.google.com with ESMTPSA id f12sm7008518pdl.94.2014.11.06.18.05.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 18:05:38 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_27E07CD7-2819-416C-871E-CE8C2E382B7A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274205 - in head/sys: dev/ixl modules/ixlv From: Garrett Cooper In-Reply-To: <0b2701cffa2d$caf63880$60e2a980$@shxd.cx> Date: Thu, 6 Nov 2014 18:05:36 -0800 Message-Id: <3D277476-F94C-4166-9F23-2B13F9FD10B5@gmail.com> References: <201411062345.sA6Nj55a047058@svn.freebsd.org> <0b2701cffa2d$caf63880$60e2a980$@shxd.cx> To: Devin Teske X-Mailer: Apple Mail (2.1878.6) Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, dteske@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 02:05:40 -0000 --Apple-Mail=_27E07CD7-2819-416C-871E-CE8C2E382B7A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 6, 2014, at 17:54, Devin Teske wrote: >> -----Original Message----- >> From: owner-src-committers@freebsd.org [mailto:owner-src- >> committers@freebsd.org] On Behalf Of Jack F Vogel >> Sent: Thursday, November 6, 2014 3:45 PM >> To: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src- >> head@freebsd.org >> Subject: svn commit: r274205 - in head/sys: dev/ixl modules/ixlv >>=20 >> Author: jfv >> Date: Thu Nov 6 23:45:05 2014 >> New Revision: 274205 >> URL: https://svnweb.freebsd.org/changeset/base/274205 >>=20 >> Log: >> Update the Intel i40e drivers, ixl version 1.2.8, ixlv version = 1.1.18 >> -Improved VF stability, thanks to changes from Ryan Stone, >> and Juniper. >> - RSS fixes in the ixlv driver >> - link detection in the ixlv driver >> - New sysctl's added in ixl and ixlv >> - reset timeout increased for ixlv >> - stability fixes in detach >> - correct media reporting >> - Coverity warnings fixed >> - Many small bug fixes >> - VF Makefile modified - nvm shared code needed >> - remove unused sleep channels in ixlv_sc struct >>=20 >> Submitted by: Eric Joyner (committed by jfv) >> MFC after: 1 week >>=20 >> Modified: >> head/sys/dev/ixl/i40e_osdep.c >> head/sys/dev/ixl/i40e_osdep.h >> head/sys/dev/ixl/if_ixl.c >> head/sys/dev/ixl/if_ixlv.c >> head/sys/dev/ixl/ixl.h >> head/sys/dev/ixl/ixl_txrx.c >> head/sys/dev/ixl/ixlv.h >> head/sys/dev/ixl/ixlvc.c >> head/sys/modules/ixlv/Makefile >>=20 > [snip] >=20 > It appears that Jenkins is currently unhappy with this commit: > = https://jenkins.freebsd.org/jenkins/view/FreeBSD_src_head/job/FreeBSD_HEAD= /lastBuild/console > NB: Build #1787 >=20 > =3D=3D=3D> kbdmux (depend) > --- depend_subdir_ixlv --- > mkdep: compile failed > *** [.depend] Error code 1 >=20 > make[4]: stopped in /builds/FreeBSD_HEAD/sys/modules/ixlv > 1 error Looks like an ixlv header=92s missing. Was is svn add=92ed? Thanks! $ make depend machine -> /usr/src.svn/sys/i386/include x86 -> /usr/src.svn/sys/x86/include awk -f /usr/src.svn/sys/modules/ixlv/../../tools/makeobjops.awk = /usr/src.svn/sys/modules/ixlv/../../kern/device_if.m -h awk -f /usr/src.svn/sys/modules/ixlv/../../tools/makeobjops.awk = /usr/src.svn/sys/modules/ixlv/../../kern/bus_if.m -h awk -f /usr/src.svn/sys/modules/ixlv/../../tools/makeobjops.awk = /usr/src.svn/sys/modules/ixlv/../../dev/pci/pci_if.m -h :> opt_bdg.h rm -f .depend mkdep -f .depend -a -nostdinc -DSMP -D_KERNEL -DKLD_MODULE -I. = -I/usr/src.svn/sys/modules/ixlv/../.. = -I/usr/src.svn/sys/modules/ixlv/../../contrib/altq -std=3Diso9899:1999 = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/if_ixlv.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/ixlvc.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/ixl_txrx.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_osdep.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_common.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_nvm.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_adminq.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_lan_hmc.c = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/i40e_hmc.c In file included from = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/if_ixlv.c:38: /usr/src.svn/sys/modules/ixlv/../../dev/ixl/ixlv.h:39:10: fatal error: = 'ixlv_vc_mgr.h' file not found #include "ixlv_vc_mgr.h" ^ 1 error generated. In file included from = /usr/src.svn/sys/modules/ixlv/../../dev/ixl/ixlvc.c:42: /usr/src.svn/sys/modules/ixlv/../../dev/ixl/ixlv.h:39:10: fatal error: = 'ixlv_vc_mgr.h' file not found #include "ixlv_vc_mgr.h" ^ 1 error generated. mkdep: compile failed *** Error code 1 Stop. make: stopped in /usr/src.svn/sys/modules/ixlv $ find ../../ -name ixlv_vc_mgr.\* --Apple-Mail=_27E07CD7-2819-416C-871E-CE8C2E382B7A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJUXCjwAAoJEMZr5QU6S73eHkQH+gJtc/VJKapz99VYShEmb6VB Rtmbs5qBfOwpeWRCzSl1sGav3aet5aVsBKM9Cr9EAmf2DiSVhjTMSGpckTZcw6QS KL/KQiBhfT+bHX2esEtcwilDobAAystVnPdxdB3OTmrb8RQhUPNMdprYf58ApIhp 5te1dJg3eysJVmNLA28rmvVXUZxO6ATFeX3JfIaA/pzMf+LurnBDc9pNIZwd2UV0 7wKAFrmz47AinoW9/vpELNiMJQAKSKjPYYdzSRBYacFkHiM5tzqoftZiltejcgPl GikyCrRovEYgjGob8Ps8dp5PCaEfLLS4a43lt1mFGWjhJSlPumY4bn0A5z1ygks= =Yiqx -----END PGP SIGNATURE----- --Apple-Mail=_27E07CD7-2819-416C-871E-CE8C2E382B7A-- From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 03:03:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0F46B5A; Fri, 7 Nov 2014 03:03:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1E87BD1; Fri, 7 Nov 2014 03:03:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA733QsI042644; Fri, 7 Nov 2014 03:03:26 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA733QYY042642; Fri, 7 Nov 2014 03:03:26 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411070303.sA733QYY042642@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Nov 2014 03:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274213 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 03:03:27 -0000 Author: marcel Date: Fri Nov 7 03:03:25 2014 New Revision: 274213 URL: https://svnweb.freebsd.org/changeset/base/274213 Log: Convert to use libxo. Obtained from: Phil Shafer Sponsored by: Juniper Networks, Inc. Modified: head/bin/df/Makefile head/bin/df/df.c Modified: head/bin/df/Makefile ============================================================================== --- head/bin/df/Makefile Fri Nov 7 02:04:48 2014 (r274212) +++ head/bin/df/Makefile Fri Nov 7 03:03:25 2014 (r274213) @@ -9,7 +9,7 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBUTIL} ${LIBXO} +LDADD= -lutil -lxo .include Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Nov 7 02:04:48 2014 (r274212) +++ head/bin/df/df.c Fri Nov 7 03:03:25 2014 (r274213) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -82,7 +83,7 @@ static char *getmntpt(const char *); static int int64width(int64_t); static char *makenetvfslist(void); static void prthuman(const struct statfs *, int64_t); -static void prthumanval(int64_t); +static void prthumanval(const char *, int64_t); static intmax_t fsbtoblk(int64_t, uint64_t, u_long); static void prtstat(struct statfs *, struct maxwidths *); static size_t regetmntinfo(struct statfs **, long, const char **); @@ -119,6 +120,11 @@ main(int argc, char *argv[]) totalbuf.f_bsize = DEV_BSIZE; strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN); vfslist = NULL; + + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1) switch (ch) { case 'a': @@ -161,7 +167,7 @@ main(int argc, char *argv[]) break; case 'l': if (vfslist != NULL) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); vfslist = makevfslist(makenetvfslist()); lflag = 1; break; @@ -174,9 +180,9 @@ main(int argc, char *argv[]) break; case 't': if (lflag) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) - errx(1, "only one -t option may be specified"); + xo_errx(1, "only one -t option may be specified"); fstype = optarg; vfslist = makevfslist(optarg); break; @@ -202,16 +208,19 @@ main(int argc, char *argv[]) /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); mntsize = 0; /* continued in for loop below */ } + xo_open_container("storage-system-information"); + xo_open_list("filesystem"); + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; continue; } @@ -220,20 +229,20 @@ main(int argc, char *argv[]) mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { - warn("strdup failed"); + xo_warn("strdup failed"); rv = 1; continue; } mntpt = mkdtemp(mntpath); if (mntpt == NULL) { - warn("mkdtemp(\"%s\") failed", mntpath); + xo_warn("mkdtemp(\"%s\") failed", mntpath); rv = 1; free(mntpath); continue; } if (mount(fstype, mntpt, MNT_RDONLY, &mdev) != 0) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; (void)rmdir(mntpt); free(mntpath); @@ -244,7 +253,7 @@ main(int argc, char *argv[]) if (cflag) addstat(&totalbuf, &statfsbuf); } else { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; } (void)unmount(mntpt, 0); @@ -260,7 +269,7 @@ main(int argc, char *argv[]) * implement nflag here. */ if (statfs(mntpt, &statfsbuf) < 0) { - warn("%s", mntpt); + xo_warn("%s", mntpt); rv = 1; continue; } @@ -294,8 +303,14 @@ main(int argc, char *argv[]) for (i = 0; i < mntsize; i++) if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) prtstat(&mntbuf[i], &maxwidths); + + xo_close_list("filesystem"); + if (cflag) prtstat(&totalbuf, &maxwidths); + + xo_close_container("storage-system-information"); + xo_finish(); return (rv); } @@ -341,7 +356,7 @@ regetmntinfo(struct statfs **mntbufp, lo if (nflag || error < 0) if (i != j) { if (error < 0) - warnx("%s stats possibly stale", + xo_warnx("%s stats possibly stale", mntbuf[i].f_mntonname); mntbuf[j] = mntbuf[i]; } @@ -354,13 +369,13 @@ static void prthuman(const struct statfs *sfsp, int64_t used) { - prthumanval(sfsp->f_blocks * sfsp->f_bsize); - prthumanval(used * sfsp->f_bsize); - prthumanval(sfsp->f_bavail * sfsp->f_bsize); + prthumanval(" {:blocks/%6s}", sfsp->f_blocks * sfsp->f_bsize); + prthumanval(" {:used/%6s}", used * sfsp->f_bsize); + prthumanval(" {:available/%6s}", sfsp->f_bavail * sfsp->f_bsize); } static void -prthumanval(int64_t bytes) +prthumanval(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -372,14 +387,15 @@ prthumanval(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %6s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* * Print an inode count in "human-readable" format. */ static void -prthumanvalinode(int64_t bytes) +prthumanvalinode(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -389,7 +405,8 @@ prthumanvalinode(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %5s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* @@ -434,70 +451,77 @@ prtstat(struct statfs *sfsp, struct maxw mwp->used = imax(mwp->used, (int)strlen("Used")); mwp->avail = imax(mwp->avail, (int)strlen("Avail")); - (void)printf("%-*s", mwp->mntfrom, "Filesystem"); + xo_emit("{T:/%-*s}", mwp->mntfrom, "Filesystem"); if (Tflag) - (void)printf(" %-*s", mwp->fstype, "Type"); - (void)printf(" %*s %*s %*s Capacity", mwp->total, header, - mwp->used, "Used", mwp->avail, "Avail"); + xo_emit(" {T:/%-*s}", mwp->fstype, "Type"); + xo_emit(" {T:/%*s} {T:/%*s} {T:/%*s} Capacity", + mwp->total, header, + mwp->used, "Used", mwp->avail, "Avail"); if (iflag) { mwp->iused = imax(hflag ? 0 : mwp->iused, (int)strlen(" iused")); mwp->ifree = imax(hflag ? 0 : mwp->ifree, (int)strlen("ifree")); - (void)printf(" %*s %*s %%iused", + xo_emit(" {T:/%*s} {T:/%*s} {T:\%iused}", mwp->iused - 2, "iused", mwp->ifree, "ifree"); } - (void)printf(" Mounted on\n"); + xo_emit(" {T:Mounted on}\n"); } + + xo_open_instance("filesystem"); /* Check for 0 block size. Can this happen? */ if (sfsp->f_bsize == 0) { - warnx ("File system %s does not have a block size, assuming 512.", + xo_warnx ("File system %s does not have a block size, assuming 512.", sfsp->f_mntonname); sfsp->f_bsize = 512; } - (void)printf("%-*s", mwp->mntfrom, sfsp->f_mntfromname); + xo_emit("{tk:name/%-*s}", mwp->mntfrom, sfsp->f_mntfromname); if (Tflag) - (void)printf(" %-*s", mwp->fstype, sfsp->f_fstypename); + xo_emit(" {:type/%-*s}", mwp->fstype, sfsp->f_fstypename); used = sfsp->f_blocks - sfsp->f_bfree; availblks = sfsp->f_bavail + used; if (hflag) { prthuman(sfsp, used); } else { if (thousands) - format = " %*j'd %*j'd %*j'd"; + format = " {t:total-blocks/%*j'd} {t:used-blocks/%*j'd} " + "{t:available-blocks/%*j'd}"; else - format = " %*jd %*jd %*jd"; - (void)printf(format, + format = " {t:total-blocks/%*jd} {t:used-blocks/%*jd} " + "{t:available-blocks/%*jd}"; + xo_emit(format, mwp->total, fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize), mwp->used, fsbtoblk(used, sfsp->f_bsize, blocksize), mwp->avail, fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize)); } - (void)printf(" %5.0f%%", + xo_emit(" {:used-percent/%5.0f}{U:%%}", availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; if (hflag) { - (void)printf(" "); - prthumanvalinode(used); - prthumanvalinode(sfsp->f_ffree); + xo_emit(" "); + prthumanvalinode(" {:inodes-used/%5s}", used); + prthumanvalinode(" {:inodes-free/%5s}", sfsp->f_ffree); } else { if (thousands) - format = " %*j'd %*j'd"; + format = " {:inodes-used/%*j'd} {:inodes-free/%*j'd}"; else - format = " %*jd %*jd"; - (void)printf(format, mwp->iused, (intmax_t)used, + format = " {:inodes-used/%*jd} {:inodes-free/%*jd}"; + xo_emit(format, mwp->iused, (intmax_t)used, mwp->ifree, (intmax_t)sfsp->f_ffree); } - (void)printf(" %4.0f%% ", inodes == 0 ? 100.0 : - (double)used / (double)inodes * 100.0); + xo_emit(" {:inodes-used-percent/%4.0f}{U:%%} ", + inodes == 0 ? 100.0 : + (double)used / (double)inodes * 100.0); } else - (void)printf(" "); + xo_emit(" "); if (strncmp(sfsp->f_mntfromname, "total", MNAMELEN) != 0) - (void)printf(" %s", sfsp->f_mntonname); - (void)printf("\n"); + xo_emit(" {:mounted-on}", sfsp->f_mntonname); + xo_emit("\n"); + xo_close_instance("filesystem"); } static void @@ -564,7 +588,7 @@ static void usage(void) { - (void)fprintf(stderr, + xo_error( "usage: df [-b | -g | -H | -h | -k | -m | -P] [-acilnT] [-t type] [-,]\n" " [file | filesystem ...]\n"); exit(EX_USAGE); @@ -579,24 +603,24 @@ makenetvfslist(void) int cnt, i, maxvfsconf; if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); return (NULL); } xvfsp = malloc(buflen); if (xvfsp == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } keep_xvfsp = xvfsp; if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); free(keep_xvfsp); return (NULL); } maxvfsconf = buflen / sizeof(struct xvfsconf); if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(keep_xvfsp); return (NULL); } @@ -605,7 +629,7 @@ makenetvfslist(void) if (xvfsp->vfc_flags & VFCF_NETWORK) { listptr[cnt++] = strdup(xvfsp->vfc_name); if (listptr[cnt-1] == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); @@ -617,7 +641,7 @@ makenetvfslist(void) if (cnt == 0 || (str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { if (cnt > 0) - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 03:07:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A79A4D45; Fri, 7 Nov 2014 03:07:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93A97BF4; Fri, 7 Nov 2014 03:07:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA737BiG043159; Fri, 7 Nov 2014 03:07:11 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA737B5b043158; Fri, 7 Nov 2014 03:07:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411070307.sA737B5b043158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Nov 2014 03:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274214 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 03:07:11 -0000 Author: marcel Date: Fri Nov 7 03:07:10 2014 New Revision: 274214 URL: https://svnweb.freebsd.org/changeset/base/274214 Log: Document that df(1) supports libxo(3). Modified: head/bin/df/df.1 Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Fri Nov 7 03:03:25 2014 (r274213) +++ head/bin/df/df.1 Fri Nov 7 03:07:10 2014 (r274214) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd January 16, 2014 +.Dd November 6, 2014 .Dt DF 1 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nd display free disk space .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl b | g | H | h | k | m | P .Op Fl acilnT .Op Fl \&, @@ -193,7 +194,9 @@ If the value is outside, it will be set .Xr statfs 2 , .Xr getbsize 3 , .Xr getmntinfo 3 , +.Xr libxo 3 , .Xr localeconv 3 , +.Xr xo_parse_args 3 , .Xr fstab 5 , .Xr mount 8 , .Xr pstat 8 , From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 03:36:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F15D83FB; Fri, 7 Nov 2014 03:36:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3399E40; Fri, 7 Nov 2014 03:36:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA73aSMi057209; Fri, 7 Nov 2014 03:36:28 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA73aS3a057208; Fri, 7 Nov 2014 03:36:28 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411070336.sA73aS3a057208@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Fri, 7 Nov 2014 03:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274215 - head/sys/dev/virtio/console 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 03:36:29 -0000 Author: bryanv Date: Fri Nov 7 03:36:28 2014 New Revision: 274215 URL: https://svnweb.freebsd.org/changeset/base/274215 Log: Several minor changes to hopefully complete the VirtIO console driver - Support the KDB alt break sequence to enter the debugger, panic, reboot, etc. [1] - Provide emergency write feature description. Note that QEMU does not implement this feature. - Make the VTCON_FLAG_* defines sequential once again. - When the multiple port feature is not negotiated, query the rows and columns of the one console during the device attach when the size feature is negotiated. - Report failure to the device if hot plugging a port fails. - Acknowledge the console port event with an open event. This is required by the spec, but QEMU doesn't seem to care. Submitted by: Juniper [1] MFC after: 1 month Modified: head/sys/dev/virtio/console/virtio_console.c Modified: head/sys/dev/virtio/console/virtio_console.c ============================================================================== --- head/sys/dev/virtio/console/virtio_console.c Fri Nov 7 03:07:10 2014 (r274214) +++ head/sys/dev/virtio/console/virtio_console.c Fri Nov 7 03:36:28 2014 (r274215) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,6 +79,11 @@ struct vtcon_port { int vtcport_id; int vtcport_flags; #define VTCON_PORT_FLAG_GONE 0x01 +#define VTCON_PORT_FLAG_CONSOLE 0x02 + +#if defined(KDB) + int vtcport_alt_break_state; +#endif }; #define VTCON_PORT_LOCK(_port) mtx_lock(&(_port)->vtcport_mtx) @@ -94,17 +100,11 @@ struct vtcon_softc { device_t vtcon_dev; struct mtx vtcon_mtx; uint64_t vtcon_features; - uint32_t vtcon_flags; -#define VTCON_FLAG_DETACHED 0x0001 -#define VTCON_FLAG_SIZE 0x0010 -#define VTCON_FLAG_MULTIPORT 0x0020 - - struct task vtcon_ctrl_task; - struct virtqueue *vtcon_ctrl_rxvq; - struct virtqueue *vtcon_ctrl_txvq; - struct mtx vtcon_ctrl_tx_mtx; - uint32_t vtcon_max_ports; + uint32_t vtcon_flags; +#define VTCON_FLAG_DETACHED 0x01 +#define VTCON_FLAG_SIZE 0x02 +#define VTCON_FLAG_MULTIPORT 0x04 /* * Ports can be added and removed during runtime, but we have @@ -112,6 +112,11 @@ struct vtcon_softc { * indexed by the port ID. */ struct vtcon_softc_port *vtcon_ports; + + struct task vtcon_ctrl_task; + struct virtqueue *vtcon_ctrl_rxvq; + struct virtqueue *vtcon_ctrl_txvq; + struct mtx vtcon_ctrl_tx_mtx; }; #define VTCON_LOCK(_sc) mtx_lock(&(_sc)->vtcon_mtx) @@ -133,6 +138,7 @@ struct vtcon_softc { static struct virtio_feature_desc vtcon_feature_desc[] = { { VIRTIO_CONSOLE_F_SIZE, "ConsoleSize" }, { VIRTIO_CONSOLE_F_MULTIPORT, "MultiplePorts" }, + { VIRTIO_CONSOLE_F_EMERG_WRITE, "EmergencyWrite" }, { 0, NULL } }; @@ -331,10 +337,15 @@ vtcon_attach(device_t dev) if (sc->vtcon_flags & VTCON_FLAG_MULTIPORT) { TASK_INIT(&sc->vtcon_ctrl_task, 0, vtcon_ctrl_task_cb, sc); error = vtcon_ctrl_init(sc); - } else + if (error) + goto fail; + } else { error = vtcon_port_create(sc, 0); - if (error) - goto fail; + if (error) + goto fail; + if (sc->vtcon_flags & VTCON_FLAG_SIZE) + vtcon_port_update_console_size(sc); + } error = virtio_setup_intr(dev, INTR_TYPE_TTY); if (error) { @@ -703,6 +714,7 @@ vtcon_ctrl_port_add_event(struct vtcon_s if (error) { device_printf(dev, "%s: cannot create port %d: %d\n", __func__, id, error); + vtcon_ctrl_send_control(sc, id, VIRTIO_CONSOLE_PORT_READY, 0); return; } } @@ -735,9 +747,27 @@ vtcon_ctrl_port_remove_event(struct vtco static void vtcon_ctrl_port_console_event(struct vtcon_softc *sc, int id) { + device_t dev; + struct vtcon_softc_port *scport; + struct vtcon_port *port; + + dev = sc->vtcon_dev; + scport = &sc->vtcon_ports[id]; + + VTCON_LOCK(sc); + port = scport->vcsp_port; + if (port == NULL) { + VTCON_UNLOCK(sc); + device_printf(dev, "%s: console port %d, but does not exist\n", + __func__, id); + return; + } - device_printf(sc->vtcon_dev, "%s: port %d console event\n", - __func__, id); + VTCON_PORT_LOCK(port); + VTCON_UNLOCK(sc); + port->vtcport_flags |= VTCON_PORT_FLAG_CONSOLE; + vtcon_port_submit_event(port, VIRTIO_CONSOLE_PORT_OPEN, 1); + VTCON_PORT_UNLOCK(port); } static void @@ -1179,8 +1209,14 @@ again: deq = 0; while ((buf = virtqueue_dequeue(vq, &len)) != NULL) { - for (i = 0; i < len; i++) + for (i = 0; i < len; i++) { +#if defined(KDB) + if (port->vtcport_flags & VTCON_PORT_FLAG_CONSOLE) + kdb_alt_break(buf[i], + &port->vtcport_alt_break_state); +#endif ttydisc_rint(tp, buf[i], 0); + } vtcon_port_requeue_buf(port, buf); deq++; } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 04:11:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23E729CD; Fri, 7 Nov 2014 04:11:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E89E1C4; Fri, 7 Nov 2014 04:11:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA74Bhtl075417; Fri, 7 Nov 2014 04:11:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA74Bh95075416; Fri, 7 Nov 2014 04:11:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201411070411.sA74Bh95075416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 7 Nov 2014 04:11: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: r274216 - stable/10/usr.sbin/bsdinstall 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 04:11:44 -0000 Author: nwhitehorn Date: Fri Nov 7 04:11:43 2014 New Revision: 274216 URL: https://svnweb.freebsd.org/changeset/base/274216 Log: MFC r273922: Rewrite some of the disk setup documentation to be clearer and contain less obsolete information. Also move the entropy command down the list -- the list is ordered by likelihood of use rather than alphabetically. Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Nov 7 03:36:28 2014 (r274215) +++ stable/10/usr.sbin/bsdinstall/bsdinstall.8 Fri Nov 7 04:11:43 2014 (r274216) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2013 +.Dd October 31, 2014 .Dt BSDINSTALL 8 .Os .Sh NAME @@ -73,10 +73,6 @@ targets. .Bl -tag -width ".Cm jail Ar destination" .It Cm auto Run the standard interactive installation, including disk partitioning. -.It Cm entropy -Reads a small amount of data from -.Pa /dev/random -and stores it in a file in the new system's root directory. .It Cm jail Ar destination Sets up a new chroot system at .Pa destination , @@ -119,32 +115,28 @@ If is set, also configures the network interfaces of the current system to match. .It Cm autopart Provides the installer's interactive guided disk partitioner for single-disk -installations. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +installations. Defaults to UFS. .It Cm zfsboot -Provides the installer's -.Pq experimental -interactive/scriptable ZFS partitioner for multi-disk installations. +Provides an alternative ZFS-only automatic interactive disk partitioner. Creates a single .Ic zpool -with datasets and writes to the new system's -.Pa rc.conf , -.Pa loader.conf , +with separate datasets for +.Pa /tmp , +.Pa /usr , +.Pa /usr/home , +.Pa /usr/ports , +.Pa /usr/src , and -.Pa fstab . -Supports -.Xr geli 8 , -.Xr gnop 8 , -and many other features. +.Pa /var . +Optionally can set up +.Xr geli 8 +to encrypt the disk. .It Cm partedit -Provides the installer's interactive manual disk partitioner, with support -for multi disk setups, non-UFS file systems, and manual selection of -partition schemes. Partitions disks, runs -.Xr newfs 8 , -and writes the new system's -.Pa fstab . +Provides the installer's interactive manual disk partitioner with an interface +identical to +.Xr sade 8 . +Supports multiple disks as well as UFS, ZFS, and FAT file systems. ZFS +is set up with one pool and dataset per partition. .It Cm scriptedpart Ar parameters Sets up disks like .Cm autopart @@ -190,13 +182,19 @@ keyword causes the partition to take all .Ar type option chooses the .Xr gpart 8 -filesystem type (e.g. freebsd-ufs or freebsd-swap). +filesystem type (e.g. freebsd-ufs, freebsd-zfs, or freebsd-swap). The optional .Ar mount point argument sets where the created partition is to be mounted in the installed system. As an example, a typical invocation looks like: .Pp bsdinstall scriptedpart ada0 { 20G freebsd-ufs /, 4G freebsd-swap, 20G freebsd-ufs /var, auto freebsd-ufs /usr } +.Pp +A shorter invocation to use the default partitioning (as +.Cm autopart +would have used) on the same disk: +.Pp +bsdinstall scriptedpart ada0 .It Cm mount Mounts the file systems previously configured by .Cm autopart , @@ -235,6 +233,10 @@ Interactively sets the time, date, and t Queries the user for the system daemons to begin at system startup, writing the result into the new system's .Pa rc.conf . +.It Cm entropy +Reads a small amount of data from +.Pa /dev/random +and stores it in a file in the new system's root directory. .It Cm config Installs the configuration files destined for the new system (e.g. rc.conf fragments generated by @@ -346,14 +348,14 @@ which is passed to the .Cm scriptedpart target to control disk setup. Alternatively, +to use +.Cm zfsboot instead of -.Ev PARTITIONS , +.Cm partedit , the preamble can contain the variable .Ev ZFSBOOT_DATASETS -which is parsed by the -.Pq experimental -.Cm zfsboot -target to control ZFS datasets/options of the boot pool setup. +instead of +.Ev PARTITIONS . .Ss SETUP SCRIPT Following the preamble is an optional shell script, beginning with a #! declaration. This script will be run at the end of the installation process From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 04:16:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B11C4B3F; Fri, 7 Nov 2014 04:16:39 +0000 (UTC) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE231F2; Fri, 7 Nov 2014 04:16:39 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id gm9so3730351lab.19 for ; Thu, 06 Nov 2014 20:16:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=mRZL0HKYcoixhOUaQ2Qc+4CFwUrEadvNon8h0XkwZc0=; b=rkNwuhmnsdMo4FB32kCyxFSy8rOChnbeSa5/1a05R3MVmiSqbHDsKq8Ff3x5yCvlT8 K5SiHI9vidhlmLp+sedhT8XFdx/vPJSWk12ouyIh94giZMZYURMp1Ja+RrdGlTGxk210 yRiRCJEIz2t7ArpgiKTYYkYBcH8Y1COgmwAa85uGDAWEufpXjNrk9FXuBX6EBh5d+ezo CaCZJEq9dzKy66HHiQiDmyZfgLAcyWQUE6CFgkRr6ho4id1M3PVHK9Aaou0WrlnGk2CS YAaENnInYB6q0Qsw81NvBKhHNjmQpqJw6VPibqs6UKFHbC7B4nM9jiI3QnXWmvlFzkB1 RXQQ== MIME-Version: 1.0 X-Received: by 10.152.87.18 with SMTP id t18mr8986993laz.0.1415333797380; Thu, 06 Nov 2014 20:16:37 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.112.130.168 with HTTP; Thu, 6 Nov 2014 20:16:37 -0800 (PST) In-Reply-To: <201411070303.sA733QYY042642@svn.freebsd.org> References: <201411070303.sA733QYY042642@svn.freebsd.org> Date: Thu, 6 Nov 2014 20:16:37 -0800 X-Google-Sender-Auth: U99rIIrLYRhxM7I3OEaz_nUweok Message-ID: Subject: Re: svn commit: r274213 - head/bin/df From: Craig Rodrigues To: Marcel Moolenaar Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 04:16:39 -0000 On Thu, Nov 6, 2014 at 7:03 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Fri Nov 7 03:03:25 2014 > New Revision: 274213 > URL: https://svnweb.freebsd.org/changeset/base/274213 > > Log: > Convert to use libxo. > > Obtained from: Phil Shafer > Sponsored by: Juniper Networks, Inc. > > Modified: > head/bin/df/Makefile > head/bin/df/df.c > > Hi, I think you need to add the libxo to rescue, since I am now seeing this build failure: --- rescue.all__D --- df.lo: In function `_$$hide$$ df.lo main': (.text+0x8e): undefined reference to `xo_parse_args' df.lo: In function `_$$hide$$ df.lo main': (.text+0x216): undefined reference to `xo_errx' df.lo: In function `_$$hide$$ df.lo main': (.text+0x23e): undefined reference to `xo_warn' df.lo: In function `_$$hide$$ df.lo main': (.text+0x297): undefined reference to `xo_errx' -- Craig From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 04:39:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA49EF25; Fri, 7 Nov 2014 04:39:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6DAC3E7; Fri, 7 Nov 2014 04:39:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA74d1AS085541; Fri, 7 Nov 2014 04:39:01 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA74d12s085540; Fri, 7 Nov 2014 04:39:01 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411070439.sA74d12s085540@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Nov 2014 04:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274217 - head/rescue/rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 04:39:02 -0000 Author: marcel Date: Fri Nov 7 04:39:01 2014 New Revision: 274217 URL: https://svnweb.freebsd.org/changeset/base/274217 Log: Add libxo, now needed by df(1). Pointed out by: rodrigc@ (thanks!) Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri Nov 7 04:11:43 2014 (r274216) +++ head/rescue/rescue/Makefile Fri Nov 7 04:39:01 2014 (r274217) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil -lxo CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 04:40:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E28DEF; Fri, 7 Nov 2014 04:40:13 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 536313ED; Fri, 7 Nov 2014 04:40:12 +0000 (UTC) Received: from [172.29.12.189] ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id sA74eBJS087277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Nov 2014 20:40:12 -0800 (PST) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: svn commit: r274213 - head/bin/df From: Marcel Moolenaar In-Reply-To: Date: Thu, 6 Nov 2014 20:40:06 -0800 Content-Transfer-Encoding: 7bit Message-Id: <667C3768-B443-41C6-B327-ECA16191B91E@xcllnt.net> References: <201411070303.sA733QYY042642@svn.freebsd.org> To: Craig Rodrigues X-Mailer: Apple Mail (2.1990.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 04:40:13 -0000 > On Nov 6, 2014, at 8:16 PM, Craig Rodrigues wrote: > > I think you need to add the libxo to rescue, since I am > now seeing this build failure: Oops! Thanks for pointing it out. Should be fixed now... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 04:47:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CC4B34F; Fri, 7 Nov 2014 04:47:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DA46687; Fri, 7 Nov 2014 04:47:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA74llFx090142; Fri, 7 Nov 2014 04:47:47 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA74llfQ090141; Fri, 7 Nov 2014 04:47:47 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201411070447.sA74llfQ090141@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Fri, 7 Nov 2014 04:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274218 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 04:47:47 -0000 Author: jfv Date: Fri Nov 7 04:47:46 2014 New Revision: 274218 URL: https://svnweb.freebsd.org/changeset/base/274218 Log: Add header file missing from last commit. Submitted by: jfv MFC after: 1 week Added: head/sys/dev/ixl/ixlv_vc_mgr.h (contents, props changed) Added: head/sys/dev/ixl/ixlv_vc_mgr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ixl/ixlv_vc_mgr.h Fri Nov 7 04:47:46 2014 (r274218) @@ -0,0 +1,76 @@ +/****************************************************************************** + + Copyright (c) 2013-2014, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#ifndef _IXLV_VC_MGR_H_ +#define _IXLV_VC_MGR_H_ + +#include + +struct ixl_vc_cmd; + +typedef void ixl_vc_callback_t(struct ixl_vc_cmd *, void *, + enum i40e_status_code); + + +#define IXLV_VC_CMD_FLAG_BUSY 0x0001 + +struct ixl_vc_cmd +{ + uint32_t request; + uint32_t flags; + + ixl_vc_callback_t *callback; + void *arg; + + TAILQ_ENTRY(ixl_vc_cmd) next; +}; + +struct ixl_vc_mgr +{ + struct ixlv_sc *sc; + struct ixl_vc_cmd *current; + struct callout callout; + + TAILQ_HEAD(, ixl_vc_cmd) pending; +}; + +#define IXLV_VC_TIMEOUT (2 * hz) + +void ixl_vc_init_mgr(struct ixlv_sc *, struct ixl_vc_mgr *); +void ixl_vc_enqueue(struct ixl_vc_mgr *, struct ixl_vc_cmd *, + uint32_t, ixl_vc_callback_t *, void *); +void ixl_vc_flush(struct ixl_vc_mgr *mgr); + +#endif + From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 08:58:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CCB565B8; Fri, 7 Nov 2014 08:58:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B90EBF53; Fri, 7 Nov 2014 08:58:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA78w6un005145; Fri, 7 Nov 2014 08:58:06 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA78w6AH005144; Fri, 7 Nov 2014 08:58:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411070858.sA78w6AH005144@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Nov 2014 08:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274223 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 08:58:06 -0000 Author: glebius Date: Fri Nov 7 08:58:05 2014 New Revision: 274223 URL: https://svnweb.freebsd.org/changeset/base/274223 Log: Remove VNET_SYSCTL_ARG(). The generic sysctl(9) code handles that. Reviewed by: ae Sponsored by: Nginx, Inc. Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Fri Nov 7 06:37:20 2014 (r274222) +++ head/sys/netinet6/in6_proto.c Fri Nov 7 08:58:05 2014 (r274223) @@ -474,8 +474,6 @@ sysctl_ip6_temppltime(SYSCTL_HANDLER_ARG int error = 0; int old; - VNET_SYSCTL_ARG(req, arg1); - error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) return (error); @@ -495,8 +493,6 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARG int error = 0; int old; - VNET_SYSCTL_ARG(req, arg1); - error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) return (error); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 09:15:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D65699D; Fri, 7 Nov 2014 09:15:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00BA71A2; Fri, 7 Nov 2014 09:15:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA79Fdh4014238; Fri, 7 Nov 2014 09:15:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA79Fd5a014237; Fri, 7 Nov 2014 09:15:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411070915.sA79Fd5a014237@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Nov 2014 09:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274224 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 09:15:40 -0000 Author: glebius Date: Fri Nov 7 09:15:39 2014 New Revision: 274224 URL: https://svnweb.freebsd.org/changeset/base/274224 Log: Remove useless structure ifindex_entry. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Nov 7 08:58:05 2014 (r274223) +++ head/sys/net/if.c Fri Nov 7 09:15:39 2014 (r274224) @@ -99,10 +99,6 @@ #include #endif -struct ifindex_entry { - struct ifnet *ife_ifnet; -}; - SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -196,7 +192,7 @@ VNET_DEFINE(struct ifgrouphead, ifg_head static VNET_DEFINE(int, if_indexlim) = 8; /* Table of ifnet by index. */ -VNET_DEFINE(struct ifindex_entry *, ifindex_table); +VNET_DEFINE(struct ifnet **, ifindex_table); #define V_if_indexlim VNET(if_indexlim) #define V_ifindex_table VNET(ifindex_table) @@ -233,9 +229,9 @@ ifnet_byindex_locked(u_short idx) if (idx > V_if_index) return (NULL); - if (V_ifindex_table[idx].ife_ifnet == IFNET_HOLD) + if (V_ifindex_table[idx] == IFNET_HOLD) return (NULL); - return (V_ifindex_table[idx].ife_ifnet); + return (V_ifindex_table[idx]); } struct ifnet * @@ -282,7 +278,7 @@ retry: * next slot. */ for (idx = 1; idx <= V_if_index; idx++) { - if (V_ifindex_table[idx].ife_ifnet == NULL) + if (V_ifindex_table[idx] == NULL) break; } @@ -303,9 +299,9 @@ ifindex_free_locked(u_short idx) IFNET_WLOCK_ASSERT(); - V_ifindex_table[idx].ife_ifnet = NULL; + V_ifindex_table[idx] = NULL; while (V_if_index > 0 && - V_ifindex_table[V_if_index].ife_ifnet == NULL) + V_ifindex_table[V_if_index] == NULL) V_if_index--; } @@ -324,7 +320,7 @@ ifnet_setbyindex_locked(u_short idx, str IFNET_WLOCK_ASSERT(); - V_ifindex_table[idx].ife_ifnet = ifp; + V_ifindex_table[idx] = ifp; } static void @@ -402,7 +398,7 @@ if_grow(void) { int oldlim; u_int n; - struct ifindex_entry *e; + struct ifnet **e; IFNET_WLOCK_ASSERT(); oldlim = V_if_indexlim; From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 09:39:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EFDCEB9; Fri, 7 Nov 2014 09:39:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 393A23E2; Fri, 7 Nov 2014 09:39:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA79dEAR023885; Fri, 7 Nov 2014 09:39:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA79d6sC023844; Fri, 7 Nov 2014 09:39:06 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411070939.sA79d6sC023844@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Nov 2014 09:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274225 - in head/sys: net netinet netinet/cc netinet6 netipsec netpfil/ipfw netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 09:39:14 -0000 Author: glebius Date: Fri Nov 7 09:39:05 2014 New Revision: 274225 URL: https://svnweb.freebsd.org/changeset/base/274225 Log: Remove SYSCTL_VNET_* macros, and simply put CTLFLAG_VNET where needed. Sponsored by: Nginx, Inc. Modified: head/sys/net/bpf.c head/sys/net/flowtable.c head/sys/net/if_bridge.c head/sys/net/if_gif.c head/sys/net/if_mib.c head/sys/net/vnet.h head/sys/netinet/cc/cc.c head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_hd.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_vegas.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_gif.c head/sys/netinet/in_pcb.c head/sys/netinet/in_rmx.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_ipsec.c head/sys/netinet/ip_mroute.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/ip6_ipsec.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/scope6.c head/sys/netipsec/ipsec.c head/sys/netipsec/key.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_pfil.c head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/bpf.c Fri Nov 7 09:39:05 2014 (r274225) @@ -180,8 +180,8 @@ static SYSCTL_NODE(_net_bpf, OID_AUTO, s static VNET_DEFINE(int, bpf_optimize_writers) = 0; #define V_bpf_optimize_writers VNET(bpf_optimize_writers) -SYSCTL_VNET_INT(_net_bpf, OID_AUTO, optimize_writers, - CTLFLAG_RW, &VNET_NAME(bpf_optimize_writers), 0, +SYSCTL_INT(_net_bpf, OID_AUTO, optimize_writers, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(bpf_optimize_writers), 0, "Do not send packets until BPF program is set"); static d_open_t bpfopen; Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/flowtable.c Fri Nov 7 09:39:05 2014 (r274225) @@ -171,7 +171,7 @@ static VNET_DEFINE(int, flowtable_enable static SYSCTL_NODE(_net, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); SYSCTL_UMA_MAX(_net_flowtable, OID_AUTO, maxflows, CTLFLAG_RW, &flow_zone, "Maximum number of flows allowed"); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/if_bridge.c Fri Nov 7 09:39:05 2014 (r274225) @@ -406,8 +406,8 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, i static VNET_DEFINE(int, allow_llz_overlap) = 0; #define V_allow_llz_overlap VNET(allow_llz_overlap) -SYSCTL_VNET_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, - CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0, +SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, + CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0, "Allow overlap of link-local scope " "zones of a bridge interface and the member interfaces"); Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/if_gif.c Fri Nov 7 09:39:05 2014 (r274225) @@ -149,7 +149,7 @@ static SYSCTL_NODE(_net_link, IFT_GIF, g #endif static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; #define V_max_gif_nesting VNET(max_gif_nesting) -SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, +SYSCTL_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); /* @@ -163,8 +163,9 @@ static VNET_DEFINE(int, parallel_tunnels static VNET_DEFINE(int, parallel_tunnels) = 0; #endif #define V_parallel_tunnels VNET(parallel_tunnels) -SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, - &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); +SYSCTL_INT(_net_link_gif, OID_AUTO, parallel_tunnels, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, + "Allow parallel tunnels?"); /* copy from src/sys/net/if_ethersubr.c */ static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = Modified: head/sys/net/if_mib.c ============================================================================== --- head/sys/net/if_mib.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/if_mib.c Fri Nov 7 09:39:05 2014 (r274225) @@ -67,9 +67,9 @@ SYSCTL_DECL(_net_link_generic); static SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system, CTLFLAG_RW, 0, "Variables global to all interfaces"); -SYSCTL_VNET_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount, CTLFLAG_RD, - &VNET_NAME(if_index), 0, - "Number of configured interfaces"); +SYSCTL_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(if_index), 0, + "Number of configured interfaces"); static int sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */ Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/net/vnet.h Fri Nov 7 09:39:05 2014 (r274225) @@ -119,6 +119,7 @@ vnet_##name##_uninit(const void *unused) VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_PROTO_IFATTACHDOMAIN, \ SI_ORDER_ANY, vnet_ ## name ## _uninit, NULL) +#ifdef SYSCTL_OID #define SYSCTL_VNET_PCPUSTAT(parent, nbr, name, type, array, desc) \ static int \ array##_sysctl(SYSCTL_HANDLER_ARGS) \ @@ -132,8 +133,9 @@ array##_sysctl(SYSCTL_HANDLER_ARGS) sizeof(type) / sizeof(uint64_t)); \ return (SYSCTL_OUT(req, &s, sizeof(type))); \ } \ -SYSCTL_VNET_PROC(parent, nbr, name, CTLTYPE_OPAQUE | CTLFLAG_RW, NULL, \ - 0, array ## _sysctl, "I", desc) +SYSCTL_PROC(parent, nbr, name, CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW, \ + NULL, 0, array ## _sysctl, "I", desc) +#endif /* SYSCTL_OID */ #ifdef VIMAGE #include @@ -283,48 +285,6 @@ void vnet_data_copy(void *start, int si void vnet_data_free(void *start_arg, int size); /* - * Sysctl variants for vnet-virtualized global variables. Include - * to expose these definitions. - * - * Note: SYSCTL_PROC() handler functions will need to resolve pointer - * arguments themselves, if required. - */ -#ifdef SYSCTL_OID -#define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, sysctl_handle_int, "I", descr) -#define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ - fmt, descr) \ - CTASSERT(((access) & CTLTYPE) != 0); \ - SYSCTL_OID(parent, nbr, name, CTLFLAG_VNET|(access), ptr, arg, \ - handler, fmt, descr) -#define SYSCTL_VNET_OPAQUE(parent, nbr, name, access, ptr, len, fmt, \ - descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, len, \ - sysctl_handle_opaque, fmt, descr) -#define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_STRING|CTLFLAG_VNET|(access), \ - arg, len, sysctl_handle_string, "A", descr) -#define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ - sizeof(struct type), sysctl_handle_opaque, "S," #type, \ - descr) -#define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, sysctl_handle_int, "IU", descr) -#define VNET_SYSCTL_ARG(req, arg1) do { \ - if (arg1 != NULL) \ - arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base + \ - (uintptr_t)(arg1)); \ -} while (0) -#endif /* SYSCTL_OID */ - -/* * Virtual sysinit mechanism, allowing network stack components to declare * startup and shutdown methods to be run when virtual network stack * instances are created and destroyed. @@ -447,29 +407,6 @@ do { \ #define VNET(n) (n) /* - * When VIMAGE isn't compiled into the kernel, virtaulized SYSCTLs simply - * become normal SYSCTLs. - */ -#ifdef SYSCTL_OID -#define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) -#define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ - fmt, descr) \ - SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, \ - descr) -#define SYSCTL_VNET_OPAQUE(parent, nbr, name, access, ptr, len, fmt, \ - descr) \ - SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) -#define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) -#define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) -#define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) -#define VNET_SYSCTL_ARG(req, arg1) -#endif /* SYSCTL_OID */ - -/* * When VIMAGE isn't compiled into the kernel, VNET_SYSINIT/VNET_SYSUNINIT * map into normal sysinits, which have the same ordering properties. */ Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc.c Fri Nov 7 09:39:05 2014 (r274225) @@ -318,7 +318,8 @@ SYSINIT(cc, SI_SUB_PROTO_IFATTACHDOMAIN, SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW, NULL, "congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, CTLTYPE_STRING|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW, NULL, 0, cc_default_algo, "A", "default congestion control algorithm"); SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, CTLTYPE_STRING|CTLFLAG_RD, Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc_cdg.c Fri Nov 7 09:39:05 2014 (r274225) @@ -659,39 +659,39 @@ SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_ CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, "Current algorithm/implementation version number"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, - CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, "Increment the window increase factor alpha by 1 MSS segment every " "alpha_inc RTTs during congestion avoidance mode."); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, &cdg_beta_handler, "IU", "Delay-based window decrease factor as a percentage " "(on delay-based backoff, w = w * beta_delay / 100)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, &cdg_beta_handler, "IU", "Loss-based window decrease factor as a percentage " "(on loss-based backoff, w = w * beta_loss / 100)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, - &cdg_exp_backoff_scale_handler, "IU", +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(cdg_exp_backoff_scale), 2, &cdg_exp_backoff_scale_handler, "IU", "Scaling parameter for the probabilistic exponential backoff"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, - CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, "Number of samples used for moving average smoothing (0 = no smoothing)"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, - CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, "Number of consecutive delay-gradient based congestion episodes which will " "trigger loss based CC compatibility"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, - CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, "Number of consecutive delay-gradient based congestion episodes to hold " "the window backoff for loss based CC compatibility"); Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc_chd.c Fri Nov 7 09:39:05 2014 (r274225) @@ -471,24 +471,27 @@ SYSCTL_DECL(_net_inet_tcp_cc_chd); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, chd, CTLFLAG_RW, NULL, "CAIA Hamilton delay-based congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, loss_fair, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_loss_fair), 1, &chd_loss_fair_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, loss_fair, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_loss_fair), 1, &chd_loss_fair_handler, "IU", "Flag to enable shadow window functionality."); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, pmax, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_pmax), 5, &chd_pmax_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, pmax, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_pmax), 5, &chd_pmax_handler, "IU", "Per RTT maximum backoff probability as a percentage"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, queue_threshold, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_qthresh), 20, &chd_qthresh_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, queue_threshold, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_qthresh), 20, &chd_qthresh_handler, "IU", "Queueing congestion threshold in ticks"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_chd, OID_AUTO, queue_min, - CTLFLAG_RW, &VNET_NAME(chd_qmin), 5, +SYSCTL_UINT(_net_inet_tcp_cc_chd, OID_AUTO, queue_min, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(chd_qmin), 5, "Minimum queueing delay threshold in ticks"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_chd, OID_AUTO, use_max, - CTLFLAG_RW, &VNET_NAME(chd_use_max), 1, +SYSCTL_UINT(_net_inet_tcp_cc_chd, OID_AUTO, use_max, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(chd_use_max), 1, "Use the maximum RTT seen within the measurement period (RTT) " "as the basic delay measurement for the algorithm."); Modified: head/sys/netinet/cc/cc_hd.c ============================================================================== --- head/sys/netinet/cc/cc_hd.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc_hd.c Fri Nov 7 09:39:05 2014 (r274225) @@ -238,17 +238,18 @@ SYSCTL_DECL(_net_inet_tcp_cc_hd); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, hd, CTLFLAG_RW, NULL, "Hamilton delay-based congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_threshold, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_qthresh), 20, &hd_qthresh_handler, - "IU", "queueing congestion threshold (qth) in ticks"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_threshold, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qthresh), 20, + &hd_qthresh_handler, "IU", "queueing congestion threshold (qth) in ticks"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, pmax, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_pmax), 5, &hd_pmax_handler, - "IU", "per packet maximum backoff probability as a percentage"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, pmax, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_pmax), 5, + &hd_pmax_handler, "IU", + "per packet maximum backoff probability as a percentage"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_qmin), 5, &hd_qmin_handler, - "IU", "minimum queueing delay threshold (qmin) in ticks"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qmin), 5, + &hd_qmin_handler, "IU", "minimum queueing delay threshold (qmin) in ticks"); DECLARE_CC_MODULE(hd, &hd_cc_algo); MODULE_DEPEND(hd, ertt, 1, 1, 1); Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc_htcp.c Fri Nov 7 09:39:05 2014 (r274225) @@ -512,9 +512,11 @@ htcp_ssthresh_update(struct cc_var *ccv) SYSCTL_DECL(_net_inet_tcp_cc_htcp); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, htcp, CTLFLAG_RW, NULL, "H-TCP related settings"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, CTLFLAG_RW, - &VNET_NAME(htcp_adaptive_backoff), 0, "enable H-TCP adaptive backoff"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scaling, CTLFLAG_RW, - &VNET_NAME(htcp_rtt_scaling), 0, "enable H-TCP RTT scaling"); +SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(htcp_adaptive_backoff), 0, + "enable H-TCP adaptive backoff"); +SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scaling, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(htcp_rtt_scaling), 0, + "enable H-TCP RTT scaling"); DECLARE_CC_MODULE(htcp, &htcp_cc_algo); Modified: head/sys/netinet/cc/cc_vegas.c ============================================================================== --- head/sys/netinet/cc/cc_vegas.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/cc/cc_vegas.c Fri Nov 7 09:39:05 2014 (r274225) @@ -295,13 +295,15 @@ SYSCTL_DECL(_net_inet_tcp_cc_vegas); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, vegas, CTLFLAG_RW, NULL, "Vegas related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, alpha, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(vegas_alpha), 1, &vegas_alpha_handler, - "IU", "vegas alpha, specified as number of \"buffers\" (0 < alpha < beta)"); +SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, alpha, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(vegas_alpha), 1, &vegas_alpha_handler, "IU", + "vegas alpha, specified as number of \"buffers\" (0 < alpha < beta)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(vegas_beta), 3, &vegas_beta_handler, - "IU", "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); +SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(vegas_beta), 3, &vegas_beta_handler, "IU", + "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); DECLARE_CC_MODULE(vegas, &vegas_cc_algo); MODULE_DEPEND(vegas, ertt, 1, 1, 1); Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/if_ether.c Fri Nov 7 09:39:05 2014 (r274225) @@ -103,21 +103,21 @@ static VNET_DEFINE(int, arp_maxhold) = 1 #define V_arp_proxyall VNET(arp_proxyall) #define V_arp_maxhold VNET(arp_maxhold) -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, "ARP entry lifetime in seconds"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_maxtries), 0, "ARP resolution attempts before returning error"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_proxyall), 0, "Enable proxy ARP for all suitable requests"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_down), 0, "Incomplete ARP entry lifetime in seconds"); SYSCTL_VNET_PCPUSTAT(_net_link_ether_arp, OID_AUTO, stats, struct arpstat, arpstat, "ARP statistics (struct arpstat, net/if_arp.h)"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_maxhold), 0, "Number of packets to hold per ARP entry"); Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/igmp.c Fri Nov 7 09:39:05 2014 (r274225) @@ -249,32 +249,32 @@ static VNET_DEFINE(int, igmp_default_ver /* * Virtualized sysctls. */ -SYSCTL_VNET_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RW, +SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmpstat), igmpstat, ""); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_recvifkludge), 0, "Rewrite IGMPv1/v2 reports from 0.0.0.0 to contain subnet address"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, sendra, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, sendra, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_sendra), 0, "Send IP Router Alert option in IGMPv2/v3 messages"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, sendlocal, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, sendlocal, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_sendlocal), 0, "Send IGMP membership reports for 224.0.0.0/24 groups"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, v1enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, v1enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_v1enable), 0, "Enable backwards compatibility with IGMPv1"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, v2enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, v2enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_v2enable), 0, "Enable backwards compatibility with IGMPv2"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, legacysupp, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, legacysupp, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_legacysupp), 0, "Allow v1/v2 reports to suppress v3 group responses"); -SYSCTL_VNET_PROC(_net_inet_igmp, OID_AUTO, default_version, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_PROC(_net_inet_igmp, OID_AUTO, default_version, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &VNET_NAME(igmp_default_version), 0, sysctl_igmp_default_version, "I", "Default version of IGMP to run on each interface"); -SYSCTL_VNET_PROC(_net_inet_igmp, OID_AUTO, gsrdelay, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_PROC(_net_inet_igmp, OID_AUTO, gsrdelay, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &VNET_NAME(igmp_gsrdelay.tv_sec), 0, sysctl_igmp_gsr, "I", "Rate limit for IGMPv3 Group-and-Source queries in seconds"); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/in.c Fri Nov 7 09:39:05 2014 (r274225) @@ -76,7 +76,7 @@ static void in_purgemaddrs(struct ifnet static VNET_DEFINE(int, nosameprefix); #define V_nosameprefix VNET(nosameprefix) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nosameprefix), 0, "Refuse to create same prefixes on different interfaces"); Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/in_gif.c Fri Nov 7 09:39:05 2014 (r274225) @@ -85,7 +85,7 @@ struct protosw in_gif_protosw = { VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; #define V_ip_gif_ttl VNET(ip_gif_ttl) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gif_ttl), 0, ""); int Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/in_pcb.c Fri Nov 7 09:39:05 2014 (r274225) @@ -164,34 +164,38 @@ sysctl_net_ipport_check(SYSCTL_HANDLER_A static SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports"); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lowfirstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lowlastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, first, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_firstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, last, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_hifirstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_hilastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, reservedhigh, - CTLFLAG_RW|CTLFLAG_SECURE, &VNET_NAME(ipport_reservedhigh), 0, ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, reservedlow, +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lowfirstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lowlastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_firstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_hifirstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_hilastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, reservedhigh, + CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE, + &VNET_NAME(ipport_reservedhigh), 0, ""); +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, reservedlow, CTLFLAG_RW|CTLFLAG_SECURE, &VNET_NAME(ipport_reservedlow), 0, ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomized, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomized, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomized), 0, "Enable random port allocation"); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomcps, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomcps, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomcps), 0, "Maximum number of random port " "allocations before switching to a sequental one"); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomtime), 0, "Minimum time to keep sequental port " "allocation before switching to a random one"); Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/in_rmx.c Fri Nov 7 09:39:05 2014 (r274225) @@ -134,21 +134,21 @@ in_matroute(void *v_arg, struct radix_no static VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ #define V_rtq_reallyold VNET(rtq_reallyold) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_reallyold), 0, "Default expiration time on dynamically learned routes"); /* never automatically crank down to less */ static VNET_DEFINE(int, rtq_minreallyold) = 10; #define V_rtq_minreallyold VNET(rtq_minreallyold) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_minreallyold), 0, "Minimum time to attempt to hold onto dynamically learned routes"); /* 128 cached routes is "too many" */ static VNET_DEFINE(int, rtq_toomany) = 128; #define V_rtq_toomany VNET(rtq_toomany) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_toomany), 0, "Upper limit on dynamically learned routes"); Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_carp.c Fri Nov 7 09:39:05 2014 (r274225) @@ -216,18 +216,21 @@ static VNET_DEFINE(int, carp_ifdown_adj) static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_allow), 0, "Accept incoming CARP packets"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_log), 0, "CARP log level"); -SYSCTL_VNET_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_carp, OID_AUTO, demotion, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, 0, 0, carp_demote_adj_sysctl, "I", "Adjust demotion factor (skew of advskew)"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_senderr_adj), 0, "Send error demotion factor adjustment"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_ifdown_adj), 0, "Interface down demotion factor adjustment"); Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_fastfwd.c Fri Nov 7 09:39:05 2014 (r274225) @@ -111,7 +111,7 @@ __FBSDID("$FreeBSD$"); static VNET_DEFINE(int, ipfastforward_active); #define V_ipfastforward_active VNET(ipfastforward_active) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding"); static struct sockaddr_in * Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_icmp.c Fri Nov 7 09:39:05 2014 (r274225) @@ -82,13 +82,13 @@ __FBSDID("$FreeBSD$"); */ static VNET_DEFINE(int, icmplim) = 200; #define V_icmplim VNET(icmplim) -SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim), 0, "Maximum number of ICMP responses per second"); static VNET_DEFINE(int, icmplim_output) = 1; #define V_icmplim_output VNET(icmplim_output) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, "Enable logging of ICMP response rate limiting"); @@ -104,13 +104,13 @@ VNET_PCPUSTAT_SYSUNINIT(icmpstat); static VNET_DEFINE(int, icmpmaskrepl) = 0; #define V_icmpmaskrepl VNET(icmpmaskrepl) -SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskrepl), 0, "Reply to ICMP Address Mask Request packets."); static VNET_DEFINE(u_int, icmpmaskfake) = 0; #define V_icmpmaskfake VNET(icmpmaskfake) -SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_RW, +SYSCTL_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); @@ -118,25 +118,25 @@ VNET_DEFINE(int, drop_redirect) = 0; static VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); static VNET_DEFINE(char, reply_src[IFNAMSIZ]); #define V_reply_src VNET(reply_src) -SYSCTL_VNET_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, +SYSCTL_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(reply_src), IFNAMSIZ, "icmp reply source for non-local packets."); static VNET_DEFINE(int, icmp_rfi) = 0; #define V_icmp_rfi VNET(icmp_rfi) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp_rfi), 0, "ICMP reply from incoming interface for non-local packets"); static VNET_DEFINE(int, icmp_quotelen) = 8; #define V_icmp_quotelen VNET(icmp_quotelen) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp_quotelen), 0, "Number of bytes from original packet to quote in ICMP reply"); @@ -145,7 +145,7 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO */ static VNET_DEFINE(int, icmpbmcastecho) = 0; #define V_icmpbmcastecho VNET(icmpbmcastecho) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpbmcastecho), 0, ""); @@ -192,8 +192,8 @@ sysctl_net_icmp_drop_redir(SYSCTL_HANDLE return (error); } -SYSCTL_VNET_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, +SYSCTL_PROC(_net_inet_icmp, OID_AUTO, drop_redirect, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_net_icmp_drop_redir, "I", "Ignore ICMP redirects"); /* Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_input.c Fri Nov 7 09:39:05 2014 (r274225) @@ -94,30 +94,30 @@ RW_SYSINIT(in_ifaddr_lock, &in_ifaddr_lo VNET_DEFINE(int, rsvp_on); VNET_DEFINE(int, ipforwarding); -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ #define V_ipsendredirects VNET(ipsendredirects) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); static VNET_DEFINE(int, ip_keepfaith); #define V_ip_keepfaith VNET(ip_keepfaith) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_keepfaith), 0, "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); static VNET_DEFINE(int, ip_sendsourcequench); #define V_ip_sendsourcequench VNET(ip_sendsourcequench) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_sendsourcequench), 0, "Enable the transmission of source quench packets"); VNET_DEFINE(int, ip_do_randomid); -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_do_randomid), 0, "Assign random ip_id values"); @@ -136,7 +136,7 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, */ static VNET_DEFINE(int, ip_checkinterface); #define V_ip_checkinterface VNET(ip_checkinterface) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_checkinterface), 0, "Verify packet arrives on correct interface"); @@ -200,13 +200,13 @@ static VNET_DEFINE(int, maxnipq); /* Ad static VNET_DEFINE(int, nipq); /* Total # of reass queues */ #define V_maxnipq VNET(maxnipq) #define V_nipq VNET(nipq) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, +SYSCTL_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(nipq), 0, "Current number of IPv4 fragment reassembly queue entries"); static VNET_DEFINE(int, maxfragsperpacket); #define V_maxfragsperpacket VNET(maxfragsperpacket) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, "Maximum number of IPv4 fragments allowed per packet"); @@ -217,7 +217,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, m #ifdef IPSTEALTH VNET_DEFINE(int, ipstealth); -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipstealth), 0, "IP stealth mode, no TTL decrementation on forwarding"); #endif Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_ipsec.c Fri Nov 7 09:39:05 2014 (r274225) @@ -77,8 +77,8 @@ static VNET_DEFINE(int, ip4_ipsec_filter #define V_ip4_ipsec_filtertunnel VNET(ip4_ipsec_filtertunnel) SYSCTL_DECL(_net_inet_ipsec); -SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUTO, filtertunnel, - CTLFLAG_RW, &VNET_NAME(ip4_ipsec_filtertunnel), 0, +SYSCTL_INT(_net_inet_ipsec, OID_AUTO, filtertunnel, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ipsec_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); /* Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/ip_mroute.c Fri Nov 7 09:39:05 2014 (r274225) @@ -178,7 +178,7 @@ static VNET_DEFINE(vifi_t, numvifs); #define V_numvifs VNET(numvifs) static VNET_DEFINE(struct vif, viftable[MAXVIFS]); #define V_viftable VNET(viftable) -SYSCTL_VNET_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_RD, +SYSCTL_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]", "IPv4 Multicast Interfaces (struct vif[MAXVIFS], netinet/ip_mroute.h)"); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/raw_ip.c Fri Nov 7 09:39:05 2014 (r274225) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include VNET_DEFINE(int, ip_defttl) = IPDEFTTL; -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_defttl), 0, "Maximum TTL on IP packets"); Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/tcp_hostcache.c Fri Nov 7 09:39:05 2014 (r274225) @@ -122,31 +122,31 @@ static void tcp_hc_purge(void *); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0, "TCP Host cache"); -SYSCTL_VNET_UINT(_net_inet_tcp_hostcache, OID_AUTO, cachelimit, CTLFLAG_RDTUN, +SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, cachelimit, CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(tcp_hostcache.cache_limit), 0, "Overall entry limit for hostcache"); -SYSCTL_VNET_UINT(_net_inet_tcp_hostcache, OID_AUTO, hashsize, CTLFLAG_RDTUN, +SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(tcp_hostcache.hashsize), 0, "Size of TCP hostcache hashtable"); -SYSCTL_VNET_UINT(_net_inet_tcp_hostcache, OID_AUTO, bucketlimit, - CTLFLAG_RDTUN, &VNET_NAME(tcp_hostcache.bucket_limit), 0, +SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, bucketlimit, + CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(tcp_hostcache.bucket_limit), 0, "Per-bucket hash limit for hostcache"); -SYSCTL_VNET_UINT(_net_inet_tcp_hostcache, OID_AUTO, count, CTLFLAG_RD, +SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, count, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_hostcache.cache_count), 0, "Current number of entries in hostcache"); -SYSCTL_VNET_INT(_net_inet_tcp_hostcache, OID_AUTO, expire, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, expire, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_hostcache.expire), 0, "Expire time of TCP hostcache entries"); -SYSCTL_VNET_INT(_net_inet_tcp_hostcache, OID_AUTO, prune, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, prune, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_hostcache.prune), 0, "Time between purge runs"); -SYSCTL_VNET_INT(_net_inet_tcp_hostcache, OID_AUTO, purge, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, purge, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_hostcache.purgeall), 0, "Expire all entires on next purge run"); Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/tcp_input.c Fri Nov 7 09:39:05 2014 (r274225) @@ -130,29 +130,29 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_ VNET_DEFINE(int, blackhole) = 0; #define V_blackhole VNET(blackhole) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, blackhole, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, blackhole, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(blackhole), 0, "Do not send RST on segments to closed ports"); VNET_DEFINE(int, tcp_delack_enabled) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_delack_enabled), 0, "Delay ACK to try and piggyback it onto a data packet"); VNET_DEFINE(int, drop_synfin) = 0; #define V_drop_synfin VNET(drop_synfin) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); VNET_DEFINE(int, tcp_do_rfc3042) = 1; #define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3042), 0, "Enable RFC 3042 (Limited Transmit)"); VNET_DEFINE(int, tcp_do_rfc3390) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); @@ -160,64 +160,64 @@ SYSCTL_NODE(_net_inet_tcp, OID_AUTO, exp "Experimental TCP extensions"); VNET_DEFINE(int, tcp_do_initcwnd10) = 1; -SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_initcwnd10), 0, "Enable RFC 6928 (Increasing initial CWND to 10)"); VNET_DEFINE(int, tcp_do_rfc3465) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, "Enable RFC 3465 (Appropriate Byte Counting)"); VNET_DEFINE(int, tcp_abc_l_var) = 2; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, abc_l_var, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); VNET_DEFINE(int, tcp_do_ecn) = 0; -SYSCTL_VNET_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_ecn), 0, "TCP ECN support"); VNET_DEFINE(int, tcp_ecn_maxretries) = 1; -SYSCTL_VNET_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_ecn_maxretries), 0, "Max retries before giving up on ECN"); VNET_DEFINE(int, tcp_insecure_syn) = 0; #define V_tcp_insecure_syn VNET(tcp_insecure_syn) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_syn), 0, "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets"); VNET_DEFINE(int, tcp_insecure_rst) = 0; #define V_tcp_insecure_rst VNET(tcp_insecure_rst) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow RFC793 instead of RFC5961 criteria for accepting RST packets"); VNET_DEFINE(int, tcp_recvspace) = 1024*64; #define V_tcp_recvspace VNET(tcp_recvspace) -SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_inc), 0, "Incrementor step size of automatic receive buffer"); VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, "Max size of automatic receive buffer"); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/tcp_output.c Fri Nov 7 09:39:05 2014 (r274225) @@ -90,36 +90,36 @@ __FBSDID("$FreeBSD$"); #include VNET_DEFINE(int, path_mtu_discovery) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(path_mtu_discovery), 1, "Enable Path MTU Discovery"); VNET_DEFINE(int, tcp_do_tso) = 1; #define V_tcp_do_tso VNET(tcp_do_tso) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); VNET_DEFINE(int, tcp_sendspace) = 1024*32; #define V_tcp_sendspace VNET(tcp_sendspace) -SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size"); VNET_DEFINE(int, tcp_do_autosndbuf) = 1; #define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autosndbuf), 0, "Enable automatic send buffer sizing"); VNET_DEFINE(int, tcp_autosndbuf_inc) = 8*1024; #define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Fri Nov 7 09:15:39 2014 (r274224) +++ head/sys/netinet/tcp_sack.c Fri Nov 7 09:39:05 2014 (r274225) @@ -129,24 +129,24 @@ VNET_DECLARE(struct uma_zone *, sack_hol SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW, 0, "TCP SACK"); VNET_DEFINE(int, tcp_do_sack) = 1; #define V_tcp_do_sack VNET(tcp_do_sack) -SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_sack), 0, "Enable/Disable TCP SACK support"); VNET_DEFINE(int, tcp_sack_maxholes) = 128; #define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) -SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_maxholes), 0, "Maximum number of TCP SACK holes allowed per connection"); VNET_DEFINE(int, tcp_sack_globalmaxholes) = 65536; #define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) -SYSCTL_VNET_INT(_net_inet_tcp_sack, OID_AUTO, globalmaxholes, CTLFLAG_RW, +SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalmaxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_globalmaxholes), 0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 10:49:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8332F19; Fri, 7 Nov 2014 10:49:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4E60D5F; Fri, 7 Nov 2014 10:49:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7Anthb057709; Fri, 7 Nov 2014 10:49:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7AntTQ057708; Fri, 7 Nov 2014 10:49:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411071049.sA7AntTQ057708@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 7 Nov 2014 10:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274226 - head/gnu/lib/libdialog 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 10:49:55 -0000 Author: bapt Date: Fri Nov 7 10:49:54 2014 New Revision: 274226 URL: https://svnweb.freebsd.org/changeset/base/274226 Log: libdialog has to be linked to libncursesw and libm Modified: head/gnu/lib/libdialog/Makefile Modified: head/gnu/lib/libdialog/Makefile ============================================================================== --- head/gnu/lib/libdialog/Makefile Fri Nov 7 09:39:05 2014 (r274225) +++ head/gnu/lib/libdialog/Makefile Fri Nov 7 10:49:54 2014 (r274226) @@ -13,6 +13,9 @@ SRCS= argv.c arrows.c buildlist.c butto INCS= dialog.h dlg_colors.h dlg_config.h dlg_keys.h MAN= dialog.3 +DPADD= ${LIBNCURSESW} ${LIBM} +LDADD= -lncursesw -lm + CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused .PATH: ${DIALOG} WARNS?= 1 From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 11:04:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99870357; Fri, 7 Nov 2014 11:04:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8550AF38; Fri, 7 Nov 2014 11:04:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7B4SDp066642; Fri, 7 Nov 2014 11:04:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7B4SKp066640; Fri, 7 Nov 2014 11:04:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411071104.sA7B4SKp066640@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 7 Nov 2014 11:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274227 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 11:04:28 -0000 Author: hselasky Date: Fri Nov 7 11:04:27 2014 New Revision: 274227 URL: https://svnweb.freebsd.org/changeset/base/274227 Log: Add new USB IDs. Submitted by: G'abor Zahemszky MFC after: 1 week Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Nov 7 10:49:54 2014 (r274226) +++ head/sys/dev/usb/serial/u3g.c Fri Nov 7 11:04:27 2014 (r274227) @@ -470,6 +470,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, K3772_Z, 0), U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, MF195E, 0), + U3G_DEV(QUALCOMMINC, MF195E_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Nov 7 10:49:54 2014 (r274226) +++ head/sys/dev/usb/usbdevs Fri Nov 7 11:04:27 2014 (r274227) @@ -3642,6 +3642,8 @@ product QUALCOMMINC E0086 0x0086 3G mode product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z +product QUALCOMMINC MF195E_INIT 0x1514 MF195E initial +product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 11:34:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A96618F6; Fri, 7 Nov 2014 11:34:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95C54325; Fri, 7 Nov 2014 11:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7BY7Xk080633; Fri, 7 Nov 2014 11:34:07 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7BY7wZ080632; Fri, 7 Nov 2014 11:34:07 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201411071134.sA7BY7wZ080632@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 7 Nov 2014 11:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274228 - head/sys/dev/ixl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 11:34:07 -0000 Author: bz Date: Fri Nov 7 11:34:06 2014 New Revision: 274228 URL: https://svnweb.freebsd.org/changeset/base/274228 Log: After r274205 unbreak NOIP kernels. vsi is now also used outside address family specific blocks so move it out from under the condition. MFC after: 6 days X-MFC with: r274205 Modified: head/sys/dev/ixl/ixl_txrx.c Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Fri Nov 7 11:04:27 2014 (r274227) +++ head/sys/dev/ixl/ixl_txrx.c Fri Nov 7 11:34:06 2014 (r274228) @@ -1089,8 +1089,8 @@ int ixl_init_rx_ring(struct ixl_queue *que) { struct rx_ring *rxr = &que->rxr; -#if defined(INET6) || defined(INET) struct ixl_vsi *vsi = que->vsi; +#if defined(INET6) || defined(INET) struct ifnet *ifp = vsi->ifp; struct lro_ctrl *lro = &rxr->lro; #endif From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 12:05:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84126492; Fri, 7 Nov 2014 12:05:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70419905; Fri, 7 Nov 2014 12:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7C5LGj095654; Fri, 7 Nov 2014 12:05:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7C5LYn095653; Fri, 7 Nov 2014 12:05:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411071205.sA7C5LYn095653@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 7 Nov 2014 12:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274230 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 12:05:21 -0000 Author: ae Date: Fri Nov 7 12:05:20 2014 New Revision: 274230 URL: https://svnweb.freebsd.org/changeset/base/274230 Log: Pass mbuf to pfil processing before stripping outer IP header as it is described in if_enc(4). MFC after: 2 week Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec_input.c Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Fri Nov 7 12:00:32 2014 (r274229) +++ head/sys/netipsec/ipsec_input.c Fri Nov 7 12:05:20 2014 (r274230) @@ -379,15 +379,10 @@ ipsec4_common_input_cb(struct mbuf *m, s if_inc_counter(encif, IFCOUNTER_IPACKETS, 1); if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len); - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. - */ + /* Pass the mbuf to enc0 for bpf and pfil. */ ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE); - - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); #endif /* DEV_ENC */ /* IP-in-IP encapsulation */ @@ -683,16 +678,10 @@ ipsec6_common_input_cb(struct mbuf *m, s if_inc_counter(encif, IFCOUNTER_IPACKETS, 1); if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len); - /* - * Pass the mbuf to enc0 for bpf and pfil. We will filter the IPIP - * packet later after it has been decapsulated. - */ + /* Pass the mbuf to enc0 for bpf and pfil. */ ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE); - - /* XXX-BZ does not make sense. */ - if (prot != IPPROTO_IPIP) - if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) - return (error); + if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0) + return (error); #endif /* DEV_ENC */ #ifdef INET From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:14:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BA0D175; Fri, 7 Nov 2014 15:14:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0961A8; Fri, 7 Nov 2014 15:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FEDNB086809; Fri, 7 Nov 2014 15:14:13 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FEAcI086793; Fri, 7 Nov 2014 15:14:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411071514.sA7FEAcI086793@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 7 Nov 2014 15:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274231 - in head/sys: dev/hyperv/netvsc net netgraph 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:14:13 -0000 Author: glebius Date: Fri Nov 7 15:14:10 2014 New Revision: 274231 URL: https://svnweb.freebsd.org/changeset/base/274231 Log: Remove struct arpcom. It is unused by most interface types, that allocate it, except Ethernet, where it carried ng_ether(4) pointer. For now carry the pointer in if_l2com directly. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/net/if.c head/sys/net/if_arp.h head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_iso88025subr.c head/sys/netgraph/ng_ether.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Nov 7 15:14:10 2014 (r274231) @@ -529,7 +529,7 @@ hv_nv_connect_to_vsp(struct hv_device *d int ret = 0; device_t dev = device->device; hn_softc_t *sc = device_get_softc(dev); - struct ifnet *ifp = sc->arpcom.ac_ifp; + struct ifnet *ifp = sc->hn_ifp; net_dev = hv_nv_get_outbound_net_device(device); if (!net_dev) { Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Nov 7 15:14:10 2014 (r274231) @@ -965,7 +965,6 @@ typedef struct { */ typedef struct hn_softc { struct ifnet *hn_ifp; - struct arpcom arpcom; device_t hn_dev; uint8_t hn_unit; int hn_carrier; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 7 15:14:10 2014 (r274231) @@ -255,7 +255,7 @@ netvsc_attach(device_t dev) sc->hn_dev_obj = device_ctx; - ifp = sc->hn_ifp = sc->arpcom.ac_ifp = if_alloc(IFT_ETHER); + ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -634,8 +634,6 @@ netvsc_recv(struct hv_device *device_ctx } ifp = sc->hn_ifp; - - ifp = sc->arpcom.ac_ifp; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { return (0); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if.c Fri Nov 7 15:14:10 2014 (r274231) @@ -2136,7 +2136,7 @@ do_link_state_change(void *arg, int pend (*vlan_link_state_p)(ifp); if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) && - IFP2AC(ifp)->ac_netgraph != NULL) + ifp->if_l2com != NULL) (*ng_ether_link_state_p)(ifp, link_state); if (ifp->if_carp) (*carp_linkstate_p)(ifp); Modified: head/sys/net/if_arp.h ============================================================================== --- head/sys/net/if_arp.h Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if_arp.h Fri Nov 7 15:14:10 2014 (r274231) @@ -97,20 +97,6 @@ struct arpreq { #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ -#ifdef _KERNEL -/* - * Structure shared between the ethernet driver modules and - * the address resolution code. - */ -struct arpcom { - struct ifnet *ac_ifp; /* network-visible interface */ - void *ac_netgraph; /* ng_ether(4) netgraph node info */ -}; -#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com)) -#define AC2IFP(ac) ((ac)->ac_ifp) - -#endif /* _KERNEL */ - struct arpstat { /* Normal things that happen: */ uint64_t txrequests; /* # of ARP requests sent by this host. */ Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if_bridge.c Fri Nov 7 15:14:10 2014 (r274231) @@ -111,7 +111,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* for struct arpcom */ +#include #include #include #include @@ -125,7 +125,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include /* for struct arpcom */ +#include #include #include #include Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if_ethersubr.c Fri Nov 7 15:14:10 2014 (r274231) @@ -119,9 +119,6 @@ static int ether_resolvemulti(struct ifn static void ether_reassign(struct ifnet *, struct vnet *, char *); #endif -/* XXX: should be in an arp support file, not here */ -static MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals"); - #define ETHER_IS_BROADCAST(addr) \ (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) @@ -330,7 +327,7 @@ ether_output(struct ifnet *ifp, struct m #endif /* Handle ng_ether(4) processing, if any */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_output_p != NULL, ("ng_ether_output_p is NULL")); if ((error = (*ng_ether_output_p)(ifp, &m)) != 0) { @@ -521,7 +518,7 @@ ether_input_internal(struct ifnet *ifp, M_SETFIB(m, ifp->if_fib); /* Allow ng_ether(4) to claim this frame. */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_input_p != NULL, ("%s: ng_ether_input_p is NULL", __func__)); m->m_flags &= ~M_PROMISC; @@ -780,7 +777,7 @@ discard: * hand the packet to it for last chance processing; * otherwise dispose of it. */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_input_orphan_p != NULL, ("ng_ether_input_orphan_p is NULL")); /* @@ -866,7 +863,7 @@ ether_ifdetach(struct ifnet *ifp) sdl = (struct sockaddr_dl *)(ifp->if_addr->ifa_addr); uuid_ether_del(LLADDR(sdl)); - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); (*ng_ether_detach_p)(ifp); @@ -881,7 +878,7 @@ void ether_reassign(struct ifnet *ifp, struct vnet *new_vnet, char *unused __unused) { - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); (*ng_ether_detach_p)(ifp); @@ -1092,46 +1089,8 @@ ether_resolvemulti(struct ifnet *ifp, st } } -static void* -ether_alloc(u_char type, struct ifnet *ifp) -{ - struct arpcom *ac; - - ac = malloc(sizeof(struct arpcom), M_ARPCOM, M_WAITOK | M_ZERO); - ac->ac_ifp = ifp; - - return (ac); -} - -static void -ether_free(void *com, u_char type) -{ - - free(com, M_ARPCOM); -} - -static int -ether_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - if_register_com_alloc(IFT_ETHER, ether_alloc, ether_free); - break; - case MOD_UNLOAD: - if_deregister_com_alloc(IFT_ETHER); - break; - default: - return EOPNOTSUPP; - } - - return (0); -} - static moduledata_t ether_mod = { - "ether", - ether_modevent, - 0 + .name = "ether", }; void Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if_fddisubr.c Fri Nov 7 15:14:10 2014 (r274231) @@ -92,7 +92,6 @@ static void fddi_input(struct ifnet *ifp * Encapsulate a packet of type family for the local net. * Use trailer local net encapsulation if enough data in first * packet leaves a multiple of 512 bytes of data in remainder. - * Assumes that ifp is actually pointer to arpcom structure. */ static int fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, Modified: head/sys/net/if_iso88025subr.c ============================================================================== --- head/sys/net/if_iso88025subr.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/net/if_iso88025subr.c Fri Nov 7 15:14:10 2014 (r274231) @@ -562,7 +562,6 @@ iso88025_input(ifp, m) case LLC_TEST_P: { struct sockaddr sa; - struct arpcom *ac; struct iso88025_sockaddr_data *th2; int i; u_char c; @@ -695,49 +694,8 @@ iso88025_resolvemulti (ifp, llsa, sa) return (0); } -static MALLOC_DEFINE(M_ISO88025, "arpcom", "802.5 interface internals"); - -static void* -iso88025_alloc(u_char type, struct ifnet *ifp) -{ - struct arpcom *ac; - - ac = malloc(sizeof(struct arpcom), M_ISO88025, M_WAITOK | M_ZERO); - ac->ac_ifp = ifp; - - return (ac); -} - -static void -iso88025_free(void *com, u_char type) -{ - - free(com, M_ISO88025); -} - -static int -iso88025_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - if_register_com_alloc(IFT_ISO88025, iso88025_alloc, - iso88025_free); - break; - case MOD_UNLOAD: - if_deregister_com_alloc(IFT_ISO88025); - break; - default: - return EOPNOTSUPP; - } - - return (0); -} - static moduledata_t iso88025_mod = { - "iso88025", - iso88025_modevent, - 0 + .name = "iso88025", }; DECLARE_MODULE(iso88025, iso88025_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Fri Nov 7 12:05:20 2014 (r274230) +++ head/sys/netgraph/ng_ether.c Fri Nov 7 15:14:10 2014 (r274231) @@ -74,7 +74,7 @@ MODULE_VERSION(ng_ether, 1); -#define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph) +#define IFP2NG(ifp) ((ifp)->if_l2com) /* Per-node private data */ struct private { From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:39:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84EDFD07; Fri, 7 Nov 2014 15:39:10 +0000 (UTC) Received: from mail-pd0-x233.google.com (mail-pd0-x233.google.com [IPv6:2607:f8b0:400e:c02::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5097864D; Fri, 7 Nov 2014 15:39:10 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id g10so3521344pdj.38 for ; Fri, 07 Nov 2014 07:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=6IOHvEhWzsbzqsrBtjIpAU/YQ9JpsA0IG+6w9XM4GLg=; b=XsmT8PQIxvJDpwR+tHXfIRA5iQNYlfUiShhUIIInzYKXYAFsMyxb2TlNx5dENe5/gZ mHa/rpaE3Bs7KDFd6Hi/Yp66feMgu2i1hav0O/bqNGNU55hVY/ALMRuR2IwywSuF8/6k UbxicL623gP+Nd4DKBXT1UsFoLoXQTALVvRQZdcAzK6u36+Iy3PUvXzobPPhhzGUtIj5 v2GcvoS0KBp/3McN5K1JtJWigvMV6k0KETHYBxAL1FYPxCZGAy1KbU3DppB6axRiLiRP xe//cusKYpOxLVjBQ25EzIf53iW6RfQ3niYuIGPYRygKta8TBuKTHsGP2SGOztbr1uE9 QBPg== X-Received: by 10.68.92.97 with SMTP id cl1mr12602465pbb.99.1415374749980; Fri, 07 Nov 2014 07:39:09 -0800 (PST) Received: from [192.168.20.11] (c-98-247-240-204.hsd1.wa.comcast.net. [98.247.240.204]) by mx.google.com with ESMTPSA id a13sm9031746pbu.77.2014.11.07.07.39.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 07:39:09 -0800 (PST) References: <201411071049.sA7AntTQ057708@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201411071049.sA7AntTQ057708@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <43BAFB93-7805-40A6-A5C8-78DACF8FA6A8@gmail.com> X-Mailer: iPhone Mail (12B411) From: Garrett Cooper Subject: Re: svn commit: r274226 - head/gnu/lib/libdialog Date: Fri, 7 Nov 2014 07:39:09 -0800 To: Baptiste Daroussin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:39:10 -0000 > On Nov 7, 2014, at 02:49, Baptiste Daroussin wrote: >=20 > Author: bapt > Date: Fri Nov 7 10:49:54 2014 > New Revision: 274226 > URL: https://svnweb.freebsd.org/changeset/base/274226 >=20 > Log: > libdialog has to be linked to libncursesw and libm Thank you for fixing these implicit dependencies. This is something that cam= e up as part of the libfigpar/libdpv discussion. The one thing that might ne= ed to be done is that the lib/msun dependency might need to be articulated i= n Makefile.inc1. Thanks!!= From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:40:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32531F20; Fri, 7 Nov 2014 15:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4B6666; Fri, 7 Nov 2014 15:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FeZ8S097346; Fri, 7 Nov 2014 15:40:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FeZiX097267; Fri, 7 Nov 2014 15:40:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071540.sA7FeZiX097267@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:40: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: r274232 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:40:36 -0000 Author: trasz Date: Fri Nov 7 15:40:34 2014 New Revision: 274232 URL: https://svnweb.freebsd.org/changeset/base/274232 Log: MFC r272403: Make autofs timeout handling use timeout task instead of callout; that's because the handler can sleep on sx lock. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:40:34 2014 (r274232) @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -260,7 +261,7 @@ autofs_path(struct autofs_node *anp) } static void -autofs_callout(void *context) +autofs_task(void *context, int pending) { struct autofs_request *ar; @@ -414,9 +415,14 @@ autofs_trigger_one(struct autofs_node *a strlcpy(ar->ar_options, amp->am_options, sizeof(ar->ar_options)); - callout_init(&ar->ar_callout, 1); - callout_reset(&ar->ar_callout, - autofs_timeout * hz, autofs_callout, ar); + TIMEOUT_TASK_INIT(taskqueue_thread, &ar->ar_task, 0, + autofs_task, ar); + error = taskqueue_enqueue_timeout(taskqueue_thread, + &ar->ar_task, autofs_timeout * hz); + if (error != 0) { + AUTOFS_WARN("taskqueue_enqueue_timeout() failed " + "with error %d", error); + } refcount_init(&ar->ar_refcount, 1); TAILQ_INSERT_TAIL(&autofs_softc->sc_requests, ar, ar_next); } @@ -456,7 +462,8 @@ autofs_trigger_one(struct autofs_node *a * XXX: Is it safe? */ sx_xunlock(&autofs_softc->sc_lock); - callout_drain(&ar->ar_callout); + taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); + taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); } Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:40:34 2014 (r274232) @@ -97,7 +97,7 @@ struct autofs_request { char ar_prefix[MAXPATHLEN]; char ar_key[MAXPATHLEN]; char ar_options[MAXPATHLEN]; - struct callout ar_callout; + struct timeout_task ar_task; volatile u_int ar_refcount; }; Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:40:34 2014 (r274232) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:14:10 2014 (r274231) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:40:34 2014 (r274232) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:42:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 799791D3; Fri, 7 Nov 2014 15:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6510D765; Fri, 7 Nov 2014 15:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FgCOX001030; Fri, 7 Nov 2014 15:42:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FgCqU001029; Fri, 7 Nov 2014 15:42:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071542.sA7FgCqU001029@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:42: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: r274233 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:42:12 -0000 Author: trasz Date: Fri Nov 7 15:42:11 2014 New Revision: 274233 URL: https://svnweb.freebsd.org/changeset/base/274233 Log: MFC r272405: Call uma_zfree() outside of lock, and improve comment. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:40:34 2014 (r274232) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:42:11 2014 (r274233) @@ -459,13 +459,13 @@ autofs_trigger_one(struct autofs_node *a if (last) { TAILQ_REMOVE(&autofs_softc->sc_requests, ar, ar_next); /* - * XXX: Is it safe? + * Unlock the sc_lock, so that autofs_task() can complete. */ sx_xunlock(&autofs_softc->sc_lock); taskqueue_cancel_timeout(taskqueue_thread, &ar->ar_task, NULL); taskqueue_drain_timeout(taskqueue_thread, &ar->ar_task); - sx_xlock(&autofs_softc->sc_lock); uma_zfree(autofs_request_zone, ar); + sx_xlock(&autofs_softc->sc_lock); } /* From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:44:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 327AD37B; Fri, 7 Nov 2014 15:44:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1400F782; Fri, 7 Nov 2014 15:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7Fi4mf001351; Fri, 7 Nov 2014 15:44:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Fi4d6001345; Fri, 7 Nov 2014 15:44:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071544.sA7Fi4d6001345@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:44: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: r274234 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:44:05 -0000 Author: trasz Date: Fri Nov 7 15:44:03 2014 New Revision: 274234 URL: https://svnweb.freebsd.org/changeset/base/274234 Log: MFC r272470: Make autofs(4) use shared lock for lookups, instead of exclusive one. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:44:03 2014 (r274234) @@ -297,9 +297,9 @@ autofs_cached(struct autofs_node *anp, c * is necessary for wildcard indirect map keys to work. */ if (anp->an_parent == NULL && componentlen != 0) { - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, component, componentlen, NULL); - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); if (error != 0) return (false); } Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:44:03 2014 (r274234) @@ -53,9 +53,12 @@ extern int autofs_mount_on_stat; __func__, ## __VA_ARGS__); \ } while (0) -#define AUTOFS_LOCK(X) sx_xlock(&X->am_lock) -#define AUTOFS_UNLOCK(X) sx_xunlock(&X->am_lock) -#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) +#define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) +#define AUTOFS_XLOCK(X) sx_xlock(&X->am_lock) +#define AUTOFS_SUNLOCK(X) sx_sunlock(&X->am_lock) +#define AUTOFS_XUNLOCK(X) sx_xunlock(&X->am_lock) +#define AUTOFS_ASSERT_LOCKED(X) sx_assert(&X->am_lock, SA_LOCKED) +#define AUTOFS_ASSERT_XLOCKED(X) sx_assert(&X->am_lock, SA_XLOCKED) #define AUTOFS_ASSERT_UNLOCKED(X) sx_assert(&X->am_lock, SA_UNLOCKED) struct autofs_node { Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:44:03 2014 (r274234) @@ -88,14 +88,14 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); free(amp, M_AUTOFS); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); vfs_mountedfrom(mp, from); @@ -146,7 +146,7 @@ autofs_unmount(struct mount *mp, int mnt pause("autofs_umount", 1); } - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); /* * Not terribly efficient, but at least not recursive. @@ -160,7 +160,7 @@ autofs_unmount(struct mount *mp, int mnt autofs_node_delete(amp->am_root); mp->mnt_data = NULL; - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); sx_destroy(&->am_lock); Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:42:11 2014 (r274233) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:44:03 2014 (r274234) @@ -277,22 +277,22 @@ autofs_lookup(struct vop_lookup_args *ap } } - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (EJUSTRETURN); } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (ENOENT); } /* * XXX: Dropping the node here is ok, because we never remove nodes. */ - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); error = autofs_node_vn(child, mp, vpp); if (error != 0) { @@ -325,14 +325,14 @@ autofs_mkdir(struct vop_mkdir_args *ap) if (autofs_ignore_thread(curthread) == false) return (EPERM); - AUTOFS_LOCK(amp); + AUTOFS_XLOCK(amp); error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen, &child); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); return (error); } - AUTOFS_UNLOCK(amp); + AUTOFS_XUNLOCK(amp); error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); @@ -427,7 +427,7 @@ autofs_readdir(struct vop_readdir_args * } i = 2; /* Account for "." and "..". */ - AUTOFS_LOCK(amp); + AUTOFS_SLOCK(amp); TAILQ_FOREACH(child, &anp->an_children, an_next) { if (resid < AUTOFS_DELEN) { if (ap->a_eofflag != NULL) @@ -445,14 +445,14 @@ autofs_readdir(struct vop_readdir_args * error = autofs_readdir_one(uio, child->an_name, child->an_fileno); if (error != 0) { - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (error); } offset += AUTOFS_DELEN; resid -= AUTOFS_DELEN; } - AUTOFS_UNLOCK(amp); + AUTOFS_SUNLOCK(amp); return (0); } @@ -505,7 +505,7 @@ autofs_node_new(struct autofs_node *pare struct autofs_node *anp; if (parent != NULL) - AUTOFS_ASSERT_LOCKED(parent->an_mount); + AUTOFS_ASSERT_XLOCKED(parent->an_mount); anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) @@ -567,7 +567,7 @@ autofs_node_delete(struct autofs_node *a { struct autofs_node *parent; - AUTOFS_ASSERT_LOCKED(anp->an_mount); + AUTOFS_ASSERT_XLOCKED(anp->an_mount); KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children")); callout_drain(&anp->an_callout); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:45:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1D344F5; Fri, 7 Nov 2014 15:45:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD79078F; Fri, 7 Nov 2014 15:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FjZM8001637; Fri, 7 Nov 2014 15:45:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FjZtc001636; Fri, 7 Nov 2014 15:45:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071545.sA7FjZtc001636@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:45: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: r274235 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:45:35 -0000 Author: trasz Date: Fri Nov 7 15:45:34 2014 New Revision: 274235 URL: https://svnweb.freebsd.org/changeset/base/274235 Log: MFC r272471: Fix autofs debug macros. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:44:03 2014 (r274234) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:45:34 2014 (r274235) @@ -42,15 +42,18 @@ extern uma_zone_t autofs_node_zone; extern int autofs_debug; extern int autofs_mount_on_stat; -#define AUTOFS_DEBUG(X, ...) \ - if (autofs_debug > 1) { \ - printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ +#define AUTOFS_DEBUG(X, ...) \ + do { \ + if (autofs_debug > 1) \ + printf("%s: " X "\n", __func__, ## __VA_ARGS__);\ } while (0) -#define AUTOFS_WARN(X, ...) \ - if (autofs_debug > 0) { \ - printf("WARNING: %s: " X "\n", \ - __func__, ## __VA_ARGS__); \ +#define AUTOFS_WARN(X, ...) \ + do { \ + if (autofs_debug > 0) { \ + printf("WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ } while (0) #define AUTOFS_SLOCK(X) sx_slock(&X->am_lock) From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:47:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DE264D; Fri, 7 Nov 2014 15:47:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC167A8; Fri, 7 Nov 2014 15:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FlNgY001921; Fri, 7 Nov 2014 15:47:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FlM2r001918; Fri, 7 Nov 2014 15:47:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071547.sA7FlM2r001918@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:47: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: r274236 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:47:23 -0000 Author: trasz Date: Fri Nov 7 15:47:22 2014 New Revision: 274236 URL: https://svnweb.freebsd.org/changeset/base/274236 Log: MFC r272512: Make autofs use shared vnode locks. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.h stable/10/sys/fs/autofs/autofs_vfsops.c stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.h ============================================================================== --- stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs.h Fri Nov 7 15:47:22 2014 (r274236) @@ -138,6 +138,6 @@ int autofs_node_find(struct autofs_node const char *name, int namelen, struct autofs_node **anpp); void autofs_node_delete(struct autofs_node *anp); int autofs_node_vn(struct autofs_node *anp, struct mount *mp, - struct vnode **vpp); + int flags, struct vnode **vpp); #endif /* !AUTOFS_H */ Modified: stable/10/sys/fs/autofs/autofs_vfsops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs_vfsops.c Fri Nov 7 15:47:22 2014 (r274236) @@ -88,6 +88,10 @@ autofs_mount(struct mount *mp) vfs_getnewfsid(mp); + MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + MNT_IUNLOCK(mp); + AUTOFS_XLOCK(amp); error = autofs_node_new(NULL, amp, ".", -1, &->am_root); if (error != 0) { @@ -177,7 +181,7 @@ autofs_root(struct mount *mp, int flags, amp = VFSTOAUTOFS(mp); - error = autofs_node_vn(amp->am_root, mp, vpp); + error = autofs_node_vn(amp->am_root, mp, flags, vpp); return (error); } Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:45:34 2014 (r274235) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:47:22 2014 (r274236) @@ -198,12 +198,12 @@ mounted: } static int -autofs_vget_callback(struct mount *mp, void *arg, int lkflags __unused, +autofs_vget_callback(struct mount *mp, void *arg, int flags, struct vnode **vpp) { - return (autofs_node_vn(arg, mp, vpp)); + return (autofs_node_vn(arg, mp, flags, vpp)); } static int @@ -233,7 +233,7 @@ autofs_lookup(struct vop_lookup_args *ap * use vn_vget_ino_gen() which takes care of all that. */ error = vn_vget_ino_gen(dvp, autofs_vget_callback, - anp->an_parent, 0, vpp); + anp->an_parent, cnp->cn_lkflags, vpp); if (error != 0) { AUTOFS_WARN("vn_vget_ino_gen() failed with error %d", error); @@ -294,7 +294,7 @@ autofs_lookup(struct vop_lookup_args *ap */ AUTOFS_SUNLOCK(amp); - error = autofs_node_vn(child, mp, vpp); + error = autofs_node_vn(child, mp, cnp->cn_lkflags, vpp); if (error != 0) { if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) return (EJUSTRETURN); @@ -334,7 +334,7 @@ autofs_mkdir(struct vop_mkdir_args *ap) } AUTOFS_XUNLOCK(amp); - error = autofs_node_vn(child, vp->v_mount, ap->a_vpp); + error = autofs_node_vn(child, vp->v_mount, LK_EXCLUSIVE, ap->a_vpp); return (error); } @@ -581,7 +581,8 @@ autofs_node_delete(struct autofs_node *a } int -autofs_node_vn(struct autofs_node *anp, struct mount *mp, struct vnode **vpp) +autofs_node_vn(struct autofs_node *anp, struct mount *mp, int flags, + struct vnode **vpp) { struct vnode *vp; int error; @@ -592,7 +593,7 @@ autofs_node_vn(struct autofs_node *anp, vp = anp->an_vnode; if (vp != NULL) { - error = vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + error = vget(vp, flags | LK_RETRY, curthread); if (error != 0) { AUTOFS_WARN("vget failed with error %d", error); sx_xunlock(&anp->an_vnode_lock); @@ -632,6 +633,8 @@ autofs_node_vn(struct autofs_node *anp, vp->v_vflag |= VV_ROOT; vp->v_data = anp; + VN_LOCK_ASHARE(vp); + error = insmntque(vp, mp); if (error != 0) { AUTOFS_WARN("insmntque() failed with error %d", error); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:49:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A90BF886; Fri, 7 Nov 2014 15:49:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 947AE7C9; Fri, 7 Nov 2014 15:49:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7Fn5tl002194; Fri, 7 Nov 2014 15:49:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Fn5OQ002193; Fri, 7 Nov 2014 15:49:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071549.sA7Fn5OQ002193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:49:05 +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: r274237 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:49:05 -0000 Author: trasz Date: Fri Nov 7 15:49:04 2014 New Revision: 274237 URL: https://svnweb.freebsd.org/changeset/base/274237 Log: MFC r272743: Simplify; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs.c ============================================================================== --- stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:47:22 2014 (r274236) +++ stable/10/sys/fs/autofs/autofs.c Fri Nov 7 15:49:04 2014 (r274237) @@ -367,7 +367,7 @@ autofs_trigger_one(struct autofs_node *a char *key, *path; int error = 0, request_error, last; - amp = VFSTOAUTOFS(anp->an_vnode->v_mount); + amp = anp->an_mount; sx_assert(&autofs_softc->sc_lock, SA_XLOCKED); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:50:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CC77A37; Fri, 7 Nov 2014 15:50:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08B6E7DE; Fri, 7 Nov 2014 15:50:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FoelO004326; Fri, 7 Nov 2014 15:50:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7Foet4004325; Fri, 7 Nov 2014 15:50:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071550.sA7Foet4004325@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:50: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: r274238 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:50:41 -0000 Author: trasz Date: Fri Nov 7 15:50:40 2014 New Revision: 274238 URL: https://svnweb.freebsd.org/changeset/base/274238 Log: MFC r272836: Remove remnants of some cleanup; no functional changes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:49:04 2014 (r274237) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:50:40 2014 (r274238) @@ -459,8 +459,8 @@ autofs_readdir(struct vop_readdir_args * static int autofs_reclaim(struct vop_reclaim_args *ap) { - struct vnode *vp = ap->a_vp; - struct autofs_node *anp = vp->v_data; + struct vnode *vp; + struct autofs_node *anp; vp = ap->a_vp; anp = vp->v_data; From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 15:52:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7621BD1; Fri, 7 Nov 2014 15:52:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92A6B88A; Fri, 7 Nov 2014 15:52:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7FqX8E006124; Fri, 7 Nov 2014 15:52:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7FqXZw006123; Fri, 7 Nov 2014 15:52:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411071552.sA7FqXZw006123@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 7 Nov 2014 15:52:33 +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: r274239 - stable/10/sys/fs/autofs 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:52:33 -0000 Author: trasz Date: Fri Nov 7 15:52:32 2014 New Revision: 274239 URL: https://svnweb.freebsd.org/changeset/base/274239 Log: MFC r272931: Add assertion to catch duplicated nodes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:50:40 2014 (r274238) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:52:32 2014 (r274239) @@ -504,9 +504,13 @@ autofs_node_new(struct autofs_node *pare { struct autofs_node *anp; - if (parent != NULL) + if (parent != NULL) { AUTOFS_ASSERT_XLOCKED(parent->an_mount); + KASSERT(autofs_node_find(parent, name, namelen, NULL) == ENOENT, + ("node \"%s\" already exists", name)); + } + anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) anp->an_name = strndup(name, namelen, M_AUTOFS); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 19:13:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEC2E4C9; Fri, 7 Nov 2014 19:13:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B876EEF6; Fri, 7 Nov 2014 19:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7JDMOY001118; Fri, 7 Nov 2014 19:13:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7JDKH6001102; Fri, 7 Nov 2014 19:13:20 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411071913.sA7JDKH6001102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 7 Nov 2014 19:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274246 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_gre sys/modules/if_me sys/net sys/netinet sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 19:13:22 -0000 Author: ae Date: Fri Nov 7 19:13:19 2014 New Revision: 274246 URL: https://svnweb.freebsd.org/changeset/base/274246 Log: Overhaul if_gre(4). Split it into two modules: if_gre(4) for GRE encapsulation and if_me(4) for minimal encapsulation within IP. gre(4) changes: * convert to if_transmit; * rework locking: protect access to softc with rmlock, protect from concurrent ioctls with sx lock; * correct interface accounting for outgoing datagramms (count only payload size); * implement generic support for using IPv6 as delivery header; * make implementation conform to the RFC 2784 and partially to RFC 2890; * add support for GRE checksums - calculate for outgoing datagramms and check for inconming datagramms; * add support for sending sequence number in GRE header; * remove support of cached routes. This fixes problem, when gre(4) doesn't work at system startup. But this also removes support for having tunnels with the same addresses for inner and outer header. * deprecate support for various GREXXX ioctls, that doesn't used in FreeBSD. Use our standard ioctls for tunnels. me(4): * implementation conform to RFC 2004; * use if_transmit; * use the same locking model as gre(4); PR: 164475 Differential Revision: D1023 No objections from: net@ Relnotes: yes Sponsored by: Yandex LLC Added: head/share/man/man4/me.4 (contents, props changed) head/sys/modules/if_me/ head/sys/modules/if_me/Makefile (contents, props changed) head/sys/net/if_me.c (contents, props changed) head/sys/netinet6/ip6_gre.c (contents, props changed) Deleted: head/sys/netinet/ip_gre.h Modified: head/sbin/ifconfig/ifgre.c head/share/man/man4/Makefile head/share/man/man4/gre.4 head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile head/sys/modules/if_gre/Makefile head/sys/net/if_gre.c head/sys/net/if_gre.h head/sys/netinet/ip_gre.c head/sys/netinet6/in6_proto.c Modified: head/sbin/ifconfig/ifgre.c ============================================================================== --- head/sbin/ifconfig/ifgre.c Fri Nov 7 17:00:28 2014 (r274245) +++ head/sbin/ifconfig/ifgre.c Fri Nov 7 19:13:19 2014 (r274246) @@ -23,52 +23,50 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif +#include +__FBSDID("$FreeBSD$"); #include #include #include #include - -#include -#include - -#include #include #include -#include #include +#include #include -#include #include -#include +#include #include -#include #include "ifconfig.h" +#define GREBITS "\020\01ENABLE_CSUM\02ENABLE_SEQ" + static void gre_status(int s); static void gre_status(int s) { - int grekey = 0; + uint32_t opts = 0; - ifr.ifr_data = (caddr_t)&grekey; + ifr.ifr_data = (caddr_t)&opts; if (ioctl(s, GREGKEY, &ifr) == 0) - if (grekey != 0) - printf("\tgrekey: %d\n", grekey); + if (opts != 0) + printf("\tgrekey: 0x%x (%u)\n", opts, opts); + opts = 0; + if (ioctl(s, GREGOPTS, &ifr) != 0 || opts == 0) + return; + printb("\toptions", opts, GREBITS); + putchar('\n'); } static void setifgrekey(const char *val, int dummy __unused, int s, const struct afswtch *afp) { - uint32_t grekey = atol(val); + uint32_t grekey = strtol(val, NULL, 0); strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name)); ifr.ifr_data = (caddr_t)&grekey; @@ -76,8 +74,35 @@ setifgrekey(const char *val, int dummy _ warn("ioctl (set grekey)"); } +static void +setifgreopts(const char *val, int d, int s, const struct afswtch *afp) +{ + uint32_t opts; + + ifr.ifr_data = (caddr_t)&opts; + if (ioctl(s, GREGOPTS, &ifr) == -1) { + warn("ioctl(GREGOPTS)"); + return; + } + + if (d < 0) + opts &= ~(-d); + else + opts |= d; + + if (ioctl(s, GRESOPTS, &ifr) == -1) { + warn("ioctl(GIFSOPTS)"); + return; + } +} + + static struct cmd gre_cmds[] = { DEF_CMD_ARG("grekey", setifgrekey), + DEF_CMD("enable_csum", GRE_ENABLE_CSUM, setifgreopts), + DEF_CMD("-enable_csum",-GRE_ENABLE_CSUM,setifgreopts), + DEF_CMD("enable_seq", GRE_ENABLE_SEQ, setifgreopts), + DEF_CMD("-enable_seq",-GRE_ENABLE_SEQ, setifgreopts), }; static struct afswtch af_gre = { .af_name = "af_gre", Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Nov 7 17:00:28 2014 (r274245) +++ head/share/man/man4/Makefile Fri Nov 7 19:13:19 2014 (r274246) @@ -252,6 +252,7 @@ MAN= aac.4 \ malo.4 \ mcd.4 \ md.4 \ + me.4 \ mem.4 \ meteor.4 \ mfi.4 \ Modified: head/share/man/man4/gre.4 ============================================================================== --- head/share/man/man4/gre.4 Fri Nov 7 17:00:28 2014 (r274245) +++ head/share/man/man4/gre.4 Fri Nov 7 19:13:19 2014 (r274246) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2008 +.Dd November 7, 2014 .Dt GRE 4 .Os .Sh NAME @@ -68,162 +68,30 @@ and .Cm destroy subcommands. .Pp -This driver currently supports the following modes of operation: -.Bl -tag -width indent -.It "GRE encapsulation (IP protocol number 47)" -Encapsulated datagrams are -prepended an outer datagram and a GRE header. +This driver corresponds to RFC 2784. +Encapsulated datagrams are prepended an outer datagram and a GRE header. The GRE header specifies the type of the encapsulated datagram and thus allows for tunneling other protocols than IP. GRE mode is also the default tunnel mode on Cisco routers. -This is also the default mode of operation of the -.Nm -interfaces. -As part of the GRE mode, .Nm also supports Cisco WCCP protocol, both version 1 and version 2. -Since there is no reliable way to distinguish between WCCP versions, it -should be configured manually using the -.Cm link2 -flag. -If the -.Cm link2 -flag is not set (default), then WCCP version 1 is selected. -.It "MOBILE encapsulation (IP protocol number 55)" -Datagrams are -encapsulated into IP, but with a shorter encapsulation. -The original -IP header is modified and the modifications are inserted between the -so modified header and the original payload. -Like -.Xr gif 4 , -only for IP-in-IP encapsulation. -.El .Pp The .Nm -interfaces support a number of -.Xr ioctl 2 Ns s , -such as: -.Bl -tag -width ".Dv GRESADDRS" -.It Dv GRESADDRS -Set the IP address of the local tunnel end. -This is the source address -set by or displayed by -.Xr ifconfig 8 -for the -.Nm -interface. -.It Dv GRESADDRD -Set the IP address of the remote tunnel end. -This is the destination address -set by or displayed by -.Xr ifconfig 8 -for the -.Nm -interface. -.It Dv GREGADDRS -Query the IP address that is set for the local tunnel end. -This is the -address the encapsulation header carries as local address (i.e., the real -address of the tunnel start point). -.It Dv GREGADDRD -Query the IP address that is set for the remote tunnel end. -This is the -address the encapsulated packets are sent to (i.e., the real address of -the remote tunnel endpoint). -.It Dv GRESPROTO -Set the operation mode to the specified IP protocol value. -The -protocol is passed to the interface in -.Po Vt "struct ifreq" Pc Ns Li -> Ns Va ifr_flags . -The operation mode can also be given as -.Pp -.Bl -tag -width ".Cm -link0" -compact -.It Cm link0 -.Dv IPPROTO_GRE -.It Cm -link0 -.Dv IPPROTO_MOBILE -.El -.Pp -to -.Xr ifconfig 8 . -.Pp -The -.Cm link1 -flag is not used to choose encapsulation, but to modify the -internal route search for the remote tunnel endpoint, see the -.Sx BUGS -section below. -.It Dv GREGPROTO -Query operation mode. -.It Dv GRESKEY +interfaces support a number of additional parameters to the +.Xr ifconfig 8 : +.Bl -tag -width "enable_csum" +.It Ar grekey Set the GRE key used for outgoing packets. A value of 0 disables the key option. -.It Dv GREGKEY -Get the GRE key currently used for outgoing packets. -0 means no outgoing key. +.It Ar enable_csum +Enables checksum calculation for outgoing packets. +.It Ar enable_seq +Enables use of sequence number field in the GRE header for outgoing packets. .El -.Pp -Note that the IP addresses of the tunnel endpoints may be the same as the -ones defined with -.Xr ifconfig 8 -for the interface (as if IP is encapsulated), but need not be. .Sh EXAMPLES -Configuration example: -.Bd -literal -Host X-- Host A ----------------tunnel---------- Cisco D------Host E - \\ | - \\ / - +------Host B----------Host C----------+ -.Ed .Pp -On host A -.Pq Fx : -.Bd -literal -offset indent -route add default B -ifconfig greN create -ifconfig greN A D netmask 0xffffffff linkX up -ifconfig greN tunnel A D -route add E D -.Ed -.Pp -On Host D (Cisco): -.Bd -literal -offset indent -Interface TunnelX - ip unnumbered D ! e.g. address from Ethernet interface - tunnel source D ! e.g. address from Ethernet interface - tunnel destination A -ip route C -ip route A mask C -ip route X mask tunnelX -.Ed -.Pp -OR -.Pp -On Host D -.Pq Fx : -.Bd -literal -offset indent -route add default C -ifconfig greN create -ifconfig greN D A -ifconfig greN tunnel D A -.Ed -.Pp -If all goes well, you should see packets flowing ;-) -.Pp -If you want to reach Host A over the tunnel (from Host D (Cisco)), then -you have to have an alias on Host A for e.g.\& the Ethernet interface like: -.Pp -.Dl "ifconfig alias Y" -.Pp -and on the Cisco: -.Pp -.Dl "ip route Y mask tunnelX" -.Pp -A similar setup can be used to create a link between two private networks -(for example in the 192.168 subnet) over the Internet: .Bd -literal 192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.* \\ / @@ -238,29 +106,22 @@ Assuming router A has the (external) IP On router A: .Bd -literal -offset indent ifconfig greN create -ifconfig greN 192.168.1.1 192.168.2.1 link1 -ifconfig greN tunnel A B +ifconfig greN inet 192.168.1.1 192.168.2.1 +ifconfig greN inet tunnel A B route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1 .Ed .Pp On router B: .Bd -literal -offset indent ifconfig greN create -ifconfig greN 192.168.2.1 192.168.1.1 link1 -ifconfig greN tunnel B A +ifconfig greN inet 192.168.2.1 192.168.1.1 +ifconfig greN inet tunnel B A route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 .Ed -.Pp -Note that this is a safe situation where the -.Cm link1 -flag (as discussed in the -.Sx BUGS -section below) may (and probably should) be set. .Sh NOTES The MTU of .Nm interfaces is set to 1476 by default, to match the value used by Cisco routers. -If grekey is set this is lowered to 1472. This may not be an optimal value, depending on the link between the two tunnel endpoints. It can be adjusted via @@ -268,25 +129,8 @@ It can be adjusted via .Pp For correct operation, the .Nm -device needs a route to the destination that is less specific than the -one over the tunnel. -(Basically, there needs to be a route to the decapsulating host that -does not run over the tunnel, as this would be a loop.) -If the addresses are ambiguous, doing the -.Nm ifconfig Cm tunnel -step before the -.Xr ifconfig 8 -call to set the -.Nm -IP addresses will help to find a route outside the tunnel. -.Pp -In order to tell -.Xr ifconfig 8 -to actually mark the interface as -.Dq up , -the keyword -.Cm up -must be given last on its command line. +device needs a route to the decapsulating host that does not run over the tunnel, +as this would be a loop. .Pp The kernel must be set to forward datagrams by setting the .Va net.inet.ip.forwarding @@ -296,41 +140,20 @@ variable to non-zero. .Xr gif 4 , .Xr inet 4 , .Xr ip 4 , +.Xr me 4 , .Xr netintro 4 , -.\" Xr options 4 , .Xr protocols 5 , .Xr ifconfig 8 , .Xr sysctl 8 .Pp -A description of GRE encapsulation can be found in RFC 1701 and RFC 1702. -.Pp -A description of MOBILE encapsulation can be found in RFC 2004. +A description of GRE encapsulation can be found in RFC 2784 and RFC 2890. .Sh AUTHORS +.An Andrey V. Elsukov Aq Mt ae@FreeBSD.org .An Heiko W.Rupp Aq Mt hwr@pilhuhn.de .Sh BUGS -The -.Fn compute_route -code in -.Pa if_gre.c -toggles the last bit of the -IP-address to provoke the search for a less specific route than the -one directly over the tunnel to prevent loops. -This is possibly not the best solution. -.Pp -To avoid the address munging described above, turn on the -.Cm link1 -flag on the -.Xr ifconfig 8 -command line. -This implies that the GRE packet destination and the ifconfig remote host -are not the same IP addresses, and that the GRE destination does not route -over the -.Nm -interface itself. .Pp The current implementation uses the key only for outgoing packets. Incoming packets with a different key or without a key will be treated as if they would belong to this interface. .Pp -RFC1701 is not fully supported, however all unsupported features have been -deprecated in RFC2784. +The sequence number field also used only for outgoing packets. Added: head/share/man/man4/me.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/me.4 Fri Nov 7 19:13:19 2014 (r274246) @@ -0,0 +1,85 @@ +.\" Copyright (c) Andrey V. Elsukov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 7, 2014 +.Dt ME 4 +.Os +.Sh NAME +.Nm me +.Nd encapsulating network device +.Sh SYNOPSIS +To compile the +driver into the kernel, place the following line in the kernel +configuration file: +.Bd -ragged -offset indent +.Cd "device me" +.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 +if_me_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +network interface pseudo device encapsulates datagrams +into IP. +These encapsulated datagrams are routed to a destination host, +where they are decapsulated and further routed to their final destination. +.Pp +.Nm +interfaces are dynamically created and destroyed with the +.Xr ifconfig 8 +.Cm create +and +.Cm destroy +subcommands. +.Pp +This driver corresponds to RFC 2004. +Datagrams are encapsulated into IP with a shorter encapsulation. +The original +IP header is modified and the modifications are inserted between the +so modified header and the original payload. +The protocol number 55 is used for outer header. +.Sh NOTES +.Pp +For correct operation, the +.Nm +device needs a route to the decapsulating host that does not run over the tunnel, +as this would be a loop. +.Sh SEE ALSO +.Xr gif 4 , +.Xr gre 4 , +.Xr inet 4 , +.Xr ip 4 , +.Xr netintro 4 , +.Xr protocols 5 , +.Xr ifconfig 8 , +.Xr sysctl 8 +.Sh AUTHORS +.An Andrey V. Elsukov Aq Mt ae@FreeBSD.org Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Nov 7 17:00:28 2014 (r274245) +++ head/sys/conf/NOTES Fri Nov 7 19:13:19 2014 (r274246) @@ -879,12 +879,15 @@ device tun # The `gif' device implements IPv6 over IP4 tunneling, # IPv4 over IPv6 tunneling, IPv4 over IPv4 tunneling and # IPv6 over IPv6 tunneling. -# The `gre' device implements two types of IP4 over IP4 tunneling: -# GRE and MOBILE, as specified in the RFC1701 and RFC2004. +# The `gre' device implements GRE (Generic Routing Encapsulation) tunneling, +# as specified in the RFC 2784 and RFC 2890. +# The `me' device implements Minimal Encapsulation within IPv4 as +# specified in the RFC 2004. # The XBONEHACK option allows the same pair of addresses to be configured on # multiple gif interfaces. device gif device gre +device me options XBONEHACK # The `faith' device captures packets sent to it and diverts them Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 7 17:00:28 2014 (r274245) +++ head/sys/conf/files Fri Nov 7 19:13:19 2014 (r274246) @@ -3234,11 +3234,12 @@ net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip net/if_gif.c optional gif inet | gif inet6 | \ netgraph_gif inet | netgraph_gif inet6 -net/if_gre.c optional gre inet +net/if_gre.c optional gre inet | gre inet6 net/if_iso88025subr.c optional token net/if_lagg.c optional lagg net/if_loop.c optional loop net/if_llatbl.c standard +net/if_me.c optional me inet net/if_media.c standard net/if_mib.c standard net/if_spppfr.c optional sppp | netgraph_sppp @@ -3473,6 +3474,7 @@ netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 netinet6/in6_src.c optional inet6 netinet6/ip6_forward.c optional inet6 +netinet6/ip6_gre.c optional gre inet6 netinet6/ip6_id.c optional inet6 netinet6/ip6_input.c optional inet6 netinet6/ip6_mroute.c optional mrouting inet6 Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Nov 7 17:00:28 2014 (r274245) +++ head/sys/modules/Makefile Fri Nov 7 19:13:19 2014 (r274246) @@ -146,8 +146,9 @@ SUBDIR= \ if_edsc \ if_epair \ if_faith \ - if_gif \ + ${_if_gif} \ ${_if_gre} \ + ${_if_me} \ if_lagg \ ${_if_ndis} \ if_stf \ @@ -403,10 +404,12 @@ _random= random defined(ALL_MODULES) _carp= carp _toecore= toecore +_if_gif= if_gif +_if_gre= if_gre .endif .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) -_if_gre= if_gre +_if_me= if_me _ipdivert= ipdivert _ipfw= ipfw .endif Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Fri Nov 7 17:00:28 2014 (r274245) +++ head/sys/modules/if_gre/Makefile Fri Nov 7 19:13:19 2014 (r274246) @@ -1,8 +1,17 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../net ${.CURDIR}/../../netinet ${.CURDIR}/../../netinet6 +.include "${.CURDIR}/../../conf/kern.opts.mk" KMOD= if_gre -SRCS= if_gre.c ip_gre.c opt_inet.h opt_inet6.h +SRCS= if_gre.c opt_inet.h opt_inet6.h + +.if ${MK_INET_SUPPORT} != "no" +SRCS+= ip_gre.c +.endif + +.if ${MK_INET6_SUPPORT} != "no" +SRCS+= ip6_gre.c +.endif .include Added: head/sys/modules/if_me/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/if_me/Makefile Fri Nov 7 19:13:19 2014 (r274246) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= if_me +SRCS= if_me.c + +.include Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Nov 7 17:00:28 2014 (r274245) +++ head/sys/net/if_gre.c Fri Nov 7 19:13:19 2014 (r274246) @@ -1,8 +1,6 @@ -/* $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ -/* $FreeBSD$ */ - /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. + * Copyright (c) 2014 Andrey V. Elsukov * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -30,16 +28,12 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: if_gre.c,v 1.49 2003/12/11 00:22:29 itojun Exp $ */ -/* - * Encapsulate L3 protocols into IP - * See RFC 2784 (successor of RFC 1701 and 1702) for more details. - * If_gre is compatible with Cisco GRE tunnels, so you can - * have a NetBSD box as the other end of a tunnel interface of a Cisco - * router. See gre(4) for more details. - * Also supported: IP in IP encaps (proto 55) as of RFC 2004 - */ +#include +__FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" @@ -47,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -54,9 +49,12 @@ #include #include #include +#include #include #include +#include #include +#include #include #include @@ -64,85 +62,71 @@ #include #include #include -#include +#include #include -#ifdef INET #include +#ifdef INET #include #include #include -#include #include -#include -#else -#error "Huh? if_gre without inet?" #endif -#include +#ifdef INET6 +#include +#include +#include +#include +#endif +#include +#include #include -/* - * It is not easy to calculate the right value for a GRE MTU. - * We leave this task to the admin and use the same default that - * other vendors use. - */ -#define GREMTU 1476 - -#define MTAG_COOKIE_GRE 1307983903 -#define MTAG_GRE_NESTING 1 -struct mtag_gre_nesting { - uint16_t count; - uint16_t max; - struct ifnet *ifp[]; -}; - -/* - * gre_mtx protects all global variables in if_gre.c. - * XXX: gre_softc data not protected yet. - */ -VNET_DEFINE(struct mtx, gre_mtx); -VNET_DEFINE(struct gre_softc_head, gre_softc_list); +#include +#include +#define GREMTU 1500 static const char grename[] = "gre"; static MALLOC_DEFINE(M_GRE, grename, "Generic Routing Encapsulation"); +static VNET_DEFINE(struct mtx, gre_mtx); +#define V_gre_mtx VNET(gre_mtx) +#define GRE_LIST_LOCK_INIT(x) mtx_init(&V_gre_mtx, "gre_mtx", NULL, \ + MTX_DEF) +#define GRE_LIST_LOCK_DESTROY(x) mtx_destroy(&V_gre_mtx) +#define GRE_LIST_LOCK(x) mtx_lock(&V_gre_mtx) +#define GRE_LIST_UNLOCK(x) mtx_unlock(&V_gre_mtx) + +static VNET_DEFINE(LIST_HEAD(, gre_softc), gre_softc_list); +#define V_gre_softc_list VNET(gre_softc_list) +static struct sx gre_ioctl_sx; +SX_SYSINIT(gre_ioctl_sx, &gre_ioctl_sx, "gre_ioctl"); static int gre_clone_create(struct if_clone *, int, caddr_t); static void gre_clone_destroy(struct ifnet *); static VNET_DEFINE(struct if_clone *, gre_cloner); #define V_gre_cloner VNET(gre_cloner) +static void gre_qflush(struct ifnet *); +static int gre_transmit(struct ifnet *, struct mbuf *); static int gre_ioctl(struct ifnet *, u_long, caddr_t); static int gre_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); -static int gre_compute_route(struct gre_softc *sc); +static void gre_updatehdr(struct gre_softc *); +static int gre_set_tunnel(struct ifnet *, struct sockaddr *, + struct sockaddr *); +static void gre_delete_tunnel(struct ifnet *); +int gre_input(struct mbuf **, int *, int); #ifdef INET -extern struct domain inetdomain; -static const struct protosw in_gre_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_GRE, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = gre_input, - .pr_output = rip_output, - .pr_ctlinput = rip_ctlinput, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; -static const struct protosw in_mobile_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_MOBILE, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = gre_mobile_input, - .pr_output = rip_output, - .pr_ctlinput = rip_ctlinput, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; +extern int in_gre_attach(struct gre_softc *); +extern int in_gre_output(struct mbuf *, int, int); +#endif +#ifdef INET6 +extern int in6_gre_attach(struct gre_softc *); +extern int in6_gre_output(struct mbuf *, int, int); #endif SYSCTL_DECL(_net_link); @@ -159,6 +143,7 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL */ #define MAX_GRE_NEST 1 #endif + static VNET_DEFINE(int, max_gre_nesting) = MAX_GRE_NEST; #define V_max_gre_nesting VNET(max_gre_nesting) SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, @@ -191,34 +176,22 @@ gre_clone_create(struct if_clone *ifc, i struct gre_softc *sc; sc = malloc(sizeof(struct gre_softc), M_GRE, M_WAITOK | M_ZERO); - + sc->gre_fibnum = curthread->td_proc->p_fibnum; GRE2IFP(sc) = if_alloc(IFT_TUNNEL); - if (GRE2IFP(sc) == NULL) { - free(sc, M_GRE); - return (ENOSPC); - } - + GRE_LOCK_INIT(sc); GRE2IFP(sc)->if_softc = sc; if_initname(GRE2IFP(sc), grename, unit); - GRE2IFP(sc)->if_snd.ifq_maxlen = ifqmaxlen; - GRE2IFP(sc)->if_addrlen = 0; - GRE2IFP(sc)->if_hdrlen = 24; /* IP + GRE */ - GRE2IFP(sc)->if_mtu = GREMTU; + GRE2IFP(sc)->if_mtu = sc->gre_mtu = GREMTU; GRE2IFP(sc)->if_flags = IFF_POINTOPOINT|IFF_MULTICAST; GRE2IFP(sc)->if_output = gre_output; GRE2IFP(sc)->if_ioctl = gre_ioctl; - sc->g_dst.s_addr = sc->g_src.s_addr = INADDR_ANY; - sc->g_proto = IPPROTO_GRE; - GRE2IFP(sc)->if_flags |= IFF_LINK0; - sc->encap = NULL; - sc->gre_fibnum = curthread->td_proc->p_fibnum; - sc->wccp_ver = WCCP_V1; - sc->key = 0; + GRE2IFP(sc)->if_transmit = gre_transmit; + GRE2IFP(sc)->if_qflush = gre_qflush; if_attach(GRE2IFP(sc)); bpfattach(GRE2IFP(sc), DLT_NULL, sizeof(u_int32_t)); GRE_LIST_LOCK(); - LIST_INSERT_HEAD(&V_gre_softc_list, sc, sc_list); + LIST_INSERT_HEAD(&V_gre_softc_list, sc, gre_list); GRE_LIST_UNLOCK(); return (0); } @@ -226,687 +199,749 @@ gre_clone_create(struct if_clone *ifc, i static void gre_clone_destroy(struct ifnet *ifp) { - struct gre_softc *sc = ifp->if_softc; + struct gre_softc *sc; + sx_xlock(&gre_ioctl_sx); + sc = ifp->if_softc; + gre_delete_tunnel(ifp); GRE_LIST_LOCK(); - LIST_REMOVE(sc, sc_list); + LIST_REMOVE(sc, gre_list); GRE_LIST_UNLOCK(); - -#ifdef INET - if (sc->encap != NULL) - encap_detach(sc->encap); -#endif bpfdetach(ifp); if_detach(ifp); + ifp->if_softc = NULL; + sx_xunlock(&gre_ioctl_sx); + if_free(ifp); + GRE_LOCK_DESTROY(sc); free(sc, M_GRE); } -/* - * The output routine. Takes a packet and encapsulates it in the protocol - * given by sc->g_proto. See also RFC 1701 and RFC 2004 - */ static int -gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, - struct route *ro) +gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - int error = 0; - struct gre_softc *sc = ifp->if_softc; - struct greip *gh; - struct ip *ip; - struct m_tag *mtag; - struct mtag_gre_nesting *gt; - size_t len; - u_short gre_ip_id = 0; - uint8_t gre_ip_tos = 0; - u_int16_t etype = 0; - struct mobile_h mob_h; - u_int32_t af; - int extra = 0, max; - - /* - * gre may cause infinite recursion calls when misconfigured. High - * nesting level may cause stack exhaustion. We'll prevent this by - * detecting loops and by introducing upper limit. - */ - mtag = m_tag_locate(m, MTAG_COOKIE_GRE, MTAG_GRE_NESTING, NULL); - if (mtag != NULL) { - struct ifnet **ifp2; - - gt = (struct mtag_gre_nesting *)(mtag + 1); - gt->count++; - if (gt->count > min(gt->max, V_max_gre_nesting)) { - printf("%s: hit maximum recursion limit %u on %s\n", - __func__, gt->count - 1, ifp->if_xname); - m_freem(m); - error = EIO; /* is there better errno? */ - goto end; - } - - ifp2 = gt->ifp; - for (max = gt->count - 1; max > 0; max--) { - if (*ifp2 == ifp) - break; - ifp2++; - } - if (*ifp2 == ifp) { - printf("%s: detected loop with nexting %u on %s\n", - __func__, gt->count-1, ifp->if_xname); - m_freem(m); - error = EIO; /* is there better errno? */ - goto end; - } - *ifp2 = ifp; + GRE_RLOCK_TRACKER; + struct ifreq *ifr = (struct ifreq *)data; + struct sockaddr *src, *dst; + struct gre_softc *sc; +#ifdef INET + struct sockaddr_in *sin = NULL; +#endif +#ifdef INET6 + struct sockaddr_in6 *sin6 = NULL; +#endif + uint32_t opt; + int error; - } else { - /* - * Given that people should NOT increase max_gre_nesting beyond - * their real needs, we allocate once per packet rather than - * allocating an mtag once per passing through gre. - * - * Note: the sysctl does not actually check for saneness, so we - * limit the maximum numbers of possible recursions here. - */ - max = imin(V_max_gre_nesting, 256); - /* If someone sets the sysctl <= 0, we want at least 1. */ - max = imax(max, 1); - len = sizeof(struct mtag_gre_nesting) + - max * sizeof(struct ifnet *); - mtag = m_tag_alloc(MTAG_COOKIE_GRE, MTAG_GRE_NESTING, len, - M_NOWAIT); - if (mtag == NULL) { - m_freem(m); - error = ENOMEM; - goto end; - } - gt = (struct mtag_gre_nesting *)(mtag + 1); - bzero(gt, len); - gt->count = 1; - gt->max = max; - *gt->ifp = ifp; - m_tag_prepend(m, mtag); + switch (cmd) { + case SIOCSIFMTU: + /* XXX: */ + if (ifr->ifr_mtu < 576) + return (EINVAL); + break; + case SIOCSIFADDR: + ifp->if_flags |= IFF_UP; + case SIOCSIFFLAGS: + case SIOCADDMULTI: + case SIOCDELMULTI: + return (0); + case GRESADDRS: + case GRESADDRD: + case GREGADDRS: + case GREGADDRD: + case GRESPROTO: + case GREGPROTO: + return (EOPNOTSUPP); } - - if (!((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) || - sc->g_src.s_addr == INADDR_ANY || sc->g_dst.s_addr == INADDR_ANY) { - m_freem(m); - error = ENETDOWN; + src = dst = NULL; + sx_xlock(&gre_ioctl_sx); + sc = ifp->if_softc; + if (sc == NULL) { + error = ENXIO; goto end; } - - gh = NULL; - ip = NULL; - - /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) - bcopy(dst->sa_data, &af, sizeof(af)); - else - af = dst->sa_family; - - if (bpf_peers_present(ifp->if_bpf)) - bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); - - if ((ifp->if_flags & IFF_MONITOR) != 0) { - m_freem(m); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 19:32:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A52FDA6D; Fri, 7 Nov 2014 19:32:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 920AB14B; Fri, 7 Nov 2014 19:32:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7JWBNJ010482; Fri, 7 Nov 2014 19:32:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7JWBYZ010481; Fri, 7 Nov 2014 19:32:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411071932.sA7JWBYZ010481@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Nov 2014 19:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274248 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 19:32:11 -0000 Author: mav Date: Fri Nov 7 19:32:10 2014 New Revision: 274248 URL: https://svnweb.freebsd.org/changeset/base/274248 Log: Remove unused assignments, noticed by Clang analyzer. MFC after: 1 week Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Fri Nov 7 19:26:20 2014 (r274247) +++ head/usr.sbin/ctld/ctld.c Fri Nov 7 19:32:10 2014 (r274248) @@ -896,7 +896,7 @@ void isns_register(struct isns *isns, struct isns *oldisns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -912,8 +912,8 @@ isns_register(struct isns *isns, struct if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets)) oldisns = isns; - res = isns_do_deregister(oldisns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(oldisns, s, hostname); + isns_do_register(isns, s, hostname); close(s); set_timeout(0, false); } @@ -938,8 +938,8 @@ isns_check(struct isns *isns) res = isns_do_check(isns, s, hostname); if (res < 0) { - res = isns_do_deregister(isns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(isns, s, hostname); + isns_do_register(isns, s, hostname); } close(s); set_timeout(0, false); @@ -949,7 +949,7 @@ void isns_deregister(struct isns *isns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -961,7 +961,7 @@ isns_deregister(struct isns *isns) return; gethostname(hostname, sizeof(hostname)); - res = isns_do_deregister(isns, s, hostname); + isns_do_deregister(isns, s, hostname); close(s); set_timeout(0, false); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 19:34:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4905CCA3; Fri, 7 Nov 2014 19:34:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36140167; Fri, 7 Nov 2014 19:34:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7JYB87010991; Fri, 7 Nov 2014 19:34:11 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7JYBQU010990; Fri, 7 Nov 2014 19:34:11 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201411071934.sA7JYBQU010990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 7 Nov 2014 19:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274249 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 19:34:11 -0000 Author: zbb Date: Fri Nov 7 19:34:10 2014 New Revision: 274249 URL: https://svnweb.freebsd.org/changeset/base/274249 Log: Avoid panic in ofwbus caused by not released resource list entry After resource allocation and release, resource list entry stays non-NULL. This causes panic in ofwbus_alloc_resource() on subsequent resource allocation. Clean appropriate list entry on release to avoid this. Obtained from: Semihalf Reviewed by: ian Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ofw/ofwbus.c Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Nov 7 19:32:10 2014 (r274248) +++ head/sys/dev/ofw/ofwbus.c Fri Nov 7 19:34:10 2014 (r274249) @@ -399,11 +399,17 @@ ofwbus_adjust_resource(device_t bus, dev } static int -ofwbus_release_resource(device_t bus __unused, device_t child, int type, +ofwbus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_list_entry *rle; int error; + /* Clean resource list entry */ + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid); + if (rle != NULL) + rle->res = NULL; + if ((rman_get_flags(r) & RF_ACTIVE) != 0) { error = bus_deactivate_resource(child, type, rid, r); if (error) From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 20:10:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99D0B813; Fri, 7 Nov 2014 20:10:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C16B6C8; Fri, 7 Nov 2014 20:10:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7KAAZs026434; Fri, 7 Nov 2014 20:10:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7KAAkp026433; Fri, 7 Nov 2014 20:10:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411072010.sA7KAAkp026433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Nov 2014 20:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274250 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 20:10:10 -0000 Author: kib Date: Fri Nov 7 20:10:09 2014 New Revision: 274250 URL: https://svnweb.freebsd.org/changeset/base/274250 Log: Simplify assembler in ivy.c. Move the copying of the random bits into buffer from asm to C, which reduces amount of arguments for inline asm and simplifies constraints. Use unsigned types consistently. Submitted by: bde Approved by: secteam (delphij) Reviewed by: markm MFC after: 1 week Modified: head/sys/dev/random/ivy.c Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Fri Nov 7 19:34:10 2014 (r274249) +++ head/sys/dev/random/ivy.c Fri Nov 7 20:10:09 2014 (r274250) @@ -61,42 +61,41 @@ static struct live_entropy_source random }; static inline int -ivy_rng_store(long *buf) +ivy_rng_store(u_long *buf) { #ifdef __GNUCLIKE_ASM - long tmp; + u_long rndval; int retry; retry = RETRY_COUNT; __asm __volatile( "1:\n\t" - "rdrand %2\n\t" /* read randomness into tmp */ - "jb 2f\n\t" /* CF is set on success, exit retry loop */ + "rdrand %1\n\t" /* read randomness into tmp */ + "jc 2f\n\t" /* CF is set on success, exit retry loop */ "dec %0\n\t" /* otherwise, retry-- */ "jne 1b\n\t" /* and loop if retries are not exhausted */ - "jmp 3f\n" /* failure, retry is 0, used as return value */ - "2:\n\t" - "mov %2,%1\n\t" /* *buf = tmp */ - "3:" - : "+q" (retry), "=m" (*buf), "+q" (tmp) : : "cc"); + "2:" + : "+r" (retry), "=r" (rndval) : : "cc"); + *buf = rndval; return (retry); #else /* __GNUCLIKE_ASM */ return (0); #endif } -/* It is specifically allowed that buf is a multiple of sizeof(long) */ +/* It is required that buf length is a multiple of sizeof(u_long). */ static u_int random_ivy_read(void *buf, u_int c) { - long *b; + u_long *b, rndval; u_int count; KASSERT(c % sizeof(*b) == 0, ("partial read %d", c)); b = buf; for (count = c; count > 0; count -= sizeof(*b)) { - if (ivy_rng_store(b++) == 0) + if (ivy_rng_store(&rndval) == 0) break; + *b++ = rndval; } return (c - count); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 20:15:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13807A2C; Fri, 7 Nov 2014 20:15:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00CB97D3; Fri, 7 Nov 2014 20:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7KFN2s030526; Fri, 7 Nov 2014 20:15:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7KFNhU030525; Fri, 7 Nov 2014 20:15:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411072015.sA7KFNhU030525@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Nov 2014 20:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274251 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 20:15:24 -0000 Author: kib Date: Fri Nov 7 20:15:23 2014 New Revision: 274251 URL: https://svnweb.freebsd.org/changeset/base/274251 Log: Add DEV_MODULE_ORDERED(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/conf.h Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Fri Nov 7 20:10:09 2014 (r274250) +++ head/sys/sys/conf.h Fri Nov 7 20:15:23 2014 (r274251) @@ -227,14 +227,16 @@ struct devsw_module_data { /* Do not initialize fields hereafter */ }; -#define DEV_MODULE(name, evh, arg) \ +#define DEV_MODULE_ORDERED(name, evh, arg, ord) \ static moduledata_t name##_mod = { \ #name, \ evh, \ arg \ }; \ -DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) +DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, ord) +#define DEV_MODULE(name, evh, arg) \ + DEV_MODULE_ORDERED(name, evh, arg, SI_ORDER_MIDDLE) void clone_setup(struct clonedevs **cdp); void clone_cleanup(struct clonedevs **); From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 20:23:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC8F0CC3; Fri, 7 Nov 2014 20:23:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B84028B4; Fri, 7 Nov 2014 20:23:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7KNjeE034949; Fri, 7 Nov 2014 20:23:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7KNiUG034940; Fri, 7 Nov 2014 20:23:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411072023.sA7KNiUG034940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 7 Nov 2014 20:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274252 - in head/sys: dev/random modules/random 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 20:23:46 -0000 Author: kib Date: Fri Nov 7 20:23:43 2014 New Revision: 274252 URL: https://svnweb.freebsd.org/changeset/base/274252 Log: Fix random.ko module. - Remove duplicated sources between standard part of the kernel and module. In particular, it caused duplicated lock initialization and sysctl registration, both having bad consequences. - Add missed source files to module. - Static part of the kernel provides randomdev module, not random_adaptors. Correct dependencies. - Use cdev modules declaration macros. Approved by: secteam (delphij) Reviewed by: markm Modified: head/sys/dev/random/ivy.c head/sys/dev/random/nehemiah.c head/sys/dev/random/randomdev.c head/sys/dev/random/randomdev_soft.c head/sys/modules/random/Makefile Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Fri Nov 7 20:15:23 2014 (r274251) +++ head/sys/dev/random/ivy.c Fri Nov 7 20:23:43 2014 (r274252) @@ -132,4 +132,4 @@ rdrand_modevent(module_t mod, int type, DEV_MODULE(rdrand, rdrand_modevent, NULL); MODULE_VERSION(rdrand, 1); -MODULE_DEPEND(rdrand, random_adaptors, 1, 1, 1); +MODULE_DEPEND(rdrand, randomdev, 1, 1, 1); Modified: head/sys/dev/random/nehemiah.c ============================================================================== --- head/sys/dev/random/nehemiah.c Fri Nov 7 20:15:23 2014 (r274251) +++ head/sys/dev/random/nehemiah.c Fri Nov 7 20:23:43 2014 (r274252) @@ -157,4 +157,4 @@ nehemiah_modevent(module_t mod, int type DEV_MODULE(nehemiah, nehemiah_modevent, NULL); MODULE_VERSION(nehemiah, 1); -MODULE_DEPEND(nehemiah, random_adaptors, 1, 1, 1); +MODULE_DEPEND(nehemiah, randomdev, 1, 1, 1); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Fri Nov 7 20:15:23 2014 (r274251) +++ head/sys/dev/random/randomdev.c Fri Nov 7 20:23:43 2014 (r274252) @@ -159,15 +159,7 @@ randomdev_modevent(module_t mod __unused return (error); } -#define EARLY_2_DEV_MODULE(name, evh, arg) \ -static moduledata_t name##_mod = { \ - #name, \ - evh, \ - arg \ -}; \ -DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND) - -EARLY_2_DEV_MODULE(randomdev, randomdev_modevent, NULL); +DEV_MODULE_ORDERED(randomdev, randomdev_modevent, NULL, SI_ORDER_SECOND); MODULE_VERSION(randomdev, 1); /* ================ Modified: head/sys/dev/random/randomdev_soft.c ============================================================================== --- head/sys/dev/random/randomdev_soft.c Fri Nov 7 20:15:23 2014 (r274251) +++ head/sys/dev/random/randomdev_soft.c Fri Nov 7 20:23:43 2014 (r274252) @@ -153,21 +153,13 @@ randomdev_soft_modevent(module_t mod __u return (error); } -#define MID_DEV_MODULE(name, evh, arg) \ -static moduledata_t name##_mod = { \ - #name, \ - evh, \ - arg \ -}; \ -DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE) - #if defined(RANDOM_YARROW) -MID_DEV_MODULE(yarrow, randomdev_soft_modevent, NULL); +DEV_MODULE(yarrow, randomdev_soft_modevent, NULL); MODULE_VERSION(yarrow, 1); -MODULE_DEPEND(yarrow, random_adaptors, 1, 1, 1); +MODULE_DEPEND(yarrow, randomdev, 1, 1, 1); #endif #if defined(RANDOM_FORTUNA) -MID_DEV_MODULE(fortuna, randomdev_soft_modevent, NULL); +DEV_MODULE(fortuna, randomdev_soft_modevent, NULL); MODULE_VERSION(fortuna, 1); -MODULE_DEPEND(fortuna, random_adaptors, 1, 1, 1); +MODULE_DEPEND(fortuna, randomdev, 1, 1, 1); #endif Modified: head/sys/modules/random/Makefile ============================================================================== --- head/sys/modules/random/Makefile Fri Nov 7 20:15:23 2014 (r274251) +++ head/sys/modules/random/Makefile Fri Nov 7 20:23:43 2014 (r274252) @@ -6,8 +6,7 @@ KMOD= random SRCS= randomdev_soft.c -SRCS+= yarrow.c hash.c -SRCS+= random_harvestq.c live_entropy_sources.c +SRCS+= yarrow.c fortuna.c hash.c SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha2.c sha256c.c SRCS+= bus_if.h device_if.h vnode_if.h opt_cpu.h opt_random.h From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 20:42:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB426420; Fri, 7 Nov 2014 20:42:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7ED4A9C; Fri, 7 Nov 2014 20:42:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7KgFoT044286; Fri, 7 Nov 2014 20:42:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7KgFTR044285; Fri, 7 Nov 2014 20:42:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411072042.sA7KgFTR044285@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 7 Nov 2014 20:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274253 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 20:42:16 -0000 Author: mav Date: Fri Nov 7 20:42:15 2014 New Revision: 274253 URL: https://svnweb.freebsd.org/changeset/base/274253 Log: Fix LUN resize broken by r272911 commit. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Fri Nov 7 20:23:43 2014 (r274252) +++ head/sys/cam/ctl/ctl_backend_block.c Fri Nov 7 20:42:15 2014 (r274253) @@ -2392,7 +2392,7 @@ ctl_be_block_modify(struct ctl_be_block_ be_lun->params.lun_size_bytes = params->lun_size_bytes; - oldsize = be_lun->size_blocks; + oldsize = be_lun->size_bytes; if (be_lun->vn == NULL) error = ctl_be_block_open(softc, be_lun, req); else if (be_lun->vn->v_type == VREG) @@ -2400,7 +2400,7 @@ ctl_be_block_modify(struct ctl_be_block_ else error = ctl_be_block_modify_dev(be_lun, req); - if (error == 0 && be_lun->size_blocks != oldsize) { + if (error == 0 && be_lun->size_bytes != oldsize) { be_lun->size_blocks = be_lun->size_bytes >> be_lun->blocksize_shift; From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 21:30:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4263EDC; Fri, 7 Nov 2014 21:30:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05F8E93; Fri, 7 Nov 2014 21:30:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7LUHTk064015; Fri, 7 Nov 2014 21:30:17 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7LUHJ6064014; Fri, 7 Nov 2014 21:30:17 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201411072130.sA7LUHJ6064014@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 7 Nov 2014 21:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274254 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 21:30:17 -0000 Author: jilles Date: Fri Nov 7 21:30:16 2014 New Revision: 274254 URL: https://svnweb.freebsd.org/changeset/base/274254 Log: sh(1): Mention portability issue with shifting zero positional parameters. Per Austin Group issue #459, shifting zero positional parameters may or may not be considered an operand error (which causes the shell to exit in most cases). Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Nov 7 20:42:15 2014 (r274253) +++ head/bin/sh/sh.1 Fri Nov 7 21:30:16 2014 (r274254) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd September 21, 2014 +.Dd November 7, 2014 .Dt SH 1 .Os .Sh NAME @@ -2522,7 +2522,8 @@ and so on, decreasing the value of .Li $# by one. -If there are zero positional parameters, shifting does not do anything. +For portability, shifting if there are zero positional parameters +should be avoided, since the shell may abort. .It Ic test A built-in equivalent of .Xr test 1 . From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:42:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16244964; Sat, 8 Nov 2014 00:42:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01764342; Sat, 8 Nov 2014 00:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80gBhb061155; Sat, 8 Nov 2014 00:42:11 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80gBs5061154; Sat, 8 Nov 2014 00:42:11 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201411080042.sA80gBs5061154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 8 Nov 2014 00:42:11 +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: r274259 - stable/10/tools/tools/netmap 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 00:42:12 -0000 Author: gnn Date: Sat Nov 8 00:42:11 2014 New Revision: 274259 URL: https://svnweb.freebsd.org/changeset/base/274259 Log: MFC: 272962 Add a new option, -P, to pkt-gen which reads a single packet from a stored pcap file and transmits it instead of the default UDP packet. Reviewed by: luigi Modified: stable/10/tools/tools/netmap/pkt-gen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/10/tools/tools/netmap/pkt-gen.c Fri Nov 7 23:14:11 2014 (r274258) +++ stable/10/tools/tools/netmap/pkt-gen.c Sat Nov 8 00:42:11 2014 (r274259) @@ -202,6 +202,7 @@ struct glob_arg { int dummy_send; int virt_header; /* send also the virt_header */ int extra_bufs; /* goes in nr_arg3 */ + char *packet_file; /* -P option */ }; enum dev_type { DEV_NONE, DEV_NETMAP, DEV_PCAP, DEV_TAP }; @@ -224,6 +225,7 @@ struct targ { int affinity; struct pkt pkt; + void *frame; }; @@ -613,6 +615,28 @@ initialize_packet(struct targ *targ) indirect_payload : default_payload; int i, l0 = strlen(payload); + char errbuf[PCAP_ERRBUF_SIZE]; + pcap_t *file; + struct pcap_pkthdr *header; + const unsigned char *packet; + + /* Read a packet from a PCAP file if asked. */ + if (targ->g->packet_file != NULL) { + if ((file = pcap_open_offline(targ->g->packet_file, + errbuf)) == NULL) + D("failed to open pcap file %s", + targ->g->packet_file); + if (pcap_next_ex(file, &header, &packet) < 0) + D("failed to read packet from %s", + targ->g->packet_file); + if ((targ->frame = malloc(header->caplen)) == NULL) + D("out of memory"); + bcopy(packet, (unsigned char *)targ->frame, header->caplen); + targ->g->pkt_size = header->caplen; + pcap_close(file); + return; + } + /* create a nice NUL-terminated string */ for (i = 0; i < paylen; i += l0) { if (l0 > paylen - i) @@ -783,7 +807,6 @@ pinger_body(void *data) frame += sizeof(targ->pkt.vh) - targ->g->virt_header; size = targ->g->pkt_size + targ->g->virt_header; - if (targ->g->nthreads > 1) { D("can only ping with 1 thread"); return NULL; @@ -1038,10 +1061,15 @@ sender_body(void *data) void *frame; int size; - frame = pkt; - frame += sizeof(pkt->vh) - targ->g->virt_header; - size = targ->g->pkt_size + targ->g->virt_header; - + if (targ->frame == NULL) { + frame = pkt; + frame += sizeof(pkt->vh) - targ->g->virt_header; + size = targ->g->pkt_size + targ->g->virt_header; + } else { + frame = targ->frame; + size = targ->g->pkt_size; + } + D("start, fd %d main_fd %d", targ->fd, targ->g->main_fd); if (setaffinity(targ->thread, targ->affinity)) goto quit; @@ -1366,6 +1394,7 @@ usage(void) "\t-R rate in packets per second\n" "\t-X dump payload\n" "\t-H len add empty virtio-net-header with size 'len'\n" + "\t-P file load packet from pcap file" "", cmd); @@ -1638,7 +1667,7 @@ main(int arc, char **argv) g.virt_header = 0; while ( (ch = getopt(arc, argv, - "a:f:F:n:i:Il:d:s:D:S:b:c:o:p:T:w:WvR:XC:H:e:m:")) != -1) { + "a:f:F:n:i:Il:d:s:D:S:b:c:o:p:T:w:WvR:XC:H:e:m:P:")) != -1) { struct sf *fn; switch(ch) { @@ -1781,7 +1810,11 @@ main(int arc, char **argv) D("unrecognized monitor mode %s", optarg); } break; + case 'P': + g.packet_file = strdup(optarg); + break; } + } if (g.ifname == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:47:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D48EAD5; Sat, 8 Nov 2014 00:47:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1DA36B; Sat, 8 Nov 2014 00:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80lHvq061929; Sat, 8 Nov 2014 00:47:17 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80lHVH061927; Sat, 8 Nov 2014 00:47:17 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201411080047.sA80lHVH061927@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Sat, 8 Nov 2014 00:47: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: r274260 - in stable/10/sys/cam: ata scsi 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 00:47:18 -0000 Author: gnn Date: Sat Nov 8 00:47:16 2014 New Revision: 274260 URL: https://svnweb.freebsd.org/changeset/base/274260 Log: MFC: 273279 Add new quirks for the latest Samsung SSD, model 850. Submitted by: sbruno Modified: stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Sat Nov 8 00:42:11 2014 (r274259) +++ stable/10/sys/cam/ata/ata_da.c Sat Nov 8 00:47:16 2014 (r274260) @@ -451,6 +451,30 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Samsung 843T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7WD*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung 850 SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 850*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* + * Samsung PM853T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7GE*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Sat Nov 8 00:42:11 2014 (r274259) +++ stable/10/sys/cam/scsi/scsi_da.c Sat Nov 8 00:47:16 2014 (r274260) @@ -1126,6 +1126,30 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Samsung 843T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7WD*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung 850 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 850*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* + * Samsung PM853T Series SSDs + * 4k optimised + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7GE*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:49:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3079EC23; Sat, 8 Nov 2014 00:49:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 195EC37B; Sat, 8 Nov 2014 00:49:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80nkbm062289; Sat, 8 Nov 2014 00:49:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80nk0H062287; Sat, 8 Nov 2014 00:49:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080049.sA80nk0H062287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:49: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: r274261 - in stable/10/contrib/xz: . src/liblzma/api/lzma src/liblzma/check src/liblzma/lzma src/xz 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 00:49:46 -0000 Author: delphij Date: Sat Nov 8 00:49:45 2014 New Revision: 274261 URL: https://svnweb.freebsd.org/changeset/base/274261 Log: MFC r273498: MFV r273494: xz 5.0.7. Modified: stable/10/contrib/xz/ChangeLog stable/10/contrib/xz/THANKS stable/10/contrib/xz/TODO stable/10/contrib/xz/src/liblzma/api/lzma/block.h stable/10/contrib/xz/src/liblzma/api/lzma/version.h stable/10/contrib/xz/src/liblzma/check/crc32_fast.c stable/10/contrib/xz/src/liblzma/check/sha256.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c stable/10/contrib/xz/src/xz/coder.c stable/10/contrib/xz/src/xz/signals.c stable/10/contrib/xz/src/xz/suffix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/xz/ChangeLog ============================================================================== --- stable/10/contrib/xz/ChangeLog Sat Nov 8 00:47:16 2014 (r274260) +++ stable/10/contrib/xz/ChangeLog Sat Nov 8 00:49:45 2014 (r274261) @@ -1,6 +1,337 @@ +commit 495aaf3a5b7200a5d2bf449bbbcc0e18834607af +Author: Lasse Collin +Date: 2014-09-20 20:44:32 +0300 + + Bump version and soname for 5.0.7. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit ac6c8921d1d8d2d749d5c97f9a0b0594cc863cea +Author: Lasse Collin +Date: 2014-09-20 20:43:29 +0300 + + Update NEWS for 5.0.7. + + NEWS | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit d1b0276aafd441a3d4db9dfd5dd9880e9f834d49 +Author: Lasse Collin +Date: 2014-09-20 20:21:18 +0300 + + liblzma: Fix invalid Libs.private value in liblzma.pc. + + src/liblzma/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit cac72956b1e56788182ac14bfb25519636afd503 +Author: Lasse Collin +Date: 2014-09-20 19:42:56 +0300 + + liblzma: Fix a portability problem in Makefile.am. + + POSIX supports $< only in inference rules (suffix rules). + Using it elsewhere is a GNU make extension and doesn't + work e.g. with OpenBSD make. + + Thanks to Christian Weisgerber for the patch. + + src/liblzma/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 2cdf0875dedca3e89b02ad5ac8aa1109f902ae11 +Author: Lasse Collin +Date: 2014-09-14 19:35:45 +0300 + + Bump version and soname for 5.0.6. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 0168b6c8fbc88cae61b1f5fb41d6c33c9e127967 +Author: Lasse Collin +Date: 2014-09-14 19:33:46 +0300 + + Update NEWS for 5.0.6. + + NEWS | 7 +++++++ + 1 file changed, 7 insertions(+) + +commit 13337714e89d002af7af48d6853f977de985d7de +Author: Lasse Collin +Date: 2014-06-13 19:21:54 +0300 + + xzgrep: List xzgrep_expected_output in tests/Makefile.am. + + tests/Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit ccc728d8290c0464c7af62790b1c5528eceaae35 +Author: Lasse Collin +Date: 2014-06-13 18:58:22 +0300 + + xzgrep: Improve the test script. + + Now it should be close to the functionality of the original + version by Pavel Raiskup. + + tests/Makefile.am | 3 ++- + tests/test_scripts.sh | 24 ++++++++++++++---------- + tests/xzgrep_expected_output | 39 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 55 insertions(+), 11 deletions(-) + +commit 948f5865fe65061e215baa8ed63be570bae152ea +Author: Lasse Collin +Date: 2014-06-11 21:03:25 +0300 + + xzgrep: Add a test for the previous fix. + + This is a simplified version of Pavel Raiskup's + original patch. + + tests/test_scripts.sh | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +commit 64228d0d5cd75af31e5c330cc3a792016413fabf +Author: Lasse Collin +Date: 2014-06-11 20:43:28 +0300 + + xzgrep: exit 0 when at least one file matches. + + Mimic the original grep behavior and return exit_success when + at least one xz compressed file matches given pattern. + + Original bugreport: + https://bugzilla.redhat.com/show_bug.cgi?id=1108085 + + Thanks to Pavel Raiskup for the patch. + + src/scripts/xzgrep.in | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +commit 98d3368ef4bff0face78d6932f2156730c8cb658 +Author: Lasse Collin +Date: 2014-04-25 17:53:42 +0300 + + Build: Fix the combination of --disable-xzdec --enable-lzmadec. + + In this case "make install" could fail if the man page directory + didn't already exist at the destination. If it did exist, a + dangling symlink was created there. Now the link is omitted + instead. This isn't the best fix but it's better than the old + behavior. + + src/xzdec/Makefile.am | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +commit ba3b5dd082db2cb5973e877a74221d739c663fb4 +Author: Lasse Collin +Date: 2014-04-25 17:44:26 +0300 + + Build: Add --disable-doc to configure. + + INSTALL | 6 ++++++ + Makefile.am | 2 ++ + configure.ac | 6 ++++++ + 3 files changed, 14 insertions(+) + +commit 3d4575f2367fe8f1f2dcacba014e6c0aef388535 +Author: Lasse Collin +Date: 2014-04-24 18:06:24 +0300 + + Update INSTALL. + + Add a note about failing "make check". The source of + the problem should be fixed in libtool (if it really is + a libtool bug and not mine) but I'm unable to spend time + on that for now. Thanks to Nelson H. F. Beebe for reporting + the issue. + + Add a note about a possible need to run "ldconfig" after + "make install". + + INSTALL | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit b9f0584e3eff421eadbb6604de0b0b40bf87e129 +Author: Lasse Collin +Date: 2014-04-09 17:26:10 +0300 + + xz: Rename a variable to avoid a namespace collision on Solaris. + + I don't know the details but I have an impression that there's + no problem in practice if using GCC since people have built xz + with GCC (without patching xz), but renaming the variable cannot + hurt either. + + Thanks to Mark Ashley. + + src/xz/signals.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +commit cc41bcaf77c9c27ec09ef033fb3300e994e828e6 +Author: Lasse Collin +Date: 2014-04-26 08:45:49 +0300 + + xz: Fix a comment. + + src/xz/coder.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit e34025d666852839388f997d076e3577847dd10f +Author: Lasse Collin +Date: 2014-01-12 16:44:52 +0200 + + liblzma: Avoid C99 compound literal arrays. + + MSVC 2013 doesn't like them. Maybe they aren't so good + for readability either since many aren't used to them. + + src/liblzma/lzma/lzma_encoder_presets.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +commit 0b6168974f1fac3a06157039235b66e4161b9b42 +Author: Lasse Collin +Date: 2014-01-12 12:50:30 +0200 + + liblzma: Remove a useless C99ism from sha256.c. + + Unsurprisingly it makes no difference in compiled output. + + src/liblzma/check/sha256.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 41e436076cfdcccc7e853de73b0d56b3d6d42053 +Author: Lasse Collin +Date: 2014-01-12 12:17:08 +0200 + + xz: Fix use of wrong variable. + + Since the only call to suffix_set() uses optarg + as the argument, fixing this bug doesn't change + the behavior of the program. + + src/xz/suffix.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit c33efefd4ef0931e5795e13725d4bd2203571ce0 +Author: Lasse Collin +Date: 2014-04-26 08:37:00 +0300 + + Fix typos in comments. + + src/liblzma/check/crc32_fast.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit e560c82f1f5693d88db9dc71f656436135f17595 +Author: Lasse Collin +Date: 2013-11-26 18:20:16 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 05192b32e553eac5dfbd646b6102d10187f29a05 +Author: Lasse Collin +Date: 2013-11-26 18:20:09 +0200 + + liblzma: Document the need for block->check for lzma_block_header_decode(). + + Thanks to Tomer Chachamu. + + src/liblzma/api/lzma/block.h | 3 +++ + 1 file changed, 3 insertions(+) + +commit 0f35eafe51db7b1eb0711bc8cc829ea6896b34f4 +Author: Lasse Collin +Date: 2013-10-26 12:47:04 +0300 + + Update TODO. + + TODO | 4 ---- + 1 file changed, 4 deletions(-) + +commit fc9eaf81d718488b052e5c65f9d6f08acc858873 +Author: Lasse Collin +Date: 2013-09-11 14:40:35 +0300 + + Build: Remove a comment about Automake 1.10 from configure.ac. + + The previous commit supports silent rules and that requires + Automake 1.11. + + configure.ac | 2 -- + 1 file changed, 2 deletions(-) + +commit 090c69dda59e00fc86d0792879bd921bb1156029 +Author: Lasse Collin +Date: 2013-09-09 20:37:03 +0300 + + Build: Create liblzma.pc in a src/liblzma/Makefile.am. + + Previously it was done in configure, but doing that goes + against the Autoconf manual. Autoconf requires that it is + possible to override e.g. prefix after running configure + and that doesn't work correctly if liblzma.pc is created + by configure. + + A potential downside of this change is that now e.g. + libdir in liblzma.pc is a standalone string instead of + being defined via ${prefix}, so if one overrides prefix + when running pkg-config the libdir won't get the new value. + I don't know if this matters in practice. + + Thanks to Vincent Torri. + + configure.ac | 1 - + src/liblzma/Makefile.am | 20 ++++++++++++++++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +commit 1f35331332273de01c46897cafdb37f8e6e285db +Author: Anders F Bjorklund +Date: 2013-08-02 15:59:46 +0200 + + macosx: separate liblzma package + + macosx/build.sh | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +commit 1415f1d94644f28e07d544bc1e06b0636081abee +Author: Anders F Bjorklund +Date: 2013-08-02 15:58:44 +0200 + + macosx: set minimum to leopard + + macosx/build.sh | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +commit 41913949b93414a21ae9fb1a8e9b7cdde8b37f98 +Author: Anders F Bjorklund +Date: 2011-08-07 13:13:30 +0200 + + move configurables into variables + + macosx/build.sh | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +commit 3dffda33f47dc220bb1738564fe02effa9da4c8e +Author: Lasse Collin +Date: 2013-07-15 14:08:02 +0300 + + Build: Fix the detection of missing CRC32. + + Thanks to Vincent Torri. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit b69900ed0b2f914fc6c0a180dcb522dbe5b80ea7 Author: Lasse Collin -Date: Sun Jun 30 18:02:27 2013 +0300 +Date: 2013-06-30 18:02:27 +0300 Man pages: Use similar syntax for synopsis as in xz. @@ -10,38 +341,56 @@ Date: Sun Jun 30 18:02:27 2013 +0300 didn't mention these man pages in his bug report, but it's nice to be consistent. + src/lzmainfo/lzmainfo.1 | 4 ++-- + src/scripts/xzmore.1 | 6 +++--- + src/xzdec/xzdec.1 | 10 +++++----- + 3 files changed, 10 insertions(+), 10 deletions(-) + commit cf4a1e1879d89be314ef3c064bd2656ea452f87e Author: Lasse Collin -Date: Sun Jun 30 15:55:09 2013 +0300 +Date: 2013-06-30 15:55:09 +0300 Update NEWS for 5.0.5. + NEWS | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 52 insertions(+) + commit cb94bb6d1f34e1e93c2d634ea9c3b7dfb3981d05 Author: Lasse Collin -Date: Sun Jun 30 15:54:38 2013 +0300 +Date: 2013-06-30 15:54:38 +0300 Bump version and soname for 5.0.5. + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + commit b7dee202d5b041ccae028d0c5433b83cecbe9e5d Author: Lasse Collin -Date: Fri Jun 28 23:56:17 2013 +0300 +Date: 2013-06-28 23:56:17 +0300 xz: Fix return value type in io_write_buf(). It didn't affect the behavior of the code since -1 becomes true anyway. + src/xz/file_io.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 265e7b44d804b47373f10b7da28350db7611cea6 Author: Lasse Collin -Date: Fri Jun 28 18:46:13 2013 +0300 +Date: 2013-06-28 18:46:13 +0300 xz: Remove an outdated NetBSD-specific comment. Nowadays errno == EFTYPE is documented in open(2). + src/xz/file_io.c | 4 ---- + 1 file changed, 4 deletions(-) + commit 78c2f8db902195468b8249c432252a6b281db836 Author: Lasse Collin -Date: Fri Jun 28 18:09:47 2013 +0300 +Date: 2013-06-28 18:09:47 +0300 xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls. @@ -51,9 +400,12 @@ Date: Fri Jun 28 18:09:47 2013 +0300 F_SETFL is always 0 (at least accorinding to fcntl(2) from man-pages 3.51). + src/xz/file_io.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + commit 91750dff8f2c654ff636f12a2acdffe5492374b3 Author: Lasse Collin -Date: Fri Jun 28 17:36:47 2013 +0300 +Date: 2013-06-28 17:36:47 +0300 xz: Fix use of wrong variable in a fcntl() call. @@ -69,9 +421,12 @@ Date: Fri Jun 28 17:36:47 2013 +0300 indicate when the flags should be restored instead of relying on a special value in stdout_flags. + src/xz/file_io.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + commit e11888a79a4a77a69afde60445880d44f63d01aa Author: Lasse Collin -Date: Wed Jun 26 13:30:57 2013 +0300 +Date: 2013-06-26 13:30:57 +0300 xz: Check the value of lzma_stream_flags.version in --list. @@ -80,9 +435,12 @@ Date: Wed Jun 26 13:30:57 2013 +0300 then this check becomes important and will stop the old xz from trying to parse files that it won't understand. + src/xz/list.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + commit f39ddd88f3222219ada88998cf30abfdd3e0e96c Author: Lasse Collin -Date: Wed Jun 26 12:17:00 2013 +0300 +Date: 2013-06-26 12:17:00 +0300 Build: Require Automake 1.12 and use serial-tests option. @@ -95,9 +453,12 @@ Date: Wed Jun 26 12:17:00 2013 +0300 in XZ Utils but they hide the progress output from test_compress.sh. + configure.ac | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + commit cb84e278027a90e9827a6f4d3bb0b4d4744a2fbb Author: Lasse Collin -Date: Sun Jun 23 17:36:47 2013 +0300 +Date: 2013-06-23 17:36:47 +0300 xz: Validate Uncompressed Size from Block Header in list.c. @@ -107,23 +468,32 @@ Date: Sun Jun 23 17:36:47 2013 +0300 show such files as corrupt instead of showing the Uncompressed Size from Index. + src/xz/list.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + commit f01780fce454c7489f7dcbf806299b50da5f51b7 Author: Lasse Collin -Date: Wed Jun 26 10:58:58 2013 +0300 +Date: 2013-06-26 10:58:58 +0300 Update THANKS. + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + commit d98ede7d700b892e32d9c2f46563b6ebc566786d Author: Lasse Collin -Date: Fri Jun 21 22:04:45 2013 +0300 +Date: 2013-06-21 22:04:45 +0300 xz: Make the man page more friendly to doclifter. Thanks to Eric S. Raymond. + src/xz/xz.1 | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + commit 19b447b64b3f520cd5b11429000b092f7c76709b Author: Lasse Collin -Date: Fri Jun 21 21:54:59 2013 +0300 +Date: 2013-06-21 21:54:59 +0300 xz: A couple of man page fixes. @@ -133,9 +503,12 @@ Date: Fri Jun 21 21:54:59 2013 +0300 Thanks to DevHC who reported these issues on IRC to me on 2012-12-14. + src/xz/xz.1 | 35 +++++++++++++++++++++++------------ + 1 file changed, 23 insertions(+), 12 deletions(-) + commit 45edf2966fc9a4d2eae8f84b2fa027fb4fa1df8b Author: Lasse Collin -Date: Fri Jun 21 21:50:26 2013 +0300 +Date: 2013-06-21 21:50:26 +0300 xz: Fix interaction between preset and custom filter chains. @@ -158,15 +531,22 @@ Date: Fri Jun 21 21:50:26 2013 +0300 Thanks to Conley Moorhous. + src/xz/coder.c | 35 +++++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 14 deletions(-) + commit b065984e5a9272eb50bc0c6d3731e6199c0ae8a8 Author: Lasse Collin -Date: Fri Apr 8 17:53:05 2011 +0300 +Date: 2011-04-08 17:53:05 +0300 xz: Change size_t to uint32_t in a few places. + src/xz/coder.c | 6 +++--- + src/xz/coder.h | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + commit 32be621f52f2e1686db88baa7b01dc1ae338f426 Author: Lasse Collin -Date: Sat Apr 27 22:07:46 2013 +0300 +Date: 2013-04-27 22:07:46 +0300 Build: Use -Wvla with GCC if supported. @@ -175,9 +555,12 @@ Date: Sat Apr 27 22:07:46 2013 +0300 future either to stay compatible with C11 without requiring any optional C11 features. + configure.ac | 1 + + 1 file changed, 1 insertion(+) + commit efb07cfba65e9e05984c02cd796c1b0338ce04dc Author: Lasse Collin -Date: Mon Apr 15 19:29:09 2013 +0300 +Date: 2013-04-15 19:29:09 +0300 xzdec: Improve the --help message. @@ -189,23 +572,32 @@ Date: Mon Apr 15 19:29:09 2013 +0300 because I find it easier to spot the ignored vs. non-ignored options from the list that way. + src/xzdec/xzdec.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + commit e3c8be13699e2813f5e2879d8187444b46d82d89 Author: Lasse Collin -Date: Fri Apr 5 19:25:40 2013 +0300 +Date: 2013-04-05 19:25:40 +0300 Update THANKS. + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + commit ad8282efe483612f6b5544f9a0d2e4914fb2532a Author: Jeff Bastian -Date: Wed Apr 3 13:59:17 2013 +0200 +Date: 2013-04-03 13:59:17 +0200 xzgrep: make the '-h' option to be --no-filename equivalent * src/scripts/xzgrep.in: Accept the '-h' option in argument parsing. + src/scripts/xzgrep.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 9271a3eb0e022b23e8712154be851d0afe4c02e4 Author: Lasse Collin -Date: Fri Apr 5 19:34:09 2013 +0300 +Date: 2013-04-05 19:34:09 +0300 liblzma: Be less picky in lzma_alone_decoder(). @@ -231,9 +623,14 @@ Date: Fri Apr 5 19:34:09 2013 +0300 src/liblzma/common/alone_decoder.c src/liblzma/common/alone_decoder.h + src/liblzma/common/alone_decoder.c | 22 ++++++++++++++-------- + src/liblzma/common/alone_decoder.h | 5 +++-- + src/liblzma/common/auto_decoder.c | 2 +- + 3 files changed, 18 insertions(+), 11 deletions(-) + commit 211b931cee58626c1d2e021810cb108cb5cbc10f Author: Lasse Collin -Date: Tue Mar 5 19:14:50 2013 +0200 +Date: 2013-03-05 19:14:50 +0200 Avoid unneeded use of awk in xzless. @@ -243,9 +640,12 @@ Date: Tue Mar 5 19:14:50 2013 +0200 Thanks to Ariel P for the patch. + src/scripts/xzless.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + commit 9f62fd9605eade23b62b07a235d1f02156f7a5c6 Author: Jonathan Nieder -Date: Mon Nov 19 00:10:10 2012 -0800 +Date: 2012-11-19 00:10:10 -0800 xzless: Make "less -V" parsing more robust @@ -282,46 +682,66 @@ Date: Mon Nov 19 00:10:10 2012 -0800 Reported-by: Jörg-Volker Peetz Signed-off-by: Jonathan Nieder + src/scripts/xzless.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + commit 1d05980f5b5c2c94d833001daccacce4a466876e Author: Lasse Collin -Date: Wed Oct 3 15:54:24 2012 +0300 +Date: 2012-10-03 15:54:24 +0300 xz: Fix the note about --rsyncable on the man page. + src/xz/xz.1 | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + commit fb68497333598688d309a92838d91fd560f7e9f0 Author: Lasse Collin -Date: Fri Sep 28 20:11:09 2012 +0300 +Date: 2012-09-28 20:11:09 +0300 xz: Improve handling of failed realloc in xrealloc. Thanks to Jim Meyering. + src/xz/util.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + commit 75013db6d4d63c195bd8b8d45729b4be0665a812 Author: Lasse Collin -Date: Sat Dec 15 20:01:02 2012 +0200 +Date: 2012-12-15 20:01:02 +0200 A few typo fixes to comments and the xz man page. Thanks to Jim Meyering. + configure.ac | 2 +- + src/liblzma/check/sha256.c | 1 - + src/xz/xz.1 | 4 ++-- + 3 files changed, 3 insertions(+), 4 deletions(-) + commit e44b21839b1dcbac5097be39b87dd2ddb6e114fd Author: Lasse Collin -Date: Thu Aug 2 17:13:30 2012 +0300 +Date: 2012-08-02 17:13:30 +0300 Build: Bump gettext version requirement to 0.18. Otherwise too old version of m4/lib-link.m4 gets included when autoreconf -fi is run. + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit fd3dbb23ca7e75a7a888d7e897c381dc06308307 Author: Lasse Collin -Date: Thu Jul 5 07:36:28 2012 +0300 +Date: 2012-07-05 07:36:28 +0300 Tests: Remove tests/test_block.c that had gotten committed accidentally. + tests/test_block.c | 52 ---------------------------------------------------- + 1 file changed, 52 deletions(-) + commit 05a735d279d74af437c31f25f69aded4713c1a3d Author: Lasse Collin -Date: Thu Jul 5 07:33:35 2012 +0300 +Date: 2012-07-05 07:33:35 +0300 Build: Include macosx/build.sh in the distribution. @@ -329,55 +749,81 @@ Date: Thu Jul 5 07:33:35 2012 +0300 few people have seen it since it hasn't been included in the release tarballs. :-( + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + commit 4e6d62793b5e7b87edcc93c7ded072c1ecd94173 Author: Lasse Collin -Date: Thu Jul 5 07:24:45 2012 +0300 +Date: 2012-07-05 07:24:45 +0300 Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. + debug/README | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit dd95b5e7614baf1f07a1316b5106bd616a9efa79 Author: Lasse Collin -Date: Thu Jul 5 07:23:17 2012 +0300 +Date: 2012-07-05 07:23:17 +0300 Include debug/translation.bash in the distribution. Also fix the script name mentioned in README. + README | 4 ++-- + debug/Makefile.am | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + commit 20778053a07eb90c159c1377ca8dc05a90fd530b Author: Lasse Collin -Date: Fri Jun 22 14:36:16 2012 +0300 +Date: 2012-06-22 14:36:16 +0300 xz: Update man page date to match the latest update. + src/xz/xz.1 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 2cefa84af676da37d7e9c466d55d46c67ab00c22 Author: Lasse Collin -Date: Fri Jun 22 10:25:43 2012 +0300 +Date: 2012-06-22 10:25:43 +0300 Bump version and soname for 5.0.4. + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + commit 433fec191a17e45690809e54146ea7a773f54cff Author: Lasse Collin -Date: Fri Jun 22 10:25:09 2012 +0300 +Date: 2012-06-22 10:25:09 +0300 Update NEWS for 5.0.4. + NEWS | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + commit 711fa680f552a4003df73b37e6dc4d6e00b47bcd Author: Lasse Collin -Date: Mon Jun 18 21:27:47 2012 +0300 +Date: 2012-06-18 21:27:47 +0300 Docs: Language fix to 01_compress_easy.c. Thanks to Jonathan Nieder. + doc/examples/01_compress_easy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 3d7ab1dc61a75c560828be5df96598388b771456 Author: Lasse Collin -Date: Thu Jun 14 20:15:30 2012 +0300 +Date: 2012-06-14 20:15:30 +0300 Fix the top-level Makefile.am for the new example programs. + Makefile.am | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + commit ef8b8e5f111469b5bc005975f7abb9abbd372b25 Author: Lasse Collin -Date: Thu Jun 14 10:52:33 2012 +0300 +Date: 2012-06-14 10:52:33 +0300 Docs: Add new example programs. @@ -385,9 +831,16 @@ Date: Thu Jun 14 10:52:33 2012 +0300 human-readable error messages. More tutorial-like examples are needed but these are a start. + doc/examples/00_README.txt | 27 ++++ + doc/examples/01_compress_easy.c | 297 ++++++++++++++++++++++++++++++++++++++ + doc/examples/02_decompress.c | 287 ++++++++++++++++++++++++++++++++++++ + doc/examples/03_compress_custom.c | 193 +++++++++++++++++++++++++ + doc/examples/Makefile | 23 +++ + 5 files changed, 827 insertions(+) + commit 75c149bc8045a26f8bc719cb8ed20668dab79091 Author: Lasse Collin -Date: Thu Jun 14 10:33:27 2012 +0300 +Date: 2012-06-14 10:33:27 +0300 Docs: Move xz_pipe_comp.c and xz_pipe_decomp.c to doc/examples_old. @@ -395,49 +848,73 @@ Date: Thu Jun 14 10:33:27 2012 +0300 copied the decompressor bug from xz_pipe_decomp.c he has an example how to easily fix it. + doc/examples/xz_pipe_comp.c | 127 -------------------------------------- + doc/examples/xz_pipe_decomp.c | 123 ------------------------------------ + doc/examples_old/xz_pipe_comp.c | 127 ++++++++++++++++++++++++++++++++++++++ + doc/examples_old/xz_pipe_decomp.c | 123 ++++++++++++++++++++++++++++++++++++ + 4 files changed, 250 insertions(+), 250 deletions(-) + commit 456307ebf947a5f50bd995d617b99c1215572308 Author: Lasse Collin -Date: Thu Jun 14 10:33:01 2012 +0300 +Date: 2012-06-14 10:33:01 +0300 Docs: Fix a bug in xz_pipe_decomp.c example program. + doc/examples/xz_pipe_decomp.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + commit 4c310b8a29bc257e6ccbd2310f12f258678f3fef Author: Lasse Collin -Date: Thu May 31 15:53:25 2012 +0300 +Date: 2012-05-31 15:53:25 +0300 Translations: Update the Italian translation. Thanks to Milo Casagrande. + po/it.po | 311 ++++++++++++++++++++++++++++++--------------------------------- + 1 file changed, 146 insertions(+), 165 deletions(-) + commit ec32b79366dc47a55ea877589df9e8509ba113a7 Author: Lasse Collin -Date: Wed May 30 23:15:07 2012 +0300 +Date: 2012-05-30 23:15:07 +0300 Translations: Update the French translation. Thanks to Adrien Nader. + po/fr.po | 237 +++++++++++++++++++++++++++++++-------------------------------- + 1 file changed, 118 insertions(+), 119 deletions(-) + commit dd06f40e4dd7649525e4f28d890dc238a3aa37e5 Author: Lasse Collin -Date: Tue May 29 22:26:27 2012 +0300 +Date: 2012-05-29 22:26:27 +0300 Translations: Update the German translation. + po/de.po | 169 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 91 insertions(+), 78 deletions(-) + commit c66808d1f55d0149ed57c536cc9b52e9c8b583bc Author: Lasse Collin -Date: Tue May 29 22:12:57 2012 +0300 +Date: 2012-05-29 22:12:57 +0300 Translations: Update Polish translation. + po/pl.po | 150 ++++++++++++++++++++++++++++++++++----------------------------- + 1 file changed, 82 insertions(+), 68 deletions(-) + commit 556c22dfed195c1466b298183b850d6c28544900 Author: Lasse Collin -Date: Tue May 29 13:10:36 2012 +0300 +Date: 2012-05-29 13:10:36 +0300 Preliminary NEWS for 5.0.4. + NEWS | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + commit dd13b66bf582f49d3aec36e3410ff8541b7506da Author: Lasse Collin -Date: Mon May 28 20:42:11 2012 +0300 +Date: 2012-05-28 20:42:11 +0300 liblzma: Fix possibility of incorrect LZMA_BUF_ERROR. @@ -465,21 +942,32 @@ Date: Mon May 28 20:42:11 2012 +0300 A similar bug was fixed in XZ Embedded on 2011-09-19. + src/liblzma/simple/simple_coder.c | 2 +- + tests/Makefile.am | 4 +- + tests/test_bcj_exact_size.c | 112 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 116 insertions(+), 2 deletions(-) + commit a0223bf796fdaad51a11ad02c4195c694849cc78 Author: Lasse Collin -Date: Mon May 28 15:38:32 2012 +0300 +Date: 2012-05-28 15:38:32 +0300 Update THANKS. + THANKS | 1 + + 1 file changed, 1 insertion(+) + commit 86e57e4bfefe3fd8e13615c41604165bb2359501 Author: Lasse Collin -Date: Mon May 28 15:37:43 2012 +0300 +Date: 2012-05-28 15:37:43 +0300 xz: Don't show a huge number in -vv when memory limit is disabled. + src/xz/message.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + commit 13e44a94da19d1ef14832ff12d3877a6fd2c54c0 Author: Lasse Collin -Date: Sun May 27 22:30:17 2012 +0300 +Date: 2012-05-27 22:30:17 +0300 xz: Document the "summary" lines of --robot -lvv. @@ -487,30 +975,43 @@ Date: Sun May 27 22:30:17 2012 +0300 The new columns added in the master branch aren't necessarily stable yet. + src/xz/xz.1 | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + commit 2f90345e13ab8fea4de45a4f1caa73ebc63a62e7 Author: Lasse Collin -Date: Sun May 27 21:53:20 2012 +0300 +Date: 2012-05-27 21:53:20 +0300 xz: Fix output of verbose --robot --list modes. It printed the filename in "filename (x/y)" format which it obviously shouldn't do in robot mode. + src/xz/message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit 8d4864f53ffae5d862c691a0b334a6b69bc5366e Author: Lasse Collin -Date: Thu May 10 21:15:17 2012 +0300 +Date: 2012-05-10 21:15:17 +0300 Update THANKS. + THANKS | 1 + + 1 file changed, 1 insertion(+) + commit 35e9c58abb0ce3993da844aaeaa3e7231cd2be8f Author: Lasse Collin -Date: Thu May 10 21:14:16 2012 +0300 +Date: 2012-05-10 21:14:16 +0300 Docs: Cleanup line wrapping a bit. + README | 12 ++++++------ + doc/history.txt | 49 +++++++++++++++++++++++++------------------------ + 2 files changed, 31 insertions(+), 30 deletions(-) + commit 532b3e4c568a228309b56f95c13435fd078dbe02 Author: Benno Schulenberg -Date: Tue Mar 13 22:04:04 2012 +0100 +Date: 2012-03-13 22:04:04 +0100 Fix a few typos and add some missing articles in some documents. @@ -518,42 +1019,64 @@ Date: Tue Mar 13 22:04:04 2012 +0100 Signed-off-by: Benno Schulenberg + AUTHORS | 6 +++--- + README | 42 ++++++++++++++++++++--------------------- + doc/faq.txt | 24 ++++++++++++------------ + doc/history.txt | 58 ++++++++++++++++++++++++++++----------------------------- + 4 files changed, 65 insertions(+), 65 deletions(-) + commit afb6ce8c82ffef8f2505a3759da72a733c7b0b8f Author: Lasse Collin -Date: Sun Apr 29 11:51:25 2012 +0300 +Date: 2012-04-29 11:51:25 +0300 Windows: Update notes about static linking with MSVC. + windows/README-Windows.txt | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + commit 7c3ba2ed5c3c878d4a14ca549b46dbff60c6d565 Author: Lasse Collin -Date: Thu Apr 19 15:25:26 2012 +0300 +Date: 2012-04-19 15:25:26 +0300 liblzma: Remove outdated comments. + src/liblzma/simple/simple_coder.c | 3 --- + src/liblzma/simple/simple_private.h | 3 +-- + 2 files changed, 1 insertion(+), 5 deletions(-) + commit f55db9c187651094f43881c49db2b2d9ffee6b80 Author: Lasse Collin -Date: Thu Apr 19 14:17:52 2012 +0300 +Date: 2012-04-19 14:17:52 +0300 DOS: Link against DJGPP's libemu to support FPU emulation. This way xz should work on 386SX and 486SX. Floating point only is needed for verbose output in xz. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:51:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D7A9D5D; Sat, 8 Nov 2014 00:51:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E0EC5FE; Sat, 8 Nov 2014 00:51:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80pWqw065542; Sat, 8 Nov 2014 00:51:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80pVGt065532; Sat, 8 Nov 2014 00:51:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080051.sA80pVGt065532@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:51: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: r274262 - stable/10/usr.bin/gzip 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 00:51:33 -0000 Author: delphij Date: Sat Nov 8 00:51:31 2014 New Revision: 274262 URL: https://svnweb.freebsd.org/changeset/base/274262 Log: MFC r273507: Sync with NetBSD. Modified: stable/10/usr.bin/gzip/Makefile stable/10/usr.bin/gzip/gzip.1 stable/10/usr.bin/gzip/gzip.c stable/10/usr.bin/gzip/zmore stable/10/usr.bin/gzip/zmore.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/Makefile ============================================================================== --- stable/10/usr.bin/gzip/Makefile Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/Makefile Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2011/06/21 13:25:45 joerg Exp $ +# $NetBSD: Makefile,v 1.18 2013/11/13 11:12:24 pettai Exp $ # $FreeBSD$ .include @@ -21,7 +21,8 @@ SCRIPTS= gzexe zdiff zforce zmore znew MLINKS+= gzip.1 gunzip.1 \ gzip.1 gzcat.1 \ gzip.1 zcat.1 \ - zdiff.1 zcmp.1 + zdiff.1 zcmp.1 \ + zmore.1 zless.1 LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip \ ${BINDIR}/gzip ${BINDIR}/gzcat \ Modified: stable/10/usr.bin/gzip/gzip.1 ============================================================================== --- stable/10/usr.bin/gzip/gzip.1 Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/gzip.1 Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.21 2011/06/19 02:22:36 christos Exp $ +.\" $NetBSD: gzip.1,v 1.23 2014/03/18 18:20:45 riastradh Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. Modified: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/gzip.c Sat Nov 8 00:51:31 2014 (r274262) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */ +/* $NetBSD: gzip.c,v 1.106 2014/10/18 08:33:30 snj Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -158,7 +158,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20111009"; +static const char gzip_version[] = "FreeBSD gzip 20141022"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -1769,7 +1769,7 @@ handle_stdout(void) return; } #endif - /* If stdin is a file use it's mtime, otherwise use current time */ + /* If stdin is a file use its mtime, otherwise use current time */ ret = fstat(STDIN_FILENO, &sb); #ifndef SMALL @@ -2110,7 +2110,7 @@ static void display_license(void) { - fprintf(stderr, "%s (based on NetBSD gzip 20111009)\n", gzip_version); + fprintf(stderr, "%s (based on NetBSD gzip 20141018)\n", gzip_version); fprintf(stderr, "%s\n", gzip_copyright); exit(0); } Modified: stable/10/usr.bin/gzip/zmore ============================================================================== --- stable/10/usr.bin/gzip/zmore Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/zmore Sat Nov 8 00:51:31 2014 (r274262) @@ -1,7 +1,8 @@ #!/bin/sh - # -# $NetBSD: zmore,v 1.3 2004/03/29 09:59:42 wiz Exp $ -# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $ +# $NetBSD: zmore,v 1.5 2013/12/06 13:33:15 pettai Exp $ +# +# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $ # #- # Copyright (c) 2003 Todd C. Miller @@ -42,15 +43,21 @@ while test $# -ne 0; do esac done +if [ `basename $0` = "zless" ] ; then + pager=${PAGER-less} +else + pager=${PAGER-more} +fi + # No files means read from stdin if [ $# -eq 0 ]; then - gzip -cdfq 2>&1 | ${PAGER-more} $flags + gzip -cdfq 2>&1 | $pager $flags exit 0 fi oterm=`stty -g 2>/dev/null` while test $# -ne 0; do - gzip -cdfq "$1" 2>&1 | ${PAGER-more} $flags + gzip -cdfq "$1" 2>&1 | $pager $flags prev="$1" shift if tty -s && test -n "$oterm" -a $# -gt 0; then Modified: stable/10/usr.bin/gzip/zmore.1 ============================================================================== --- stable/10/usr.bin/gzip/zmore.1 Sat Nov 8 00:49:45 2014 (r274261) +++ stable/10/usr.bin/gzip/zmore.1 Sat Nov 8 00:51:31 2014 (r274262) @@ -1,5 +1,5 @@ -.\" $NetBSD: zmore.1,v 1.3 2003/12/28 12:47:52 wiz Exp $ -.\" $OpenBSD: zmore.1,v 1.3 2003/06/23 21:00:48 deraadt Exp $ +.\" $NetBSD: zmore.1,v 1.4 2013/11/12 21:58:37 pettai Exp $ +.\" $OpenBSD: zmore.1,v 1.10 2009/08/16 09:41:08 sobrado Exp $ .\" .\" Copyright (c) 2003 Todd C. Miller .\" @@ -20,16 +20,20 @@ .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ -.Dd February 6, 2011 +.Dd October 22, 2014 .Dt ZMORE 1 .Os .Sh NAME -.Nm zmore +.Nm zmore , +.Nm zless .Nd view compressed files .Sh SYNOPSIS .Nm zmore .Op Ar flags -.Op Ar file ... +.Op Ar +.Nm zless +.Op Ar flags +.Op Ar .Sh DESCRIPTION .Nm is a filter that allows the viewing of files compressed with Lempel-Ziv @@ -51,6 +55,14 @@ that are specified are passed to the use .Pa /usr/bin/more by default). .Pp +.Nm zless +is equivalent to +.Nm zmore +but uses +.Xr less 1 +as a pager instead of +.Xr more 1 . +.Pp When multiple files are specified, .Nm will pause at the end of each file and present the following prompt to the user: @@ -86,7 +98,11 @@ style compression since there is no suff Program used to display files. If unset, .Pa /usr/bin/more -is used. +is used +.Pq Nm zmore +or +.Pa /usr/bin/less +.Pq Nm zless . .El .Sh SEE ALSO .Xr compress 1 , From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 00:55:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331B0EB1; Sat, 8 Nov 2014 00:55:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E65615; Sat, 8 Nov 2014 00:55:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA80t6wC066517; Sat, 8 Nov 2014 00:55:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA80t6Mq066516; Sat, 8 Nov 2014 00:55:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080055.sA80t6Mq066516@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 00:55: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: r274263 - stable/10/contrib/netcat 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 00:55:07 -0000 Author: delphij Date: Sat Nov 8 00:55:06 2014 New Revision: 274263 URL: https://svnweb.freebsd.org/changeset/base/274263 Log: MFC r273619: MFV r273617: netcat from OpenBSD 5.6. Modified: stable/10/contrib/netcat/netcat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netcat/netcat.c ============================================================================== --- stable/10/contrib/netcat/netcat.c Sat Nov 8 00:51:31 2014 (r274262) +++ stable/10/contrib/netcat/netcat.c Sat Nov 8 00:55:06 2014 (r274263) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.117 2013/10/26 21:33:29 sthen Exp $ */ +/* $OpenBSD: netcat.c,v 1.122 2014/07/20 01:38:40 guenther Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -155,9 +155,6 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; -#if 0 - rtableid = getrtable(); -#endif while ((ch = getopt_long(argc, argv, "46DdEe:FhI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", @@ -662,7 +659,7 @@ remote_connect(const char *host, const c if (bind(s, (struct sockaddr *)ares->ai_addr, ares->ai_addrlen) < 0) - errx(1, "bind failed: %s", strerror(errno)); + err(1, "bind failed"); freeaddrinfo(ares); } @@ -751,7 +748,7 @@ local_listen(char *host, char *port, str res0->ai_protocol)) < 0) continue; - if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_SETFIB, + if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, sizeof(rtableid)) == -1)) err(1, "setsockopt SO_SETFIB"); @@ -796,12 +793,12 @@ void readwrite(int nfd) { struct pollfd pfd[2]; - unsigned char buf[16384]; + unsigned char buf[16 * 1024]; int n, wfd = fileno(stdin); int lfd = fileno(stdout); int plen; - plen = 2048; + plen = sizeof(buf); /* Setup Network FD */ pfd[0].fd = nfd; @@ -816,8 +813,9 @@ readwrite(int nfd) sleep(iflag); if ((n = poll(pfd, 2 - dflag, timeout)) < 0) { + int saved_errno = errno; close(nfd); - err(1, "Polling Error"); + errc(1, saved_errno, "Polling Error"); } if (n == 0) From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 02:40:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDACB9A8; Sat, 8 Nov 2014 02:40:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A95ECE36; Sat, 8 Nov 2014 02:40:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82e1da013107; Sat, 8 Nov 2014 02:40:01 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82e1AZ013106; Sat, 8 Nov 2014 02:40:01 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080240.sA82e1AZ013106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:40:01 +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: r274264 - stable/10/sys/netinet 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 02:40:01 -0000 Author: bryanv Date: Sat Nov 8 02:40:00 2014 New Revision: 274264 URL: https://svnweb.freebsd.org/changeset/base/274264 Log: MFC r272797: Check for mbuf copy failure when there are multiple multicast sockets This partitular case is the only path where the mbuf could be NULL. udp_append() checked for a NULL mbuf only after invoking the tunneling callback. Our only in tree tunneling callback - SCTP - assumed a non NULL mbuf, and it is a bit odd to make the callbacks responsible for checking this condition. This also reduces the differences between the IPv4 and IPv6 code. Modified: stable/10/sys/netinet/udp_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/udp_usrreq.c ============================================================================== --- stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 00:55:06 2014 (r274263) +++ stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:40:00 2014 (r274264) @@ -307,9 +307,6 @@ udp_append(struct inpcb *inp, struct ip return; } - if (n == NULL) - return; - off += sizeof(struct udphdr); #ifdef IPSEC @@ -568,8 +565,10 @@ udp_input(struct mbuf *m, int off) if (last != NULL) { struct mbuf *n; - n = m_copy(m, 0, M_COPYALL); - udp_append(last, ip, n, iphlen, &udp_in); + if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + udp_append(last, ip, n, iphlen, + &udp_in); + } INP_RUNLOCK(last); } last = inp; From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 02:47:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3E76C0F; Sat, 8 Nov 2014 02:47:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5C5BF03; Sat, 8 Nov 2014 02:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82lNNB017364; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82lNBP017363; Sat, 8 Nov 2014 02:47:23 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080247.sA82lNBP017363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:47:23 +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: r274265 - stable/10/sys/netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 02:47:24 -0000 Author: bryanv Date: Sat Nov 8 02:47:23 2014 New Revision: 274265 URL: https://svnweb.freebsd.org/changeset/base/274265 Log: MFC r272801: Move the calls to u_tun_func() into udp6_append() A similar cleanup for UDPv4 was performed in r220620. Modified: stable/10/sys/netinet6/udp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:40:00 2014 (r274264) +++ stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) @@ -139,9 +139,18 @@ udp6_append(struct inpcb *inp, struct mb { struct socket *so; struct mbuf *opts; + struct udpcb *up; INP_LOCK_ASSERT(inp); + /* + * Engage the tunneling protocol. + */ + up = intoudpcb(inp); + if (up->u_tun_func != NULL) { + (*up->u_tun_func)(n, off, inp); + return; + } #ifdef IPSEC /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { @@ -359,20 +368,7 @@ udp6_input(struct mbuf **mp, int *offp, if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { INP_RLOCK(last); - up = intoudpcb(last); - if (up->u_tun_func == NULL) { - udp6_append(last, n, off, &fromsa); - } else { - /* - * Engage the tunneling - * protocol we will have to - * leave the info_lock up, - * since we are hunting - * through multiple UDP's. - * - */ - (*up->u_tun_func)(n, off, last); - } + udp6_append(last, n, off, &fromsa); INP_RUNLOCK(last); } } @@ -402,16 +398,8 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(last); INP_INFO_RUNLOCK(pcbinfo); - up = intoudpcb(last); UDP_PROBE(receive, NULL, last, ip6, last, uh); - if (up->u_tun_func == NULL) { - udp6_append(last, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - (*up->u_tun_func)(m, off, last); - } + udp6_append(last, m, off, &fromsa); INP_RUNLOCK(last); return (IPPROTO_DONE); } @@ -490,15 +478,7 @@ udp6_input(struct mbuf **mp, int *offp, } } UDP_PROBE(receive, NULL, inp, ip6, inp, uh); - if (up->u_tun_func == NULL) { - udp6_append(inp, m, off, &fromsa); - } else { - /* - * Engage the tunneling protocol. - */ - - (*up->u_tun_func)(m, off, inp); - } + udp6_append(inp, m, off, &fromsa); INP_RUNLOCK(inp); return (IPPROTO_DONE); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 02:53:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DC66DF3; Sat, 8 Nov 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 874FFFC4; Sat, 8 Nov 2014 02:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA82ru4D021532; Sat, 8 Nov 2014 02:53:56 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA82ru4G021530; Sat, 8 Nov 2014 02:53:56 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411080253.sA82ru4G021530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sat, 8 Nov 2014 02:53:56 +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: r274266 - in stable/10/sys: netinet netinet6 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 02:53:56 -0000 Author: bryanv Date: Sat Nov 8 02:53:55 2014 New Revision: 274266 URL: https://svnweb.freebsd.org/changeset/base/274266 Log: MFC r272844: Add missing UDP multicast receive dtrace probes Modified: stable/10/sys/netinet/udp_usrreq.c stable/10/sys/netinet6/udp6_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/udp_usrreq.c ============================================================================== --- stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) +++ stable/10/sys/netinet/udp_usrreq.c Sat Nov 8 02:53:55 2014 (r274266) @@ -566,6 +566,8 @@ udp_input(struct mbuf *m, int off) struct mbuf *n; if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { + UDP_PROBE(receive, NULL, last, ip, + last, uh); udp_append(last, ip, n, iphlen, &udp_in); } @@ -597,6 +599,7 @@ udp_input(struct mbuf *m, int off) INP_INFO_RUNLOCK(pcbinfo); goto badunlocked; } + UDP_PROBE(receive, NULL, last, ip, last, uh); udp_append(last, ip, m, iphlen, &udp_in); INP_RUNLOCK(last); INP_INFO_RUNLOCK(pcbinfo); Modified: stable/10/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:47:23 2014 (r274265) +++ stable/10/sys/netinet6/udp6_usrreq.c Sat Nov 8 02:53:55 2014 (r274266) @@ -368,6 +368,8 @@ udp6_input(struct mbuf **mp, int *offp, if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { INP_RLOCK(last); + UDP_PROBE(receive, NULL, last, ip6, + last, uh); udp6_append(last, n, off, &fromsa); INP_RUNLOCK(last); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 03:20:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A900B3BA; Sat, 8 Nov 2014 03:20:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9604F3B3; Sat, 8 Nov 2014 03:20:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA83KvQ5035040; Sat, 8 Nov 2014 03:20:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA83Kv80035039; Sat, 8 Nov 2014 03:20:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411080320.sA83Kv80035039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 8 Nov 2014 03:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274267 - head/tests/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 03:20:57 -0000 Author: ngie Date: Sat Nov 8 03:20:56 2014 New Revision: 274267 URL: https://svnweb.freebsd.org/changeset/base/274267 Log: Use PROGS instead of PROG and remove unnecessary SRCS?= assignment Using PROG instead of PROGS will in cases of high -j with -DNO_ROOT cause the PROG to show up more than once as it's handling the SCRIPTS install case in a recursive manner, separate from the non-recursive case After the recent batch of commits to bsd.progs.mk to fix behavior with how variables are defaulted to, explicitly setting SRCS for a PROG is no longer required MFC after: 1 week Reviewed by: asomers Phabric: D1130 Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/netinet/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Sat Nov 8 02:53:55 2014 (r274266) +++ head/tests/sys/netinet/Makefile Sat Nov 8 03:20:56 2014 (r274267) @@ -3,9 +3,8 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_SH+= fibs_test -PROG= udp_dontroute -SRCS= udp_dontroute.c +ATF_TESTS_SH= fibs_test +PROGS= udp_dontroute MAN= WARNS?= 6 From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 03:42:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D91E466A; Sat, 8 Nov 2014 03:42:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4933774; Sat, 8 Nov 2014 03:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA83gKUJ045216; Sat, 8 Nov 2014 03:42:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA83gKCO045213; Sat, 8 Nov 2014 03:42:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411080342.sA83gKCO045213@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 8 Nov 2014 03:42: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: r274268 - in stable/10/sys: arm/arm arm/at91 conf 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 03:42:21 -0000 Author: ian Date: Sat Nov 8 03:42:19 2014 New Revision: 274268 URL: https://svnweb.freebsd.org/changeset/base/274268 Log: MFC r273703: Remove the ARM_DEVICE_MULTIPASS option and make its effect be the default. Modified: stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/at91/std.atmel stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/arm/arm/nexus.c Sat Nov 8 03:42:19 2014 (r274268) @@ -125,12 +125,8 @@ static driver_t nexus_driver = { nexus_methods, 1 /* no softc */ }; -#ifdef ARM_DEVICE_MULTIPASS EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); -#else -DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); -#endif static int nexus_probe(device_t dev) Modified: stable/10/sys/arm/at91/std.atmel ============================================================================== --- stable/10/sys/arm/at91/std.atmel Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/arm/at91/std.atmel Sat Nov 8 03:42:19 2014 (r274268) @@ -11,3 +11,4 @@ device at91sam9x5 # bring in the sam specific timers and such device at91sam9 + Modified: stable/10/sys/conf/options.arm ============================================================================== --- stable/10/sys/conf/options.arm Sat Nov 8 03:20:56 2014 (r274267) +++ stable/10/sys/conf/options.arm Sat Nov 8 03:42:19 2014 (r274268) @@ -1,7 +1,6 @@ #$FreeBSD$ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h -ARM_DEVICE_MULTIPASS opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 04:18:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83380D12; Sat, 8 Nov 2014 04:18:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551A8A99; Sat, 8 Nov 2014 04:18:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA84IYWn060196; Sat, 8 Nov 2014 04:18:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA84IXYx060193; Sat, 8 Nov 2014 04:18:33 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411080418.sA84IXYx060193@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 8 Nov 2014 04:18:33 +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: r274269 - stable/10/sys/boot/fdt/dts/arm 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 04:18:34 -0000 Author: ian Date: Sat Nov 8 04:18:33 2014 New Revision: 274269 URL: https://svnweb.freebsd.org/changeset/base/274269 Log: MFC r268836: Fix a typo in a gpio node name. Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-dual.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-quad.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sat Nov 8 03:42:19 2014 (r274268) +++ stable/10/sys/boot/fdt/dts/arm/wandboard-solo.dts Sat Nov 8 04:18:33 2014 (r274269) @@ -48,7 +48,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 04:24:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 523E7123; Sat, 8 Nov 2014 04:24:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F502B99; Sat, 8 Nov 2014 04:24:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA84Ot6f064353; Sat, 8 Nov 2014 04:24:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA84Ot9P064352; Sat, 8 Nov 2014 04:24:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411080424.sA84Ot9P064352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 8 Nov 2014 04:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274270 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 04:24:55 -0000 Author: ngie Date: Sat Nov 8 04:24:54 2014 New Revision: 274270 URL: https://svnweb.freebsd.org/changeset/base/274270 Log: Fix build race in Makefile.inc1 after r274226 by adding lib/libm__L dependency for gnu/lib/libdialog Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 8 04:18:33 2014 (r274269) +++ head/Makefile.inc1 Sat Nov 8 04:24:54 2014 (r274270) @@ -1671,7 +1671,7 @@ _lib_libypclnt= lib/libypclnt lib/libradius__L: lib/libmd__L .endif -gnu/lib/libdialog__L: lib/ncurses/ncursesw__L +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:31:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3B916A2; Sat, 8 Nov 2014 06:31:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86FD585E; Sat, 8 Nov 2014 06:31:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86VqmE023574; Sat, 8 Nov 2014 06:31:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86Vq5W023573; Sat, 8 Nov 2014 06:31:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080631.sA86Vq5W023573@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274271 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:31:52 -0000 Author: delphij Date: Sat Nov 8 06:31:51 2014 New Revision: 274271 URL: https://svnweb.freebsd.org/changeset/base/274271 Log: 5243 zdb -b could be much faster Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@f7950bf1145637c6dc57742a8bb95631fd5c846f Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Sat Nov 8 04:24:54 2014 (r274270) +++ vendor/illumos/dist/cmd/zdb/zdb.c Sat Nov 8 06:31:51 2014 (r274271) @@ -77,9 +77,11 @@ #ifndef lint extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern int zfs_vdev_async_read_max_active; #else boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; +int zfs_vdev_async_read_max_active; #endif const char cmdname[] = "zdb"; @@ -2355,8 +2357,14 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && - gethrtime() > zcb->zcb_lastprint + NANOSEC) { + /* only call gethrtime() every 100 blocks */ + static int iters; + if (++iters > 100) + iters = 0; + else + return (0); + + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; @@ -2465,6 +2473,14 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) (longlong_t)vd->vdev_ms_count); msp->ms_ops = &zdb_metaslab_ops; + + /* + * We don't want to spend the CPU + * manipulating the size-ordered + * tree, so clear the range_tree + * ops. + */ + msp->ms_tree->rt_ops = NULL; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); msp->ms_loaded = B_TRUE; @@ -3478,6 +3494,13 @@ main(int argc, char **argv) */ zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + /* + * "zdb -c" uses checksum-verifying scrub i/os which are async reads. + * "zdb -b" uses traversal prefetch which uses async reads. + * For good performance, let several of them be active at once. + */ + zfs_vdev_async_read_max_active = 10; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:31:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34D976A3; Sat, 8 Nov 2014 06:31:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20E8585F; Sat, 8 Nov 2014 06:31:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86VrJH023580; Sat, 8 Nov 2014 06:31:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86Vqil023579; Sat, 8 Nov 2014 06:31:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080631.sA86Vqil023579@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274271 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:31:53 -0000 Author: delphij Date: Sat Nov 8 06:31:51 2014 New Revision: 274271 URL: https://svnweb.freebsd.org/changeset/base/274271 Log: 5243 zdb -b could be much faster Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@f7950bf1145637c6dc57742a8bb95631fd5c846f Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Nov 8 04:24:54 2014 (r274270) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Nov 8 06:31:51 2014 (r274271) @@ -59,6 +59,7 @@ typedef struct traverse_data { int td_flags; prefetch_data_t *td_pfd; boolean_t td_paused; + uint64_t td_hole_birth_enabled_txg; blkptr_cb_t *td_func; void *td_arg; } traverse_data_t; @@ -229,25 +230,20 @@ traverse_visitbp(traverse_data_t *td, co } if (bp->blk_birth == 0) { - if (spa_feature_is_active(td->td_spa, SPA_FEATURE_HOLE_BIRTH)) { - /* - * Since this block has a birth time of 0 it must be a - * hole created before the SPA_FEATURE_HOLE_BIRTH - * feature was enabled. If SPA_FEATURE_HOLE_BIRTH - * was enabled before the min_txg for this traveral we - * know the hole must have been created before the - * min_txg for this traveral, so we can skip it. If - * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg - * for this traveral we cannot tell if the hole was - * created before or after the min_txg for this - * traversal, so we cannot skip it. - */ - uint64_t hole_birth_enabled_txg; - VERIFY(spa_feature_enabled_txg(td->td_spa, - SPA_FEATURE_HOLE_BIRTH, &hole_birth_enabled_txg)); - if (hole_birth_enabled_txg < td->td_min_txg) - return (0); - } + /* + * Since this block has a birth time of 0 it must be a + * hole created before the SPA_FEATURE_HOLE_BIRTH + * feature was enabled. If SPA_FEATURE_HOLE_BIRTH + * was enabled before the min_txg for this traveral we + * know the hole must have been created before the + * min_txg for this traveral, so we can skip it. If + * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg + * for this traveral we cannot tell if the hole was + * created before or after the min_txg for this + * traversal, so we cannot skip it. + */ + if (td->td_hole_birth_enabled_txg < td->td_min_txg) + return (0); } else if (bp->blk_birth <= td->td_min_txg) { return (0); } @@ -523,6 +519,13 @@ traverse_impl(spa_t *spa, dsl_dataset_t td.td_flags = flags; td.td_paused = B_FALSE; + if (spa_feature_is_active(spa, SPA_FEATURE_HOLE_BIRTH)) { + VERIFY(spa_feature_enabled_txg(spa, + SPA_FEATURE_HOLE_BIRTH, &td.td_hole_birth_enabled_txg)); + } else { + td.td_hole_birth_enabled_txg = 0; + } + pd.pd_blks_max = zfs_pd_blks_max; pd.pd_flags = flags; mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:34:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A955090F; Sat, 8 Nov 2014 06:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B38B86F; Sat, 8 Nov 2014 06:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86Ycdj023966; Sat, 8 Nov 2014 06:34:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86Ycov023965; Sat, 8 Nov 2014 06:34:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080634.sA86Ycov023965@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274272 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzpool/common 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:34:38 -0000 Author: delphij Date: Sat Nov 8 06:34:37 2014 New Revision: 274272 URL: https://svnweb.freebsd.org/changeset/base/274272 Log: 5244 zio pipeline callers should explicitly invoke next stage Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Matthew Ahrens Reviewed by: Richard Elling Reviewed by: Dan McDonald Reviewed by: Steven Hartland Approved by: Gordon Ross Author: George Wilson illumos/illumos-gate@738f37bc3dcd61e8a893af0f2d466d76690b70ec Modified: vendor/illumos/dist/lib/libzpool/common/taskq.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/lib/libzpool/common/taskq.c ============================================================================== --- vendor/illumos/dist/lib/libzpool/common/taskq.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor/illumos/dist/lib/libzpool/common/taskq.c Sat Nov 8 06:34:37 2014 (r274272) @@ -25,6 +25,7 @@ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2012 Garrett D'Amore . All rights reserved. + * Copyright (c) 2014 by Delphix. All rights reserved. */ #include @@ -33,8 +34,10 @@ int taskq_now; taskq_t *system_taskq; #define TASKQ_ACTIVE 0x00010000 +#define TASKQ_NAMELEN 31 struct taskq { + char tq_name[TASKQ_NAMELEN + 1]; kmutex_t tq_lock; krwlock_t tq_threadlock; kcondvar_t tq_dispatch_cv; @@ -247,6 +250,7 @@ taskq_create(const char *name, int nthre cv_init(&tq->tq_dispatch_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_wait_cv, NULL, CV_DEFAULT, NULL); cv_init(&tq->tq_maxalloc_cv, NULL, CV_DEFAULT, NULL); + (void) strncpy(tq->tq_name, name, TASKQ_NAMELEN + 1); tq->tq_flags = flags | TASKQ_ACTIVE; tq->tq_active = nthreads; tq->tq_nthreads = nthreads; From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:34:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2322F9E8; Sat, 8 Nov 2014 06:34:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 06C91870; Sat, 8 Nov 2014 06:34:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86YenP023986; Sat, 8 Nov 2014 06:34:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86YcJj023971; Sat, 8 Nov 2014 06:34:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080634.sA86YcJj023971@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274272 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/lib/libzpool/common X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:34:41 -0000 Author: delphij Date: Sat Nov 8 06:34:37 2014 New Revision: 274272 URL: https://svnweb.freebsd.org/changeset/base/274272 Log: 5244 zio pipeline callers should explicitly invoke next stage Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Matthew Ahrens Reviewed by: Richard Elling Reviewed by: Dan McDonald Reviewed by: Steven Hartland Approved by: Gordon Ross Author: George Wilson illumos/illumos-gate@738f37bc3dcd61e8a893af0f2d466d76690b70ec Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/lib/libzpool/common/taskq.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Sat Nov 8 06:34:37 2014 (r274272) @@ -60,7 +60,7 @@ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); -typedef int vdev_io_start_func_t(zio_t *zio); +typedef void vdev_io_start_func_t(zio_t *zio); typedef void vdev_io_done_func_t(zio_t *zio); typedef void vdev_state_change_func_t(vdev_t *vd, int, int); typedef void vdev_hold_func_t(vdev_t *vd); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Sat Nov 8 06:34:37 2014 (r274272) @@ -151,9 +151,6 @@ typedef enum zio_priority { ZIO_PRIORITY_NOW /* non-queued i/os (e.g. free) */ } zio_priority_t; -#define ZIO_PIPELINE_CONTINUE 0x100 -#define ZIO_PIPELINE_STOP 0x101 - enum zio_flag { /* * Flags inherited by gang, ddt, and vdev children, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c Sat Nov 8 06:34:37 2014 (r274272) @@ -715,7 +715,7 @@ vdev_disk_ioctl_done(void *zio_arg, int zio_interrupt(zio); } -static int +static void vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -731,14 +731,16 @@ vdev_disk_io_start(zio_t *zio) */ if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) { zio->io_error = ENXIO; - return (ZIO_PIPELINE_CONTINUE); + zio_interrupt(zio); + return; } if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */ if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); - return (ZIO_PIPELINE_CONTINUE); + zio_interrupt(zio); + return; } switch (zio->io_cmd) { @@ -769,7 +771,7 @@ vdev_disk_io_start(zio_t *zio) * and will call vdev_disk_ioctl_done() * upon completion. */ - return (ZIO_PIPELINE_STOP); + return; } if (error == ENOTSUP || error == ENOTTY) { @@ -790,7 +792,8 @@ vdev_disk_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); + return; } vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); @@ -811,8 +814,6 @@ vdev_disk_io_start(zio_t *zio) /* ldi_strategy() will return non-zero only on programming errors */ VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0); - - return (ZIO_PIPELINE_STOP); } static void Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_file.c Sat Nov 8 06:34:37 2014 (r274272) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include @@ -182,7 +182,7 @@ vdev_file_io_strategy(void *arg) } } -static int +static void vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -194,7 +194,8 @@ vdev_file_io_start(zio_t *zio) /* XXPOLICY */ if (!vdev_readable(vd)) { zio->io_error = SET_ERROR(ENXIO); - return (ZIO_PIPELINE_CONTINUE); + zio_interrupt(zio); + return; } switch (zio->io_cmd) { @@ -206,7 +207,8 @@ vdev_file_io_start(zio_t *zio) zio->io_error = SET_ERROR(ENOTSUP); } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); + return; } vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); @@ -225,8 +227,6 @@ vdev_file_io_start(zio_t *zio) VERIFY3U(taskq_dispatch(system_taskq, vdev_file_io_strategy, bp, TQ_SLEEP), !=, 0); - - return (ZIO_PIPELINE_STOP); } /* ARGSUSED */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c Sat Nov 8 06:34:37 2014 (r274272) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -260,7 +260,7 @@ vdev_mirror_child_select(zio_t *zio) return (-1); } -static int +static void vdev_mirror_io_start(zio_t *zio) { mirror_map_t *mm; @@ -285,7 +285,8 @@ vdev_mirror_io_start(zio_t *zio) zio->io_type, zio->io_priority, 0, vdev_mirror_scrub_done, mc)); } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); + return; } /* * For normal reads just pick one child. @@ -311,7 +312,7 @@ vdev_mirror_io_start(zio_t *zio) c++; } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); } static int Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_missing.c Sat Nov 8 06:34:37 2014 (r274272) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ /* @@ -66,11 +66,11 @@ vdev_missing_close(vdev_t *vd) } /* ARGSUSED */ -static int +static void vdev_missing_io_start(zio_t *zio) { zio->io_error = SET_ERROR(ENOTSUP); - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); } /* ARGSUSED */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c Sat Nov 8 06:34:37 2014 (r274272) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1711,7 +1711,7 @@ vdev_raidz_child_done(zio_t *zio) * vdevs have had errors, then create zio read operations to the parity * columns' VDevs as well. */ -static int +static void vdev_raidz_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; @@ -1759,7 +1759,8 @@ vdev_raidz_io_start(zio_t *zio) ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL)); } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); + return; } ASSERT(zio->io_type == ZIO_TYPE_READ); @@ -1799,7 +1800,7 @@ vdev_raidz_io_start(zio_t *zio) } } - return (ZIO_PIPELINE_CONTINUE); + zio_execute(zio); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Nov 8 06:31:51 2014 (r274271) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Nov 8 06:34:37 2014 (r274272) @@ -63,6 +63,9 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX extern vmem_t *zio_alloc_arena; #endif +#define ZIO_PIPELINE_CONTINUE 0x100 +#define ZIO_PIPELINE_STOP 0x101 + /* * The following actions directly effect the spa's sync-to-convergence logic. * The values below define the sync pass when we start performing the action. @@ -2466,6 +2469,18 @@ zio_free_zil(spa_t *spa, uint64_t txg, b * Read and write to physical devices * ========================================================================== */ + + +/* + * Issue an I/O to the underlying vdev. Typically the issue pipeline + * stops after this stage and will resume upon I/O completion. + * However, there are instances where the vdev layer may need to + * continue the pipeline when an I/O was not issued. Since the I/O + * that was sent to the vdev layer might be different than the one + * currently active in the pipeline (see vdev_queue_io()), we explicitly + * force the underlying vdev layers to call either zio_execute() or + * zio_interrupt() to ensure that the pipeline continues with the correct I/O. + */ static int zio_vdev_io_start(zio_t *zio) { @@ -2483,7 +2498,8 @@ zio_vdev_io_start(zio_t *zio) /* * The mirror_ops handle multiple DVAs in a single BP. */ - return (vdev_mirror_ops.vdev_op_io_start(zio)); + vdev_mirror_ops.vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } /* @@ -2491,7 +2507,7 @@ zio_vdev_io_start(zio_t *zio) * can quickly react to certain workloads. In particular, we care * about non-scrubbing, top-level reads and writes with the following * characteristics: - * - synchronous writes of user data to non-slog devices + * - synchronous writes of user data to non-slog devices * - any reads of user data * When these conditions are met, adjust the timestamp of spa_last_io * which allows the scan thread to adjust its workload accordingly. @@ -2577,7 +2593,8 @@ zio_vdev_io_start(zio_t *zio) } } - return (vd->vdev_ops->vdev_op_io_start(zio)); + vd->vdev_ops->vdev_op_io_start(zio); + return (ZIO_PIPELINE_STOP); } static int From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:43:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBCD3BC4; Sat, 8 Nov 2014 06:43:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4BC992E; Sat, 8 Nov 2014 06:43:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86haSl028448; Sat, 8 Nov 2014 06:43:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86hXmM028434; Sat, 8 Nov 2014 06:43:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080643.sA86hXmM028434@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274273 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor-sys/illumos/dist/uts/common/sys/fs vendor/ill... 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:43:36 -0000 Author: delphij Date: Sat Nov 8 06:43:33 2014 New Revision: 274273 URL: https://svnweb.freebsd.org/changeset/base/274273 Log: 5027 zfs large block support Reviewed by: Alek Pinchuk Reviewed by: George Wilson Reviewed by: Josef 'Jeff' Sipek Reviewed by: Richard Elling Reviewed by: Saso Kiselkov Reviewed by: Brian Behlendorf Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@b515258426fed6c7311fd3f1dea697cfbd4085c6 Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/common/zfs/zpool_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_log.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/cmd/zdb/zdb.c Sat Nov 8 06:43:33 2014 (r274273) @@ -2120,6 +2120,8 @@ dump_label(const char *dev) (void) close(fd); } +static uint64_t num_large_blocks; + /*ARGSUSED*/ static int dump_one_dir(const char *dsname, void *arg) @@ -2132,6 +2134,8 @@ dump_one_dir(const char *dsname, void *a (void) printf("Could not open %s, error %d\n", dsname, error); return (0); } + if (dmu_objset_ds(os)->ds_large_blocks) + num_large_blocks++; dump_dir(os); dmu_objset_disown(os, FTAG); fuid_table_destroy(); @@ -2142,7 +2146,7 @@ dump_one_dir(const char *dsname, void *a /* * Block statistics. */ -#define PSIZE_HISTO_SIZE (SPA_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1) +#define PSIZE_HISTO_SIZE (SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 2) typedef struct zdb_blkstats { uint64_t zb_asize; uint64_t zb_lsize; @@ -2207,7 +2211,15 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * zb->zb_lsize += BP_GET_LSIZE(bp); zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; - zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; + + /* + * The histogram is only big enough to record blocks up to + * SPA_OLD_MAXBLOCKSIZE; larger blocks go into the last, + * "other", bucket. + */ + int idx = BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT; + idx = MIN(idx, SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1); + zb->zb_psize_histogram[idx]++; zb->zb_gangs += BP_COUNT_GANG(bp); @@ -2917,6 +2929,7 @@ dump_zpool(spa_t *spa) dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { + uint64_t refcount; dump_dir(dp->dp_meta_objset); if (dump_opt['d'] >= 3) { dump_bpobj(&spa->spa_deferred_bpobj, @@ -2936,8 +2949,21 @@ dump_zpool(spa_t *spa) } (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); + + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount); + if (num_large_blocks != refcount) { + (void) printf("large_blocks feature refcount mismatch: " + "expected %lld != actual %lld\n", + (longlong_t)num_large_blocks, + (longlong_t)refcount); + rc = 2; + } else { + (void) printf("Verified large_blocks feature refcount " + "is correct (%llu)\n", (longlong_t)refcount); + } } - if (dump_opt['b'] || dump_opt['c']) + if (rc == 0 && (dump_opt['b'] || dump_opt['c'])) rc = dump_block_stats(spa); if (rc == 0) Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Sat Nov 8 06:43:33 2014 (r274273) @@ -256,9 +256,9 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] \n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRve] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] " "\n" - "\tsend [-e] [-i snapshot|bookmark] " + "\tsend [-Le] [-i snapshot|bookmark] " "\n")); case HELP_SET: return (gettext("\tset " @@ -3640,7 +3640,7 @@ zfs_do_send(int argc, char **argv) boolean_t extraverbose = B_FALSE; /* check options */ - while ((c = getopt(argc, argv, ":i:I:RDpvnPe")) != -1) { + while ((c = getopt(argc, argv, ":i:I:RDpvnPLe")) != -1) { switch (c) { case 'i': if (fromname) @@ -3675,6 +3675,9 @@ zfs_do_send(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'L': + flags.largeblock = B_TRUE; + break; case 'e': flags.embed_data = B_TRUE; break; @@ -3731,6 +3734,8 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); + if (flags.largeblock) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (flags.embed_data) lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; Modified: vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c ============================================================================== --- vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c Sat Nov 8 06:43:33 2014 (r274273) @@ -54,7 +54,6 @@ uint64_t total_stream_len = 0; FILE *send_stream = 0; boolean_t do_byteswap = B_FALSE; boolean_t do_cksum = B_TRUE; -#define INITIAL_BUFLEN (1<<20) static void usage(void) @@ -67,6 +66,18 @@ usage(void) exit(1); } +static void * +safe_malloc(size_t size) +{ + void *rv = malloc(size); + if (rv == NULL) { + (void) fprintf(stderr, "ERROR; failed to allocate %zu bytes\n", + size); + abort(); + } + return (rv); +} + /* * ssread - send stream read. * @@ -158,7 +169,7 @@ print_block(char *buf, int length) int main(int argc, char *argv[]) { - char *buf = malloc(INITIAL_BUFLEN); + char *buf = safe_malloc(SPA_MAXBLOCKSIZE); uint64_t drr_record_count[DRR_NUMTYPES] = { 0 }; uint64_t total_records = 0; dmu_replay_record_t thedrr; @@ -307,9 +318,9 @@ main(int argc, char *argv[]) nvlist_t *nv; int sz = drr->drr_payloadlen; - if (sz > INITIAL_BUFLEN) { + if (sz > SPA_MAXBLOCKSIZE) { free(buf); - buf = malloc(sz); + buf = safe_malloc(sz); } (void) ssread(buf, sz, &zc); if (ferror(send_stream)) Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/cmd/ztest/ztest.c Sat Nov 8 06:43:33 2014 (r274273) @@ -985,9 +985,15 @@ ztest_spa_get_ashift() { static int ztest_random_blocksize(void) { - // Choose a block size >= the ashift. - uint64_t block_shift = - ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + uint64_t block_shift; + /* + * Choose a block size >= the ashift. + * If the SPA supports new MAXBLOCKSIZE, test up to 1MB blocks. + */ + int maxbs = SPA_OLD_MAXBLOCKSHIFT; + if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE) + maxbs = 20; + block_shift = ztest_random(maxbs - ztest_spa_get_ashift() + 1); return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } @@ -4787,7 +4793,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 char path0[MAXPATHLEN]; char pathrand[MAXPATHLEN]; size_t fsize; - int bshift = SPA_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ + int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */ int iters = 1000; int maxfaults; int mirror_save; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Sat Nov 8 06:43:33 2014 (r274273) @@ -591,6 +591,9 @@ typedef struct sendflags { /* show progress (ie. -v) */ boolean_t progress; + /* large blocks (>128K) are permitted */ + boolean_t largeblock; + /* WRITE_EMBEDDED records of type DATA are permitted */ boolean_t embed_data; } sendflags_t; Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Sat Nov 8 06:43:33 2014 (r274273) @@ -1048,21 +1048,36 @@ zfs_valid_proplist(libzfs_handle_t *hdl, break; } - case ZFS_PROP_RECORDSIZE: case ZFS_PROP_VOLBLOCKSIZE: - /* must be power of two within SPA_{MIN,MAX}BLOCKSIZE */ + case ZFS_PROP_RECORDSIZE: + { + int maxbs = SPA_MAXBLOCKSIZE; + if (zhp != NULL) { + maxbs = zpool_get_prop_int(zhp->zpool_hdl, + ZPOOL_PROP_MAXBLOCKSIZE, NULL); + } + /* + * Volumes are limited to a volblocksize of 128KB, + * because they typically service workloads with + * small random writes, which incur a large performance + * penalty with large blocks. + */ + if (prop == ZFS_PROP_VOLBLOCKSIZE) + maxbs = SPA_OLD_MAXBLOCKSIZE; + /* + * The value must be a power of two between + * SPA_MINBLOCKSIZE and maxbs. + */ if (intval < SPA_MINBLOCKSIZE || - intval > SPA_MAXBLOCKSIZE || !ISP2(intval)) { + intval > maxbs || !ISP2(intval)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' must be power of 2 from %u " - "to %uk"), propname, - (uint_t)SPA_MINBLOCKSIZE, - (uint_t)SPA_MAXBLOCKSIZE >> 10); + "'%s' must be power of 2 from 512B " + "to %uKB"), propname, maxbs >> 10); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } break; - + } case ZFS_PROP_MLSLABEL: { /* @@ -1437,7 +1452,8 @@ zfs_setprop_error(libzfs_handle_t *hdl, break; case ERANGE: - if (prop == ZFS_PROP_COMPRESSION) { + if (prop == ZFS_PROP_COMPRESSION || + prop == ZFS_PROP_RECORDSIZE) { (void) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "property setting is not allowed on " "bootable datasets")); @@ -3136,9 +3152,7 @@ zfs_create(libzfs_handle_t *hdl, const c case EDOM: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "volume block size must be power of 2 from " - "%u to %uk"), - (uint_t)SPA_MINBLOCKSIZE, - (uint_t)SPA_MAXBLOCKSIZE >> 10); + "512B to 128KB")); return (zfs_error(hdl, EZFS_BADPROP, errbuf)); Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c Sat Nov 8 06:43:33 2014 (r274273) @@ -206,7 +206,7 @@ static void * cksummer(void *arg) { dedup_arg_t *dda = arg; - char *buf = malloc(1<<20); + char *buf = zfs_alloc(dda->dedup_hdl, SPA_MAXBLOCKSIZE); dmu_replay_record_t thedrr; dmu_replay_record_t *drr = &thedrr; struct drr_begin *drrb = &thedrr.drr_u.drr_begin; @@ -271,9 +271,9 @@ cksummer(void *arg) DMU_COMPOUNDSTREAM && drr->drr_payloadlen != 0) { int sz = drr->drr_payloadlen; - if (sz > 1<<20) { - free(buf); - buf = malloc(sz); + if (sz > SPA_MAXBLOCKSIZE) { + buf = zfs_realloc(dda->dedup_hdl, buf, + SPA_MAXBLOCKSIZE, sz); } (void) ssread(buf, sz, ofp); if (ferror(stdin)) @@ -806,7 +806,7 @@ typedef struct send_dump_data { char prevsnap[ZFS_MAXNAMELEN]; uint64_t prevsnap_obj; boolean_t seenfrom, seento, replicate, doall, fromorigin; - boolean_t verbose, dryrun, parsable, progress, embed_data; + boolean_t verbose, dryrun, parsable, progress, embed_data, large_block; int outfd; boolean_t err; nvlist_t *fss; @@ -1153,6 +1153,8 @@ dump_snapshot(zfs_handle_t *zhp, void *a } enum lzc_send_flags flags = 0; + if (sdd->large_block) + flags |= LZC_SEND_FLAG_LARGE_BLOCK; if (sdd->embed_data) flags |= LZC_SEND_FLAG_EMBED_DATA; @@ -1501,6 +1503,7 @@ zfs_send(zfs_handle_t *zhp, const char * sdd.parsable = flags->parsable; sdd.progress = flags->progress; sdd.dryrun = flags->dryrun; + sdd.large_block = flags->largeblock; sdd.embed_data = flags->embed_data; sdd.filter_cb = filter_func; sdd.filter_cb_arg = cb_arg; @@ -2506,7 +2509,7 @@ static int recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap) { dmu_replay_record_t *drr; - void *buf = malloc(1<<20); + void *buf = zfs_alloc(hdl, SPA_MAXBLOCKSIZE); char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c Sat Nov 8 06:43:33 2014 (r274273) @@ -455,6 +455,10 @@ lzc_get_holds(const char *snapname, nvli * * "fd" is the file descriptor to write the send stream to. * + * If "flags" contains LZC_SEND_FLAG_LARGE_BLOCK, the stream is permitted + * to contain DRR_WRITE records with drr_length > 128K, and DRR_OBJECT + * records with drr_blksz > 128K. + * * If "flags" contains LZC_SEND_FLAG_EMBED_DATA, the stream is permitted * to contain DRR_WRITE_EMBEDDED records with drr_etype==BP_EMBEDDED_TYPE_DATA, * which the receiving system must support (as indicated by support @@ -471,6 +475,8 @@ lzc_send(const char *snapname, const cha fnvlist_add_int32(args, "fd", fd); if (from != NULL) fnvlist_add_string(args, "fromsnap", from); + if (flags & LZC_SEND_FLAG_LARGE_BLOCK) + fnvlist_add_boolean(args, "largeblockok"); if (flags & LZC_SEND_FLAG_EMBED_DATA) fnvlist_add_boolean(args, "embedok"); err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL); Modified: vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h Sat Nov 8 06:43:33 2014 (r274273) @@ -53,7 +53,8 @@ int lzc_release(nvlist_t *, nvlist_t **) int lzc_get_holds(const char *, nvlist_t **); enum lzc_send_flags { - LZC_SEND_FLAG_EMBED_DATA = 1 << 0 + LZC_SEND_FLAG_EMBED_DATA = 1 << 0, + LZC_SEND_FLAG_LARGE_BLOCK = 1 << 1 }; int lzc_send(const char *, const char *, int, enum lzc_send_flags); Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/man/man1m/zfs.1m Sat Nov 8 06:43:33 2014 (r274273) @@ -176,12 +176,12 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBsend\fR [\fB-DnPpRve\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR +\fBzfs\fR \fBsend\fR [\fB-DnPpRveL\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR .fi .LP .nf -\fBzfs\fR \fBsend\fR [\fB-e\fR] [\fB-i \fIsnapshot\fR|\fIbookmark\fR]\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR +\fBzfs\fR \fBsend\fR [\fB-eL\fR] [\fB-i \fIsnapshot\fR|\fIbookmark\fR]\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR .fi .LP @@ -1244,7 +1244,9 @@ significant performance gains. Use of th systems is strongly discouraged, and may adversely affect performance. .sp The size specified must be a power of two greater than or equal to 512 and less -than or equal to 128 Kbytes. +than or equal to 128 Kbytes. If the \fBlarge_blocks\fR feature is enabled +on the pool, the size may be up to 1 Mbyte. See \fBzpool-features\fR(5) +for details on ZFS feature flags. .sp Changing the file system's \fBrecordsize\fR affects only files created afterward; existing files are unaffected. @@ -2923,7 +2925,7 @@ See \fBzpool-features\fR(5) for details .sp .ne 2 .na -\fBzfs send\fR [\fB-DnPpRve\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR +\fBzfs send\fR [\fB-DnPpRveL\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR .ad .sp .6 .RS 4n @@ -2999,6 +3001,21 @@ will be much better if the filesystem us .sp .ne 2 .na +\fB\fB-L\fR\fR +.ad +.sp .6 +.RS 4n +Generate a stream which may contain blocks larger than 128KB. This flag +has no effect if the \fBlarge_blocks\fR pool feature is disabled, or if +the \fRrecordsize\fR property of this filesystem has never been set above +128KB. The receiving system must have the \fBlarge_blocks\fR pool feature +enabled as well. See \fBzpool-features\fR(5) for details on ZFS feature +flags and the \fBlarge_blocks\fR feature. +.RE + +.sp +.ne 2 +.na \fB\fB-e\fR\fR .ad .sp .6 @@ -3064,7 +3081,7 @@ on future versions of \fBZFS\fR. .sp .ne 2 .na -\fBzfs send\fR [\fB-e\fR] [\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR +\fBzfs send\fR [\fB-eL\fR] [\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR .ad .sp .6 .RS 4n @@ -3095,6 +3112,21 @@ or the origin's origin, etc. .sp .ne 2 .na +\fB\fB-L\fR\fR +.ad +.sp .6 +.RS 4n +Generate a stream which may contain blocks larger than 128KB. This flag +has no effect if the \fBlarge_blocks\fR pool feature is disabled, or if +the \fRrecordsize\fR property of this filesystem has never been set above +128KB. The receiving system must have the \fBlarge_blocks\fR pool feature +enabled as well. See \fBzpool-features\fR(5) for details on ZFS feature +flags and the \fBlarge_blocks\fR feature. +.RE + +.sp +.ne 2 +.na \fB\fB-e\fR\fR .ad .sp .6 Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Sat Nov 8 06:34:37 2014 (r274272) +++ vendor/illumos/dist/man/man5/zpool-features.5 Sat Nov 8 06:43:33 2014 (r274273) @@ -18,7 +18,6 @@ .SH NAME zpool\-features \- ZFS pool feature descriptions .SH DESCRIPTION -.sp .LP ZFS pool on\-disk format versions are specified via "features" which replace the old on\-disk format numbers (the last supported on\-disk format number is @@ -36,7 +35,6 @@ format of the pool is specified by the s \fBactive\fR on the pool. If the pool was created by another software version this set may include unsupported features. .SS "Identifying features" -.sp .LP Every feature has a guid of the form \fIcom.example:feature_name\fR. The reverse DNS name ensures that the feature's guid is unique across all ZFS @@ -51,7 +49,6 @@ name is the portion of its guid which fo however a feature's short name may differ across ZFS implementations if following the convention would result in name conflicts. .SS "Feature states" -.sp .LP Features can be in one of three states: .sp @@ -97,7 +94,6 @@ cannot be disabled once they have been e The state of supported features is exposed through pool properties of the form \fIfeature@short_name\fR. .SS "Read\-only compatibility" -.sp .LP Some features may make on\-disk format changes that do not interfere with other software's ability to read from the pool. These features are referred to as @@ -106,7 +102,6 @@ compatible, the pool can be imported in \fBreadonly\fR property during import (see \fBzpool\fR(1M) for details on importing pools). .SS "Unsupported features" -.sp .LP For each unsupported feature enabled on an imported pool a pool property named \fIunsupported@feature_guid\fR will indicate why the import was allowed @@ -133,13 +128,11 @@ read\-only mode. .RE .SS "Feature dependencies" -.sp .LP Some features depend on other features being enabled in order to function properly. Enabling a feature will automatically enable any features it depends on. .SH FEATURES -.sp .LP The following features are supported on this system: .sp @@ -430,5 +423,26 @@ never return to being \fBenabled\fR. .RE +.sp +.ne 2 +.na +\fB\fBlarge_blocks\fR\fR +.ad +.RS 4n +.TS +l l . +GUID org.open-zfs:large_block +READ\-ONLY COMPATIBLE no +DEPENDENCIES extensible_dataset +.TE + +The \fBlarge_block\fR feature allows the record size on a dataset to be +set larger than 128KB. + +This feature becomes \fBactive\fR once a \fBrecordsize\fR property has been +set larger than 128KB, and will return to being \fBenabled\fR once all +filesystems that have ever had their recordsize larger than 128KB are destroyed. +.RE + .SH "SEE ALSO" \fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 06:43:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43D50CE6; Sat, 8 Nov 2014 06:43:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF0392F; Sat, 8 Nov 2014 06:43:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA86hjUd028515; Sat, 8 Nov 2014 06:43:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA86hbDc028453; Sat, 8 Nov 2014 06:43:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080643.sA86hbDc028453@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 06:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r274273 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor-sys/illumos/dist/uts/common/sys/fs vendor/ill... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 06:43:45 -0000 Author: delphij Date: Sat Nov 8 06:43:33 2014 New Revision: 274273 URL: https://svnweb.freebsd.org/changeset/base/274273 Log: 5027 zfs large block support Reviewed by: Alek Pinchuk Reviewed by: George Wilson Reviewed by: Josef 'Jeff' Sipek Reviewed by: Richard Elling Reviewed by: Saso Kiselkov Reviewed by: Brian Behlendorf Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@b515258426fed6c7311fd3f1dea697cfbd4085c6 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/common/zfs/zfs_prop.c vendor-sys/illumos/dist/common/zfs/zpool_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_raidz.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_log.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vnops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/cmd/zstreamdump/zstreamdump.c vendor/illumos/dist/cmd/ztest/ztest.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c vendor/illumos/dist/lib/libzfs/common/libzfs_sendrecv.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.c vendor/illumos/dist/lib/libzfs_core/common/libzfs_core.h vendor/illumos/dist/man/man1m/zfs.1m vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Sat Nov 8 06:43:33 2014 (r274273) @@ -57,7 +57,8 @@ valid_char(char c, boolean_t after_colon { return ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || - c == (after_colon ? '_' : '.')); + (after_colon && c == '_') || + (!after_colon && (c == '.' || c == '-'))); } /* @@ -221,4 +222,13 @@ zpool_feature_init(void) "com.delphix:embedded_data", "embedded_data", "Blocks which compress very well use even less space.", B_FALSE, B_TRUE, B_TRUE, NULL); + + static const spa_feature_t large_blocks_deps[] = { + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURE_NONE + }; + zfeature_register(SPA_FEATURE_LARGE_BLOCKS, + "org.open-zfs:large_blocks", "large_blocks", + "Support for blocks larger than 128KB.", B_FALSE, B_FALSE, B_FALSE, + large_blocks_deps); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Sat Nov 8 06:43:33 2014 (r274273) @@ -51,6 +51,7 @@ typedef enum spa_feature { SPA_FEATURE_EMBEDDED_DATA, SPA_FEATURE_BOOKMARKS, SPA_FEATURE_FS_SS_LIMIT, + SPA_FEATURE_LARGE_BLOCKS, SPA_FEATURES } spa_feature_t; Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_prop.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/common/zfs/zfs_prop.c Sat Nov 8 06:43:33 2014 (r274273) @@ -397,8 +397,8 @@ zfs_prop_init(void) /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", - SPA_MAXBLOCKSIZE, PROP_INHERIT, - ZFS_TYPE_FILESYSTEM, "512 to 128k, power of 2", "RECSIZE"); + SPA_OLD_MAXBLOCKSIZE, PROP_INHERIT, + ZFS_TYPE_FILESYSTEM, "512 to 1M, power of 2", "RECSIZE"); /* hidden properties */ zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER, Modified: vendor-sys/illumos/dist/common/zfs/zpool_prop.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zpool_prop.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/common/zfs/zpool_prop.c Sat Nov 8 06:43:33 2014 (r274273) @@ -127,6 +127,8 @@ zpool_prop_init(void) /* hidden properties */ zprop_register_hidden(ZPOOL_PROP_NAME, "name", PROP_TYPE_STRING, PROP_READONLY, ZFS_TYPE_POOL, "NAME"); + zprop_register_hidden(ZPOOL_PROP_MAXBLOCKSIZE, "maxblocksize", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE"); } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bpobj.c Sat Nov 8 06:43:33 2014 (r274273) @@ -43,7 +43,7 @@ bpobj_alloc_empty(objset_t *os, int bloc if (!spa_feature_is_active(spa, SPA_FEATURE_EMPTY_BPOBJ)) { ASSERT0(dp->dp_empty_bpobj); dp->dp_empty_bpobj = - bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx); + bpobj_alloc(os, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY(zap_add(os, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1, @@ -396,7 +396,8 @@ bpobj_enqueue_subobj(bpobj_t *bpo, uint6 dmu_buf_will_dirty(bpo->bpo_dbuf, tx); if (bpo->bpo_phys->bpo_subobjs == 0) { bpo->bpo_phys->bpo_subobjs = dmu_object_alloc(bpo->bpo_os, - DMU_OT_BPOBJ_SUBOBJ, SPA_MAXBLOCKSIZE, DMU_OT_NONE, 0, tx); + DMU_OT_BPOBJ_SUBOBJ, SPA_OLD_MAXBLOCKSIZE, + DMU_OT_NONE, 0, tx); } dmu_object_info_t doi; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Sat Nov 8 06:43:33 2014 (r274273) @@ -65,7 +65,7 @@ bptree_alloc(objset_t *os, dmu_tx_t *tx) bptree_phys_t *bt; obj = dmu_object_alloc(os, DMU_OTN_UINT64_METADATA, - SPA_MAXBLOCKSIZE, DMU_OTN_UINT64_METADATA, + SPA_OLD_MAXBLOCKSIZE, DMU_OTN_UINT64_METADATA, sizeof (bptree_phys_t), tx); /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Nov 8 06:43:33 2014 (r274273) @@ -2022,10 +2022,8 @@ dbuf_spill_set_blksz(dmu_buf_t *db_fake, return (SET_ERROR(ENOTSUP)); if (blksz == 0) blksz = SPA_MINBLOCKSIZE; - if (blksz > SPA_MAXBLOCKSIZE) - blksz = SPA_MAXBLOCKSIZE; - else - blksz = P2ROUNDUP(blksz, SPA_MINBLOCKSIZE); + ASSERT3U(blksz, <=, spa_maxblocksize(dmu_objset_spa(db->db_objset))); + blksz = P2ROUNDUP(blksz, SPA_MINBLOCKSIZE); DB_DNODE_ENTER(db); dn = DB_DNODE(db); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Nov 8 06:43:33 2014 (r274273) @@ -255,6 +255,14 @@ logbias_changed_cb(void *arg, uint64_t n zil_set_logbias(os->os_zil, newval); } +static void +recordsize_changed_cb(void *arg, uint64_t newval) +{ + objset_t *os = arg; + + os->os_recordsize = newval; +} + void dmu_objset_byteswap(void *buf, size_t size) { @@ -384,6 +392,11 @@ dmu_objset_open_impl(spa_t *spa, dsl_dat ZFS_PROP_REDUNDANT_METADATA), redundant_metadata_changed_cb, os); } + if (err == 0) { + err = dsl_prop_register(ds, + zfs_prop_to_name(ZFS_PROP_RECORDSIZE), + recordsize_changed_cb, os); + } } if (err != 0) { VERIFY(arc_buf_remove_ref(os->os_phys_buf, @@ -642,6 +655,9 @@ dmu_objset_evict(objset_t *os) VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_REDUNDANT_METADATA), redundant_metadata_changed_cb, os)); + VERIFY0(dsl_prop_unregister(ds, + zfs_prop_to_name(ZFS_PROP_RECORDSIZE), + recordsize_changed_cb, os)); } VERIFY0(dsl_prop_unregister(ds, zfs_prop_to_name(ZFS_PROP_PRIMARYCACHE), Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Nov 8 06:43:33 2014 (r274273) @@ -206,11 +206,12 @@ dump_write(dmu_sendarg_t *dsp, dmu_objec drrw->drr_offset = offset; drrw->drr_length = blksz; drrw->drr_toguid = dsp->dsa_toguid; - if (BP_IS_EMBEDDED(bp)) { + if (bp == NULL || BP_IS_EMBEDDED(bp)) { /* - * There's no pre-computed checksum of embedded BP's, so - * (like fletcher4-checkummed blocks) userland will have - * to compute a dedup-capable checksum itself. + * There's no pre-computed checksum for partial-block + * writes or embedded BP's, so (like + * fletcher4-checkummed blocks) userland will have to + * compute a dedup-capable checksum itself. */ drrw->drr_checksumtype = ZIO_CHECKSUM_OFF; } else { @@ -372,6 +373,10 @@ dump_dnode(dmu_sendarg_t *dsp, uint64_t drro->drr_compress = dnp->dn_compress; drro->drr_toguid = dsp->dsa_toguid; + if (!(dsp->dsa_featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + drro->drr_blksz > SPA_OLD_MAXBLOCKSIZE) + drro->drr_blksz = SPA_OLD_MAXBLOCKSIZE; + if (dump_bytes(dsp, dsp->dsa_drr, sizeof (dmu_replay_record_t)) != 0) return (SET_ERROR(EINTR)); @@ -491,6 +496,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co uint32_t aflags = ARC_WAIT; arc_buf_t *abuf; int blksz = BP_GET_LSIZE(bp); + uint64_t offset; ASSERT3U(blksz, ==, dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); ASSERT0(zb->zb_level); @@ -511,8 +517,24 @@ backup_cb(spa_t *spa, zilog_t *zilog, co } } - err = dump_write(dsp, type, zb->zb_object, zb->zb_blkid * blksz, - blksz, bp, abuf->b_data); + offset = zb->zb_blkid * blksz; + + if (!(dsp->dsa_featureflags & + DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + blksz > SPA_OLD_MAXBLOCKSIZE) { + char *buf = abuf->b_data; + while (blksz > 0 && err == 0) { + int n = MIN(blksz, SPA_OLD_MAXBLOCKSIZE); + err = dump_write(dsp, type, zb->zb_object, + offset, n, NULL, buf); + offset += n; + buf += n; + blksz -= n; + } + } else { + err = dump_write(dsp, type, zb->zb_object, + offset, blksz, bp, abuf->b_data); + } (void) arc_buf_remove_ref(abuf, &abuf); } @@ -526,7 +548,7 @@ backup_cb(spa_t *spa, zilog_t *zilog, co static int dmu_send_impl(void *tag, dsl_pool_t *dp, dsl_dataset_t *ds, zfs_bookmark_phys_t *fromzb, boolean_t is_clone, boolean_t embedok, - int outfd, vnode_t *vp, offset_t *off) + boolean_t large_block_ok, int outfd, vnode_t *vp, offset_t *off) { objset_t *os; dmu_replay_record_t *drr; @@ -561,6 +583,8 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, } #endif + if (large_block_ok && ds->ds_large_blocks) + featureflags |= DMU_BACKUP_FEATURE_LARGE_BLOCKS; if (embedok && spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMBEDDED_DATA)) { featureflags |= DMU_BACKUP_FEATURE_EMBED_DATA; @@ -656,7 +680,8 @@ out: int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, - boolean_t embedok, int outfd, vnode_t *vp, offset_t *off) + boolean_t embedok, boolean_t large_block_ok, + int outfd, vnode_t *vp, offset_t *off) { dsl_pool_t *dp; dsl_dataset_t *ds; @@ -690,18 +715,19 @@ dmu_send_obj(const char *pool, uint64_t zb.zbm_guid = fromds->ds_phys->ds_guid; is_clone = (fromds->ds_dir != ds->ds_dir); dsl_dataset_rele(fromds, FTAG); - err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, embedok, - outfd, vp, off); + err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, + embedok, large_block_ok, outfd, vp, off); } else { - err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, embedok, - outfd, vp, off); + err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, + embedok, large_block_ok, outfd, vp, off); } dsl_dataset_rele(ds, FTAG); return (err); } int -dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok, +dmu_send(const char *tosnap, const char *fromsnap, + boolean_t embedok, boolean_t large_block_ok, int outfd, vnode_t *vp, offset_t *off) { dsl_pool_t *dp; @@ -768,11 +794,11 @@ dmu_send(const char *tosnap, const char dsl_pool_rele(dp, FTAG); return (err); } - err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, embedok, - outfd, vp, off); + err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, + embedok, large_block_ok, outfd, vp, off); } else { - err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, embedok, - outfd, vp, off); + err = dmu_send_impl(FTAG, dp, ds, NULL, B_FALSE, + embedok, large_block_ok, outfd, vp, off); } if (owned) dsl_dataset_disown(ds, FTAG); @@ -972,6 +998,15 @@ dmu_recv_begin_check(void *arg, dmu_tx_t !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LZ4_COMPRESS)) return (SET_ERROR(ENOTSUP)); + /* + * The receiving code doesn't know how to translate large blocks + * to smaller ones, so the pool must have the LARGE_BLOCKS + * feature enabled if the stream has LARGE_BLOCKS. + */ + if ((featureflags & DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SET_ERROR(ENOTSUP)); + error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* target fs already exists; recv into temp clone */ @@ -1097,6 +1132,13 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } VERIFY0(dsl_dataset_own_obj(dp, dsobj, dmu_recv_tag, &newds)); + if ((DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) & + DMU_BACKUP_FEATURE_LARGE_BLOCKS) && + !newds->ds_large_blocks) { + dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); + newds->ds_large_blocks = B_TRUE; + } + dmu_buf_will_dirty(newds->ds_dbuf, tx); newds->ds_phys->ds_flags |= DS_FLAG_INCONSISTENT; @@ -1222,6 +1264,7 @@ restore_read(struct restorearg *ra, int /* some things will require 8-byte alignment, so everything must */ ASSERT0(len % 8); + ASSERT3U(len, <=, ra->bufsize); while (done < len) { ssize_t resid; @@ -1361,7 +1404,7 @@ restore_object(struct restorearg *ra, ob drro->drr_compress >= ZIO_COMPRESS_FUNCTIONS || P2PHASE(drro->drr_blksz, SPA_MINBLOCKSIZE) || drro->drr_blksz < SPA_MINBLOCKSIZE || - drro->drr_blksz > SPA_MAXBLOCKSIZE || + drro->drr_blksz > spa_maxblocksize(dmu_objset_spa(os)) || drro->drr_bonuslen > DN_MAX_BONUSLEN) { return (SET_ERROR(EINVAL)); } @@ -1634,7 +1677,7 @@ restore_spill(struct restorearg *ra, obj int err; if (drrs->drr_length < SPA_MINBLOCKSIZE || - drrs->drr_length > SPA_MAXBLOCKSIZE) + drrs->drr_length > spa_maxblocksize(dmu_objset_spa(os))) return (SET_ERROR(EINVAL)); data = restore_read(ra, drrs->drr_length, NULL); @@ -1721,7 +1764,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, ra.cksum = drc->drc_cksum; ra.vp = vp; ra.voff = *voffp; - ra.bufsize = 1<<20; + ra.bufsize = SPA_MAXBLOCKSIZE; ra.buf = kmem_alloc(ra.bufsize, KM_SLEEP); /* these were verified in dmu_recv_begin */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Nov 8 06:43:33 2014 (r274273) @@ -224,7 +224,7 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u return; min_bs = SPA_MINBLOCKSHIFT; - max_bs = SPA_MAXBLOCKSHIFT; + max_bs = highbit64(txh->txh_tx->tx_objset->os_recordsize) - 1; min_ibs = DN_MIN_INDBLKSHIFT; max_ibs = DN_MAX_INDBLKSHIFT; @@ -293,6 +293,14 @@ dmu_tx_count_write(dmu_tx_hold_t *txh, u */ ASSERT(dn->dn_datablkshift != 0); min_bs = max_bs = dn->dn_datablkshift; + } else { + /* + * The blocksize can increase up to the recordsize, + * or if it is already more than the recordsize, + * up to the next power of 2. + */ + min_bs = highbit64(dn->dn_datablksz - 1); + max_bs = MAX(max_bs, highbit64(dn->dn_datablksz - 1)); } /* @@ -750,11 +758,11 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o bp = &dn->dn_phys->dn_blkptr[0]; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) - txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; + txh->txh_space_tooverwrite += MZAP_MAX_BLKSZ; else - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += MZAP_MAX_BLKSZ; if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += SPA_MAXBLOCKSIZE; + txh->txh_space_tounref += MZAP_MAX_BLKSZ; return; } @@ -1543,18 +1551,18 @@ dmu_tx_hold_spill(dmu_tx_t *tx, uint64_t /* If blkptr doesn't exist then add space to towrite */ if (!(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) { - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; } else { blkptr_t *bp; bp = &dn->dn_phys->dn_spill; if (dsl_dataset_block_freeable(dn->dn_objset->os_dsl_dataset, bp, bp->blk_birth)) - txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; + txh->txh_space_tooverwrite += SPA_OLD_MAXBLOCKSIZE; else - txh->txh_space_towrite += SPA_MAXBLOCKSIZE; + txh->txh_space_towrite += SPA_OLD_MAXBLOCKSIZE; if (!BP_IS_HOLE(bp)) - txh->txh_space_tounref += SPA_MAXBLOCKSIZE; + txh->txh_space_tounref += SPA_OLD_MAXBLOCKSIZE; } } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Nov 8 06:43:33 2014 (r274273) @@ -510,10 +510,10 @@ dnode_allocate(dnode_t *dn, dmu_object_t { int i; + ASSERT3U(blocksize, <=, + spa_maxblocksize(dmu_objset_spa(dn->dn_objset))); if (blocksize == 0) blocksize = 1 << zfs_default_bs; - else if (blocksize > SPA_MAXBLOCKSIZE) - blocksize = SPA_MAXBLOCKSIZE; else blocksize = P2ROUNDUP(blocksize, SPA_MINBLOCKSIZE); @@ -594,7 +594,8 @@ dnode_reallocate(dnode_t *dn, dmu_object int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); - ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE); + ASSERT3U(blocksize, <=, + spa_maxblocksize(dmu_objset_spa(dn->dn_objset))); ASSERT0(blocksize % SPA_MINBLOCKSIZE); ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT || dmu_tx_private_ok(tx)); ASSERT(tx->tx_txg != 0); @@ -1347,10 +1348,9 @@ dnode_set_blksz(dnode_t *dn, uint64_t si dmu_buf_impl_t *db; int err; + ASSERT3U(size, <=, spa_maxblocksize(dmu_objset_spa(dn->dn_objset))); if (size == 0) size = SPA_MINBLOCKSIZE; - if (size > SPA_MAXBLOCKSIZE) - size = SPA_MAXBLOCKSIZE; else size = P2ROUNDUP(size, SPA_MINBLOCKSIZE); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Nov 8 06:43:33 2014 (r274273) @@ -50,6 +50,17 @@ #include #include +/* + * The SPA supports block sizes up to 16MB. However, very large blocks + * can have an impact on i/o latency (e.g. tying up a spinning disk for + * ~300ms), and also potentially on the memory allocator. Therefore, + * we do not allow the recordsize to be set larger than zfs_max_recordsize + * (default 1MB). Larger blocks can be created by changing this tunable, + * and pools with larger blocks can always be imported and used, regardless + * of this setting. + */ +int zfs_max_recordsize = 1 * 1024 * 1024; + #define SWITCH64(x, y) \ { \ uint64_t __tmp = (x); \ @@ -59,8 +70,6 @@ #define DS_REF_MAX (1ULL << 62) -#define DSL_DEADLIST_BLOCKSIZE SPA_MAXBLOCKSIZE - /* * Figure out how much of this delta should be propogated to the dsl_dir * layer. If there's a refreservation, that space has already been @@ -110,6 +119,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds ds->ds_phys->ds_compressed_bytes += compressed; ds->ds_phys->ds_uncompressed_bytes += uncompressed; ds->ds_phys->ds_unique_bytes += used; + if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) + ds->ds_need_large_blocks = B_TRUE; mutex_exit(&ds->ds_lock); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, compressed, uncompressed, tx); @@ -387,6 +398,14 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), offsetof(dmu_sendarg_t, dsa_link)); + if (doi.doi_type == DMU_OTN_ZAP_METADATA) { + err = zap_contains(mos, dsobj, DS_FIELD_LARGE_BLOCKS); + if (err == 0) + ds->ds_large_blocks = B_TRUE; + else + ASSERT3U(err, ==, ENOENT); + } + if (err == 0) { err = dsl_dir_hold_obj(dp, ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); @@ -700,6 +719,9 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_flags |= origin->ds_phys->ds_flags & (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); + if (origin->ds_large_blocks) + dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); + dmu_buf_will_dirty(origin->ds_dbuf, tx); origin->ds_phys->ds_num_children++; @@ -1213,6 +1235,9 @@ dsl_dataset_snapshot_sync_impl(dsl_datas dsphys->ds_bp = ds->ds_phys->ds_bp; dmu_buf_rele(dbuf, FTAG); + if (ds->ds_large_blocks) + dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); + ASSERT3U(ds->ds_prev != 0, ==, ds->ds_phys->ds_prev_snap_obj != 0); if (ds->ds_prev) { uint64_t next_clones_obj = @@ -1486,6 +1511,11 @@ dsl_dataset_sync(dsl_dataset_t *ds, zio_ ds->ds_phys->ds_fsid_guid = ds->ds_fsid_guid; dmu_objset_sync(ds->ds_objset, zio, tx); + + if (ds->ds_need_large_blocks && !ds->ds_large_blocks) { + dsl_dataset_activate_large_blocks_sync_impl(ds->ds_object, tx); + ds->ds_large_blocks = B_TRUE; + } } static void @@ -3128,6 +3158,77 @@ dsl_dataset_space_wouldfree(dsl_dataset_ return (err); } +static int +dsl_dataset_activate_large_blocks_check(void *arg, dmu_tx_t *tx) +{ + const char *dsname = arg; + dsl_dataset_t *ds; + dsl_pool_t *dp = dmu_tx_pool(tx); + int error = 0; + + if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SET_ERROR(ENOTSUP)); + + ASSERT(spa_feature_is_enabled(dp->dp_spa, + SPA_FEATURE_EXTENSIBLE_DATASET)); + + error = dsl_dataset_hold(dp, dsname, FTAG, &ds); + if (error != 0) + return (error); + + if (ds->ds_large_blocks) + error = EALREADY; + dsl_dataset_rele(ds, FTAG); + + return (error); +} + +void +dsl_dataset_activate_large_blocks_sync_impl(uint64_t dsobj, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + objset_t *mos = dmu_tx_pool(tx)->dp_meta_objset; + uint64_t zero = 0; + + spa_feature_incr(spa, SPA_FEATURE_LARGE_BLOCKS, tx); + dmu_object_zapify(mos, dsobj, DMU_OT_DSL_DATASET, tx); + + VERIFY0(zap_add(mos, dsobj, DS_FIELD_LARGE_BLOCKS, + sizeof (zero), 1, &zero, tx)); +} + +static void +dsl_dataset_activate_large_blocks_sync(void *arg, dmu_tx_t *tx) +{ + const char *dsname = arg; + dsl_dataset_t *ds; + + VERIFY0(dsl_dataset_hold(dmu_tx_pool(tx), dsname, FTAG, &ds)); + + dsl_dataset_activate_large_blocks_sync_impl(ds->ds_object, tx); + ASSERT(!ds->ds_large_blocks); + ds->ds_large_blocks = B_TRUE; + dsl_dataset_rele(ds, FTAG); +} + +int +dsl_dataset_activate_large_blocks(const char *dsname) +{ + int error; + + error = dsl_sync_task(dsname, + dsl_dataset_activate_large_blocks_check, + dsl_dataset_activate_large_blocks_sync, (void *)dsname, + 1, ZFS_SPACE_CHECK_RESERVED); + + /* + * EALREADY indicates that this dataset already supports large blocks. + */ + if (error == EALREADY) + error = 0; + return (error); +} + /* * Return TRUE if 'earlier' is an earlier snapshot in 'later's timeline. * For example, they could both be snapshots of the same filesystem, and Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c Sat Nov 8 06:43:33 2014 (r274273) @@ -143,7 +143,7 @@ uint64_t dsl_deadlist_alloc(objset_t *os, dmu_tx_t *tx) { if (spa_version(dmu_objset_spa(os)) < SPA_VERSION_DEADLISTS) - return (bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx)); + return (bpobj_alloc(os, SPA_OLD_MAXBLOCKSIZE, tx)); return (zap_create(os, DMU_OT_DEADLIST, DMU_OT_DEADLIST_HDR, sizeof (dsl_deadlist_phys_t), tx)); } @@ -180,7 +180,7 @@ dle_enqueue(dsl_deadlist_t *dl, dsl_dead { if (dle->dle_bpobj.bpo_object == dmu_objset_pool(dl->dl_os)->dp_empty_bpobj) { - uint64_t obj = bpobj_alloc(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + uint64_t obj = bpobj_alloc(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx); bpobj_close(&dle->dle_bpobj); bpobj_decr_empty(dl->dl_os, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); @@ -254,7 +254,7 @@ dsl_deadlist_add_key(dsl_deadlist_t *dl, dle = kmem_alloc(sizeof (*dle), KM_SLEEP); dle->dle_mintxg = mintxg; - obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, bpobj_open(&dle->dle_bpobj, dl->dl_os, obj)); avl_add(&dl->dl_tree, dle); @@ -338,7 +338,7 @@ dsl_deadlist_clone(dsl_deadlist_t *dl, u if (dle->dle_mintxg >= maxtxg) break; - obj = bpobj_alloc_empty(dl->dl_os, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc_empty(dl->dl_os, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY3U(0, ==, zap_add_int_key(dl->dl_os, newobj, dle->dle_mintxg, obj, tx)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c Sat Nov 8 06:43:33 2014 (r274273) @@ -264,6 +264,10 @@ dsl_destroy_snapshot_sync_impl(dsl_datas obj = ds->ds_object; + if (ds->ds_large_blocks) { + ASSERT0(zap_contains(mos, obj, DS_FIELD_LARGE_BLOCKS)); + spa_feature_decr(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS, tx); + } if (ds->ds_phys->ds_prev_snap_obj != 0) { ASSERT3P(ds->ds_prev, ==, NULL); VERIFY0(dsl_dataset_hold_obj(dp, @@ -720,6 +724,9 @@ dsl_destroy_head_sync_impl(dsl_dataset_t ASSERT0(ds->ds_reserved); } + if (ds->ds_large_blocks) + spa_feature_decr(dp->dp_spa, SPA_FEATURE_LARGE_BLOCKS, tx); + dsl_scan_ds_destroyed(ds, tx); obj = ds->ds_object; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Sat Nov 8 06:43:33 2014 (r274273) @@ -367,7 +367,7 @@ dsl_pool_create(spa_t *spa, nvlist_t *zp FREE_DIR_NAME, &dp->dp_free_dir)); /* create and open the free_bplist */ - obj = bpobj_alloc(dp->dp_meta_objset, SPA_MAXBLOCKSIZE, tx); + obj = bpobj_alloc(dp->dp_meta_objset, SPA_OLD_MAXBLOCKSIZE, tx); VERIFY(zap_add(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj, tx) == 0); VERIFY0(bpobj_open(&dp->dp_free_bpobj, @@ -792,7 +792,7 @@ dsl_pool_upgrade_dir_clones(dsl_pool_t * * subobj support. So call dmu_object_alloc() directly. */ obj = dmu_object_alloc(dp->dp_meta_objset, DMU_OT_BPOBJ, - SPA_MAXBLOCKSIZE, DMU_OT_BPOBJ_HDR, sizeof (bpobj_phys_t), tx); + SPA_OLD_MAXBLOCKSIZE, DMU_OT_BPOBJ_HDR, sizeof (bpobj_phys_t), tx); VERIFY0(zap_add(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT, DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj, tx)); VERIFY0(bpobj_open(&dp->dp_free_bpobj, dp->dp_meta_objset, obj)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Sat Nov 8 06:43:33 2014 (r274273) @@ -125,7 +125,7 @@ int metaslab_debug_unload = 0; * an allocation of this size then it switches to using more * aggressive strategy (i.e search by size rather than offset). */ -uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; +uint64_t metaslab_df_alloc_threshold = SPA_OLD_MAXBLOCKSIZE; /* * The minimum free space, in percent, which must be available Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c Sat Nov 8 06:43:33 2014 (r274273) @@ -500,7 +500,7 @@ sa_resize_spill(sa_handle_t *hdl, uint32 if (size == 0) { blocksize = SPA_MINBLOCKSIZE; - } else if (size > SPA_MAXBLOCKSIZE) { + } else if (size > SPA_OLD_MAXBLOCKSIZE) { ASSERT(0); return (SET_ERROR(EFBIG)); } else { @@ -675,7 +675,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu hdrsize = sa_find_sizes(sa, attr_desc, attr_count, hdl->sa_bonus, SA_BONUS, &i, &used, &spilling); - if (used > SPA_MAXBLOCKSIZE) + if (used > SPA_OLD_MAXBLOCKSIZE) return (SET_ERROR(EFBIG)); VERIFY(0 == dmu_set_bonus(hdl->sa_bonus, spilling ? @@ -699,7 +699,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu attr_count - i, hdl->sa_spill, SA_SPILL, &i, &spill_used, &dummy); - if (spill_used > SPA_MAXBLOCKSIZE) + if (spill_used > SPA_OLD_MAXBLOCKSIZE) return (SET_ERROR(EFBIG)); buf_space = hdl->sa_spill->db_size - spillhdrsize; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Sat Nov 8 06:43:33 2014 (r274273) @@ -267,6 +267,14 @@ spa_prop_get_config(spa_t *spa, nvlist_t spa_prop_add_list(*nvp, ZPOOL_PROP_ALTROOT, spa->spa_root, 0, ZPROP_SRC_LOCAL); + if (spa_feature_is_enabled(spa, SPA_FEATURE_LARGE_BLOCKS)) { + spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL, + MIN(zfs_max_recordsize, SPA_MAXBLOCKSIZE), ZPROP_SRC_NONE); + } else { + spa_prop_add_list(*nvp, ZPOOL_PROP_MAXBLOCKSIZE, NULL, + SPA_OLD_MAXBLOCKSIZE, ZPROP_SRC_NONE); + } + if ((dp = list_head(&spa->spa_config_list)) != NULL) { if (dp->scd_path == NULL) { spa_prop_add_list(*nvp, ZPOOL_PROP_CACHEFILE, @@ -481,7 +489,7 @@ spa_prop_validate(spa_t *spa, nvlist_t * if (!error) { objset_t *os; - uint64_t compress; + uint64_t propval; if (strval == NULL || strval[0] == '\0') { objnum = zpool_prop_default_numeric( @@ -492,15 +500,25 @@ spa_prop_validate(spa_t *spa, nvlist_t * if (error = dmu_objset_hold(strval, FTAG, &os)) break; - /* Must be ZPL and not gzip compressed. */ + /* + * Must be ZPL, and its property settings + * must be supported by GRUB (compression + * is not gzip, and large blocks are not used). + */ if (dmu_objset_type(os) != DMU_OST_ZFS) { error = SET_ERROR(ENOTSUP); } else if ((error = dsl_prop_get_int_ds(dmu_objset_ds(os), zfs_prop_to_name(ZFS_PROP_COMPRESSION), - &compress)) == 0 && - !BOOTFS_COMPRESS_VALID(compress)) { + &propval)) == 0 && + !BOOTFS_COMPRESS_VALID(propval)) { + error = SET_ERROR(ENOTSUP); + } else if ((error = + dsl_prop_get_int_ds(dmu_objset_ds(os), + zfs_prop_to_name(ZFS_PROP_RECORDSIZE), + &propval)) == 0 && + propval > SPA_OLD_MAXBLOCKSIZE) { error = SET_ERROR(ENOTSUP); } else { objnum = dmu_objset_id(os); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c Sat Nov 8 06:43:33 2014 (r274273) @@ -90,7 +90,7 @@ spa_history_create_obj(spa_t *spa, dmu_t ASSERT(spa->spa_history == 0); spa->spa_history = dmu_object_alloc(mos, DMU_OT_SPA_HISTORY, - SPA_MAXBLOCKSIZE, DMU_OT_SPA_HISTORY_OFFSETS, + SPA_OLD_MAXBLOCKSIZE, DMU_OT_SPA_HISTORY_OFFSETS, sizeof (spa_history_phys_t), tx); VERIFY(zap_add(mos, DMU_POOL_DIRECTORY_OBJECT, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Sat Nov 8 06:43:33 2014 (r274273) @@ -1963,3 +1963,12 @@ spa_debug_enabled(spa_t *spa) { return (spa->spa_debug); } + +int +spa_maxblocksize(spa_t *spa) +{ + if (spa_feature_is_enabled(spa, SPA_FEATURE_LARGE_BLOCKS)) + return (SPA_MAXBLOCKSIZE); + else + return (SPA_OLD_MAXBLOCKSIZE); +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Sat Nov 8 06:43:33 2014 (r274273) @@ -249,7 +249,7 @@ void zfs_znode_byteswap(void *buf, size_ * The maximum number of bytes that can be accessed as part of one * operation, including metadata. */ -#define DMU_MAX_ACCESS (10<<20) /* 10MB */ +#define DMU_MAX_ACCESS (32 * 1024 * 1024) /* 32MB */ #define DMU_MAX_DELETEBLKCNT (20480) /* ~5MB of indirect blocks */ #define DMU_USERUSED_OBJECT (-1ULL) @@ -637,6 +637,7 @@ void xuio_stat_wbuf_copied(); void xuio_stat_wbuf_nocopy(); extern int zfs_prefetch_disable; +extern int zfs_max_recordsize; /* * Asynchronously try to read in the data. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_objset.h Sat Nov 8 06:43:33 2014 (r274273) @@ -95,6 +95,7 @@ struct objset { zfs_cache_type_t os_secondary_cache; zfs_sync_type_t os_sync; zfs_redundant_metadata_type_t os_redundant_metadata; + int os_recordsize; /* no lock needed: */ struct dmu_tx *os_synctx; /* XXX sketchy */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_send.h Sat Nov 8 06:43:33 2014 (r274273) @@ -37,12 +37,14 @@ struct dsl_dataset; struct drr_begin; struct avl_tree; -int dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok, +int dmu_send(const char *tosnap, const char *fromsnap, + boolean_t embedok, boolean_t large_block_ok, int outfd, struct vnode *vp, offset_t *off); int dmu_send_estimate(struct dsl_dataset *ds, struct dsl_dataset *fromds, uint64_t *sizep); int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap, - boolean_t embedok, int outfd, vnode_t *vp, offset_t *off); + boolean_t embedok, boolean_t large_block_ok, + int outfd, struct vnode *vp, offset_t *off); typedef struct dmu_recv_cookie { struct dsl_dataset *drc_ds; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Sat Nov 8 06:43:33 2014 (r274273) @@ -83,6 +83,13 @@ struct dsl_pool; #define DS_FIELD_BOOKMARK_NAMES "com.delphix:bookmarks" /* + * This field is present (with value=0) if this dataset may contain large + * blocks (>128KB). If it is present, then this dataset + * is counted in the refcount of the SPA_FEATURE_LARGE_BLOCKS feature. + */ +#define DS_FIELD_LARGE_BLOCKS "org.open-zfs:large_blocks" + +/* * DS_FLAG_CI_DATASET is set if the dataset contains a file system whose * name lookups should be performed case-insensitively. */ @@ -135,6 +142,8 @@ typedef struct dsl_dataset { /* only used in syncing context, only valid for non-snapshots: */ struct dsl_dataset *ds_prev; uint64_t ds_bookmarks; /* DMU_OTN_ZAP_METADATA */ + boolean_t ds_large_blocks; + boolean_t ds_need_large_blocks; /* has internal locking: */ dsl_deadlist_t ds_deadlist; @@ -244,6 +253,8 @@ int dsl_dataset_space_written(dsl_datase int dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap, dsl_dataset_t *last, uint64_t *usedp, uint64_t *compp, uint64_t *uncompp); boolean_t dsl_dataset_is_dirty(dsl_dataset_t *ds); +int dsl_dataset_activate_large_blocks(const char *dsname); +void dsl_dataset_activate_large_blocks_sync_impl(uint64_t dsobj, dmu_tx_t *tx); int dsl_dsobj_to_dsname(char *pname, uint64_t obj, char *buf); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Sat Nov 8 06:43:33 2014 (r274273) @@ -94,17 +94,26 @@ _NOTE(CONSTCOND) } while (0) _NOTE(CONSTCOND) } while (0) /* - * We currently support nine block sizes, from 512 bytes to 128K. - * We could go higher, but the benefits are near-zero and the cost - * of COWing a giant block to modify one byte would become excessive. + * We currently support block sizes from 512 bytes to 16MB. + * The benefits of larger blocks, and thus larger IO, need to be weighed + * against the cost of COWing a giant block to modify one byte, and the + * large latency of reading or writing a large block. + * + * Note that although blocks up to 16MB are supported, the recordsize + * property can not be set larger than zfs_max_recordsize (default 1MB). + * See the comment near zfs_max_recordsize in dsl_dataset.c for details. + * + * Note that although the LSIZE field of the blkptr_t can store sizes up + * to 32MB, the dnode's dn_datablkszsec can only store sizes up to + * 32MB - 512 bytes. Therefore, we limit SPA_MAXBLOCKSIZE to 16MB. */ #define SPA_MINBLOCKSHIFT 9 -#define SPA_MAXBLOCKSHIFT 17 +#define SPA_OLD_MAXBLOCKSHIFT 17 +#define SPA_MAXBLOCKSHIFT 24 #define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT) +#define SPA_OLD_MAXBLOCKSIZE (1ULL << SPA_OLD_MAXBLOCKSHIFT) #define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT) -#define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) - /* * Size of block to hold the configuration data (a packed nvlist) */ @@ -781,6 +790,7 @@ extern boolean_t spa_has_slogs(spa_t *sp extern boolean_t spa_is_root(spa_t *spa); extern boolean_t spa_writeable(spa_t *spa); extern boolean_t spa_has_pending_synctask(spa_t *spa); +extern int spa_maxblocksize(spa_t *spa); extern int spa_mode(spa_t *spa); extern uint64_t strtonum(const char *str, char **nptr); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h Sat Nov 8 06:43:33 2014 (r274273) @@ -42,8 +42,7 @@ extern int fzap_default_block_shift; #define MZAP_ENT_LEN 64 #define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2) -#define MZAP_MAX_BLKSHIFT SPA_MAXBLOCKSHIFT -#define MZAP_MAX_BLKSZ (1 << MZAP_MAX_BLKSHIFT) +#define MZAP_MAX_BLKSZ SPA_OLD_MAXBLOCKSIZE #define ZAP_NEED_CD (-1U) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Nov 8 06:43:33 2014 (r274273) @@ -85,13 +85,16 @@ typedef enum drr_headertype { /* flags #3 - #15 are reserved for incompatible closed-source implementations */ #define DMU_BACKUP_FEATURE_EMBED_DATA (1<<16) #define DMU_BACKUP_FEATURE_EMBED_DATA_LZ4 (1<<17) +/* flag #18 is reserved for a Delphix feature */ +#define DMU_BACKUP_FEATURE_LARGE_BLOCKS (1<<19) /* * Mask of all supported backup features */ #define DMU_BACKUP_FEATURE_MASK (DMU_BACKUP_FEATURE_DEDUP | \ DMU_BACKUP_FEATURE_DEDUPPROPS | DMU_BACKUP_FEATURE_SA_SPILL | \ - DMU_BACKUP_FEATURE_EMBED_DATA | DMU_BACKUP_FEATURE_EMBED_DATA_LZ4) + DMU_BACKUP_FEATURE_EMBED_DATA | DMU_BACKUP_FEATURE_EMBED_DATA_LZ4 | \ + DMU_BACKUP_FEATURE_LARGE_BLOCKS) /* Are all features in the given flag word currently supported? */ #define DMU_STREAM_SUPPORTED(x) (!((x) & ~DMU_BACKUP_FEATURE_MASK)) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Sat Nov 8 06:43:33 2014 (r274273) @@ -136,8 +136,6 @@ extern "C" { #define ZFS_SHARES_DIR "SHARES" #define ZFS_SA_ATTRS "SA_ATTRS" -#define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) - /* * Path component length * Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil.h Sat Nov 8 06:43:33 2014 (r274273) @@ -90,7 +90,6 @@ typedef struct zil_chain { } zil_chain_t; #define ZIL_MIN_BLKSZ 4096ULL -#define ZIL_MAX_BLKSZ SPA_MAXBLOCKSIZE /* * The words of a log block checksum. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Sat Nov 8 06:34:37 2014 (r274272) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zil_impl.h Sat Nov 8 06:43:33 2014 (r274273) @@ -139,7 +139,7 @@ typedef struct zil_bp_node { avl_node_t zn_node; } zil_bp_node_t; -#define ZIL_MAX_LOG_DATA (SPA_MAXBLOCKSIZE - sizeof (zil_chain_t) - \ +#define ZIL_MAX_LOG_DATA (SPA_OLD_MAXBLOCKSIZE - sizeof (zil_chain_t) - \ sizeof (lr_write_t)) #ifdef __cplusplus *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 07:23:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9387D7; Sat, 8 Nov 2014 07:23:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B8E7C29; Sat, 8 Nov 2014 07:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA87N2GX046824; Sat, 8 Nov 2014 07:23:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA87N2hx046823; Sat, 8 Nov 2014 07:23:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411080723.sA87N2hx046823@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 8 Nov 2014 07:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274274 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 07:23:02 -0000 Author: glebius Date: Sat Nov 8 07:23:01 2014 New Revision: 274274 URL: https://svnweb.freebsd.org/changeset/base/274274 Log: ifindex_alloc_locked() never fails and doesn't have no-lock version, so change the prototype. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Nov 8 06:43:33 2014 (r274273) +++ head/sys/net/if.c Sat Nov 8 07:23:01 2014 (r274274) @@ -265,13 +265,12 @@ ifnet_byindex_ref(u_short idx) * Allocate an ifindex array entry; return 0 on success or an error on * failure. */ -static int -ifindex_alloc_locked(u_short *idxp) +static u_short +ifindex_alloc(void) { u_short idx; IFNET_WLOCK_ASSERT(); - retry: /* * Try to find an empty slot below V_if_index. If we fail, take the @@ -289,8 +288,7 @@ retry: } if (idx > V_if_index) V_if_index = idx; - *idxp = idx; - return (0); + return (idx); } static void @@ -431,11 +429,7 @@ if_alloc(u_char type) ifp = malloc(sizeof(struct ifnet), M_IFNET, M_WAITOK|M_ZERO); IFNET_WLOCK(); - if (ifindex_alloc_locked(&idx) != 0) { - IFNET_WUNLOCK(); - free(ifp, M_IFNET); - return (NULL); - } + idx = ifindex_alloc(); ifnet_setbyindex_locked(idx, IFNET_HOLD); IFNET_WUNLOCK(); ifp->if_index = idx; @@ -1022,7 +1016,6 @@ if_detach_internal(struct ifnet *ifp, in void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { - u_short idx; /* * Detach from current vnet, but preserve LLADDR info, do not @@ -1054,11 +1047,7 @@ if_vmove(struct ifnet *ifp, struct vnet CURVNET_SET_QUIET(new_vnet); IFNET_WLOCK(); - if (ifindex_alloc_locked(&idx) != 0) { - IFNET_WUNLOCK(); - panic("if_index overflow"); - } - ifp->if_index = idx; + ifp->if_index = ifindex_alloc(); ifnet_setbyindex_locked(ifp->if_index, ifp); IFNET_WUNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 07:30:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8635421; Sat, 8 Nov 2014 07:30:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99B7AC6B; Sat, 8 Nov 2014 07:30:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA87Ufrf048986; Sat, 8 Nov 2014 07:30:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA87Uf3q048984; Sat, 8 Nov 2014 07:30:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411080730.sA87Uf3q048984@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 8 Nov 2014 07:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274276 - in head: cddl/contrib/opensolaris/cmd/zdb 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 07:30:41 -0000 Author: delphij Date: Sat Nov 8 07:30:40 2014 New Revision: 274276 URL: https://svnweb.freebsd.org/changeset/base/274276 Log: MFV r274271: Improve zdb -b performance: - Reduce gethrtime() call to 1/100th of blkptr's; - Skip manipulating the size-ordered tree; - Issue more (10, previously 3) async reads; - Use lighter weight testing in traverse_visitbp(); Illumos issue: 5243 zdb -b could be much faster MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 8 07:26:39 2014 (r274275) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 8 07:30:40 2014 (r274276) @@ -77,9 +77,11 @@ #ifndef lint extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern int zfs_vdev_async_read_max_active; #else boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; +int zfs_vdev_async_read_max_active; #endif const char cmdname[] = "zdb"; @@ -2384,8 +2386,14 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && - gethrtime() > zcb->zcb_lastprint + NANOSEC) { + /* only call gethrtime() every 100 blocks */ + static int iters; + if (++iters > 100) + iters = 0; + else + return (0); + + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; @@ -2494,6 +2502,14 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) (longlong_t)vd->vdev_ms_count); msp->ms_ops = &zdb_metaslab_ops; + + /* + * We don't want to spend the CPU + * manipulating the size-ordered + * tree, so clear the range_tree + * ops. + */ + msp->ms_tree->rt_ops = NULL; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); msp->ms_loaded = B_TRUE; @@ -3508,6 +3524,13 @@ main(int argc, char **argv) */ zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + /* + * "zdb -c" uses checksum-verifying scrub i/os which are async reads. + * "zdb -b" uses traversal prefetch which uses async reads. + * For good performance, let several of them be active at once. + */ + zfs_vdev_async_read_max_active = 10; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Nov 8 07:26:39 2014 (r274275) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Sat Nov 8 07:30:40 2014 (r274276) @@ -59,6 +59,7 @@ typedef struct traverse_data { int td_flags; prefetch_data_t *td_pfd; boolean_t td_paused; + uint64_t td_hole_birth_enabled_txg; blkptr_cb_t *td_func; void *td_arg; } traverse_data_t; @@ -229,25 +230,20 @@ traverse_visitbp(traverse_data_t *td, co } if (bp->blk_birth == 0) { - if (spa_feature_is_active(td->td_spa, SPA_FEATURE_HOLE_BIRTH)) { - /* - * Since this block has a birth time of 0 it must be a - * hole created before the SPA_FEATURE_HOLE_BIRTH - * feature was enabled. If SPA_FEATURE_HOLE_BIRTH - * was enabled before the min_txg for this traveral we - * know the hole must have been created before the - * min_txg for this traveral, so we can skip it. If - * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg - * for this traveral we cannot tell if the hole was - * created before or after the min_txg for this - * traversal, so we cannot skip it. - */ - uint64_t hole_birth_enabled_txg; - VERIFY(spa_feature_enabled_txg(td->td_spa, - SPA_FEATURE_HOLE_BIRTH, &hole_birth_enabled_txg)); - if (hole_birth_enabled_txg < td->td_min_txg) - return (0); - } + /* + * Since this block has a birth time of 0 it must be a + * hole created before the SPA_FEATURE_HOLE_BIRTH + * feature was enabled. If SPA_FEATURE_HOLE_BIRTH + * was enabled before the min_txg for this traveral we + * know the hole must have been created before the + * min_txg for this traveral, so we can skip it. If + * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg + * for this traveral we cannot tell if the hole was + * created before or after the min_txg for this + * traversal, so we cannot skip it. + */ + if (td->td_hole_birth_enabled_txg < td->td_min_txg) + return (0); } else if (bp->blk_birth <= td->td_min_txg) { return (0); } @@ -523,6 +519,13 @@ traverse_impl(spa_t *spa, dsl_dataset_t td.td_flags = flags; td.td_paused = B_FALSE; + if (spa_feature_is_active(spa, SPA_FEATURE_HOLE_BIRTH)) { + VERIFY(spa_feature_enabled_txg(spa, + SPA_FEATURE_HOLE_BIRTH, &td.td_hole_birth_enabled_txg)); + } else { + td.td_hole_birth_enabled_txg = 0; + } + pd.pd_blks_max = zfs_pd_blks_max; pd.pd_flags = flags; mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 07:50:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49625722; Sat, 8 Nov 2014 07:50:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35ABAE70; Sat, 8 Nov 2014 07:50:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA87owHJ059551; Sat, 8 Nov 2014 07:50:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA87owd2059550; Sat, 8 Nov 2014 07:50:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411080750.sA87owd2059550@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 8 Nov 2014 07:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274277 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 07:50:58 -0000 Author: trasz Date: Sat Nov 8 07:50:57 2014 New Revision: 274277 URL: https://svnweb.freebsd.org/changeset/base/274277 Log: ctld(8) doesn't require -lcam or -lssl; remove those from DPADD and LDADD. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/Makefile Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Sat Nov 8 07:30:40 2014 (r274276) +++ head/usr.sbin/ctld/Makefile Sat Nov 8 07:50:57 2014 (r274277) @@ -10,8 +10,8 @@ CFLAGS+= -I${.CURDIR}/../../sys/dev/iscs #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -DPADD= ${LIBBSDXML} ${LIBCAM} ${LIBCRYPTO} ${LIBL} ${LIBSBUF} ${LIBSSL} ${LIBUTIL} -LDADD= -lbsdxml -lcam -lcrypto -ll -lsbuf -lssl -lutil +DPADD= ${LIBBSDXML} ${LIBCRYPTO} ${LIBL} ${LIBSBUF} ${LIBUTIL} +LDADD= -lbsdxml -lcrypto -ll -lsbuf -lutil YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 07:54:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D41BAB0F; Sat, 8 Nov 2014 07:54:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0288E96; Sat, 8 Nov 2014 07:54:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA87sYZc061207; Sat, 8 Nov 2014 07:54:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA87sYPr061206; Sat, 8 Nov 2014 07:54:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411080754.sA87sYPr061206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 8 Nov 2014 07:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274278 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 07:54:34 -0000 Author: trasz Date: Sat Nov 8 07:54:34 2014 New Revision: 274278 URL: https://svnweb.freebsd.org/changeset/base/274278 Log: Improve wording in ctl.conf(5). Differential Revision: https://reviews.freebsd.org/D1020 Reviewed by: bcr@ (earlier version), wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctl.conf.5 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sat Nov 8 07:50:57 2014 (r274277) +++ head/usr.sbin/ctld/ctl.conf.5 Sat Nov 8 07:54:34 2014 (r274278) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2014 +.Dd November 8, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -202,9 +202,10 @@ When set to the check will include .Sy initiator-portal , .Sy initiator-name , -and authentication credentials, ie. if the target does not require -CHAP authentication, or if CHAP user and secret used during discovery -match CHAP user and secret required to access the target. +and authentication credentials. +The target is returned if it does not require CHAP authentication, +or if the CHAP user and secret used during discovery match those +used by the target. Note that when using .Qq Ar portal-name-auth , targets that require CHAP authentication will only be returned if From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 11:56:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F93A321; Sat, 8 Nov 2014 11:56:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C5C07F1; Sat, 8 Nov 2014 11:56:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8BuRRl073367; Sat, 8 Nov 2014 11:56:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8BuRJM073366; Sat, 8 Nov 2014 11:56:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411081156.sA8BuRJM073366@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 8 Nov 2014 11:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274279 - 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 11:56:27 -0000 Author: kib Date: Sat Nov 8 11:56:26 2014 New Revision: 274279 URL: https://svnweb.freebsd.org/changeset/base/274279 Log: MFi386 r253328: Create a proper stack frame for amd64 version of bcopy(). Note that this also makes the stack properly aligned in the function, despite it is not strictly needed. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sat Nov 8 07:54:34 2014 (r274278) +++ head/sys/amd64/amd64/support.S Sat Nov 8 11:56:26 2014 (r274279) @@ -100,6 +100,8 @@ END(bcmp) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ ENTRY(bcopy) + pushq %rbp + movq %rsp,%rbp xchgq %rsi,%rdi movq %rdx,%rcx @@ -116,6 +118,7 @@ ENTRY(bcopy) andq $7,%rcx /* any bytes left? */ rep movsb + popq %rbp ret /* ALIGN_TEXT */ @@ -135,6 +138,7 @@ ENTRY(bcopy) rep movsq cld + popq %rbp ret END(bcopy) From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 13:19:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B70487F; Sat, 8 Nov 2014 13:19:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E79CE7C; Sat, 8 Nov 2014 13:19:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8DJm8s012253; Sat, 8 Nov 2014 13:19:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8DJmqm012252; Sat, 8 Nov 2014 13:19:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411081319.sA8DJmqm012252@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 8 Nov 2014 13:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274286 - head/contrib/llvm/lib/MC/MCParser 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 13:19:49 -0000 Author: dim Date: Sat Nov 8 13:19:48 2014 New Revision: 274286 URL: https://svnweb.freebsd.org/changeset/base/274286 Log: Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. There is code in the wild that relies on $0 not being expanded. This fixes some cases of using $ signs in literals being incorrectly assembled. Reported by: Richard Henderson Upstream PR: http://llvm.org/PR21500 MFC after: 3 days Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Sat Nov 8 12:59:32 2014 (r274285) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Sat Nov 8 13:19:48 2014 (r274286) @@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ const MCAsmMacroParameters &Parameters, const MCAsmMacroArguments &A, const SMLoc &L) { unsigned NParameters = Parameters.size(); - if (NParameters != 0 && NParameters != A.size()) + if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) return Error(L, "Wrong number of arguments"); // A macro without parameters is handled differently on Darwin: @@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ std::size_t End = Body.size(), Pos = 0; for (; Pos != End; ++Pos) { // Check for a substitution or escape. - if (!NParameters) { + if (IsDarwin && !NParameters) { // This macro has no parameters, look for $0, $1, etc. if (Body[Pos] != '$' || Pos + 1 == End) continue; @@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ if (Pos == End) break; - if (!NParameters) { + if (IsDarwin && !NParameters) { switch (Body[Pos + 1]) { // $$ => $ case '$': From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 14:41:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BF6F75B; Sat, 8 Nov 2014 14:41:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E7584D; Sat, 8 Nov 2014 14:41:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8EfXaB053156; Sat, 8 Nov 2014 14:41:33 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8EfXAZ053154; Sat, 8 Nov 2014 14:41:33 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201411081441.sA8EfXAZ053154@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 8 Nov 2014 14:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274289 - in head/sys: modules/if_gre 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.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 14:41:34 -0000 Author: bz Date: Sat Nov 8 14:41:32 2014 New Revision: 274289 URL: https://svnweb.freebsd.org/changeset/base/274289 Log: After r274246 make the tree compile again. gcc requires variables to be initialised in two places. One of them is correctly used only under the same conditional though. For module builds properly check if the kernel supports INET or INET6, as otherwise various mips kernels without IPv6 support would fail to build. Modified: head/sys/modules/if_gre/Makefile head/sys/net/if_gre.c Modified: head/sys/modules/if_gre/Makefile ============================================================================== --- head/sys/modules/if_gre/Makefile Sat Nov 8 13:49:59 2014 (r274288) +++ head/sys/modules/if_gre/Makefile Sat Nov 8 14:41:32 2014 (r274289) @@ -6,10 +6,24 @@ KMOD= if_gre SRCS= if_gre.c opt_inet.h opt_inet6.h +.if defined(KERNBUILDDIR) +OPT_INET!= cat ${KERNBUILDDIR}/opt_inet.h; echo +.if empty(OPT_INET) +MK_INET_SUPPORT=no +.endif +.endif + .if ${MK_INET_SUPPORT} != "no" SRCS+= ip_gre.c .endif +.if defined(KERNBUILDDIR) +OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h; echo +.if empty(OPT_INET6) +MK_INET6_SUPPORT=no +.endif +.endif + .if ${MK_INET6_SUPPORT} != "no" SRCS+= ip6_gre.c .endif Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sat Nov 8 13:49:59 2014 (r274288) +++ head/sys/net/if_gre.c Sat Nov 8 14:41:32 2014 (r274289) @@ -632,6 +632,7 @@ gre_set_tunnel(struct ifnet *ifp, struct gre_updatehdr(sc); GRE_WUNLOCK(sc); + error = 0; switch (src->sa_family) { #ifdef INET case AF_INET: @@ -865,6 +866,8 @@ gre_transmit(struct ifnet *ifp, struct m want_seq = (sc->gre_options & GRE_ENABLE_SEQ) != 0; if (want_seq) oseq = sc->gre_oseq++; /* XXX */ + else + oseq = 0; /* Make compiler happy. */ want_csum = (sc->gre_options & GRE_ENABLE_CSUM) != 0; M_SETFIB(m, sc->gre_fibnum); M_PREPEND(m, hlen, M_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 15:06:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8513B2D; Sat, 8 Nov 2014 15:06:30 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 390879FD; Sat, 8 Nov 2014 15:06:30 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id BA12F25D3892; Sat, 8 Nov 2014 15:06:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id C641BC7700C; Sat, 8 Nov 2014 15:06:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 60zX23p9iBLs; Sat, 8 Nov 2014 15:06:25 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 232BFC76FF5; Sat, 8 Nov 2014 15:06:23 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274274 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <201411080723.sA87N2hx046823@svn.freebsd.org> Date: Sat, 8 Nov 2014 15:06:20 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8B3F77C9-C79D-4303-ADB6-310B3928D51C@FreeBSD.org> References: <201411080723.sA87N2hx046823@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 15:06:30 -0000 On 08 Nov 2014, at 07:23 , Gleb Smirnoff wrote: > Author: glebius > Date: Sat Nov 8 07:23:01 2014 > New Revision: 274274 > URL: https://svnweb.freebsd.org/changeset/base/274274 >=20 > Log: > ifindex_alloc_locked() never fails and doesn't have no-lock version, > so change the prototype. >=20 > Sponsored by: Netflix > Sponsored by: Nginx, Inc. >=20 > Modified: > head/sys/net/if.c >=20 > Modified: head/sys/net/if.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/net/if.c Sat Nov 8 06:43:33 2014 (r274273) > +++ head/sys/net/if.c Sat Nov 8 07:23:01 2014 (r274274) > @@ -265,13 +265,12 @@ ifnet_byindex_ref(u_short idx) > * Allocate an ifindex array entry; return 0 on success or an error on > * failure. > */ > -static int > -ifindex_alloc_locked(u_short *idxp) > +static u_short That feels like going backwards; we should really make sure we can = support ifindexes >> 64k > +ifindex_alloc(void) > { > u_short idx; >=20 > IFNET_WLOCK_ASSERT(); > - > retry: > /* > * Try to find an empty slot below V_if_index. If we fail, take = the > @@ -289,8 +288,7 @@ retry: > } > if (idx > V_if_index) > V_if_index =3D idx; > - *idxp =3D idx; > - return (0); > + return (idx); > } >=20 > static void > @@ -431,11 +429,7 @@ if_alloc(u_char type) >=20 > ifp =3D malloc(sizeof(struct ifnet), M_IFNET, M_WAITOK|M_ZERO); > IFNET_WLOCK(); > - if (ifindex_alloc_locked(&idx) !=3D 0) { > - IFNET_WUNLOCK(); > - free(ifp, M_IFNET); > - return (NULL); > - } > + idx =3D ifindex_alloc(); > ifnet_setbyindex_locked(idx, IFNET_HOLD); > IFNET_WUNLOCK(); > ifp->if_index =3D idx; > @@ -1022,7 +1016,6 @@ if_detach_internal(struct ifnet *ifp, in > void > if_vmove(struct ifnet *ifp, struct vnet *new_vnet) > { > - u_short idx; >=20 > /* > * Detach from current vnet, but preserve LLADDR info, do not > @@ -1054,11 +1047,7 @@ if_vmove(struct ifnet *ifp, struct vnet=20 > CURVNET_SET_QUIET(new_vnet); >=20 > IFNET_WLOCK(); > - if (ifindex_alloc_locked(&idx) !=3D 0) { > - IFNET_WUNLOCK(); > - panic("if_index overflow"); > - } > - ifp->if_index =3D idx; > + ifp->if_index =3D ifindex_alloc(); > ifnet_setbyindex_locked(ifp->if_index, ifp); > IFNET_WUNLOCK(); >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 16:03:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95660472; Sat, 8 Nov 2014 16:03:14 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 18FFEE77; Sat, 8 Nov 2014 16:03:13 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sA8G34BQ071871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 8 Nov 2014 19:03:04 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sA8G34QP071870; Sat, 8 Nov 2014 19:03:04 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 8 Nov 2014 19:03:04 +0300 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r274274 - head/sys/net Message-ID: <20141108160304.GQ1031@FreeBSD.org> References: <201411080723.sA87N2hx046823@svn.freebsd.org> <8B3F77C9-C79D-4303-ADB6-310B3928D51C@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8B3F77C9-C79D-4303-ADB6-310B3928D51C@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 16:03:14 -0000 On Sat, Nov 08, 2014 at 03:06:20PM +0000, Bjoern A. Zeeb wrote: B> > Modified: head/sys/net/if.c B> > ============================================================================== B> > --- head/sys/net/if.c Sat Nov 8 06:43:33 2014 (r274273) B> > +++ head/sys/net/if.c Sat Nov 8 07:23:01 2014 (r274274) B> > @@ -265,13 +265,12 @@ ifnet_byindex_ref(u_short idx) B> > * Allocate an ifindex array entry; return 0 on success or an error on B> > * failure. B> > */ B> > -static int B> > -ifindex_alloc_locked(u_short *idxp) B> > +static u_short B> B> That feels like going backwards; we should really make sure we can support ifindexes >> 64k This isn't backwards, since if_index was u_short before the commit. I will take into account your wish and see if we can enlarge if_index. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 16:04:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35C025AE; Sat, 8 Nov 2014 16:04:26 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE8A3E7D; Sat, 8 Nov 2014 16:04:25 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sA8G4N7a071893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 8 Nov 2014 19:04:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sA8G4NbB071892; Sat, 8 Nov 2014 19:04:23 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 8 Nov 2014 19:04:23 +0300 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Subject: Re: svn commit: r274289 - in head/sys: modules/if_gre net Message-ID: <20141108160423.GR1031@FreeBSD.org> References: <201411081441.sA8EfXAZ053154@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411081441.sA8EfXAZ053154@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 16:04:26 -0000 On Sat, Nov 08, 2014 at 02:41:33PM +0000, Bjoern A. Zeeb wrote: B> Author: bz B> Date: Sat Nov 8 14:41:32 2014 B> New Revision: 274289 B> URL: https://svnweb.freebsd.org/changeset/base/274289 B> B> Log: B> After r274246 make the tree compile again. B> B> gcc requires variables to be initialised in two places. One of them B> is correctly used only under the same conditional though. B> B> For module builds properly check if the kernel supports INET or INET6, B> as otherwise various mips kernels without IPv6 support would fail to build. B> B> Modified: B> head/sys/modules/if_gre/Makefile B> head/sys/net/if_gre.c B> B> Modified: head/sys/modules/if_gre/Makefile B> ============================================================================== B> --- head/sys/modules/if_gre/Makefile Sat Nov 8 13:49:59 2014 (r274288) B> +++ head/sys/modules/if_gre/Makefile Sat Nov 8 14:41:32 2014 (r274289) B> @@ -6,10 +6,24 @@ B> KMOD= if_gre B> SRCS= if_gre.c opt_inet.h opt_inet6.h B> B> +.if defined(KERNBUILDDIR) B> +OPT_INET!= cat ${KERNBUILDDIR}/opt_inet.h; echo B> +.if empty(OPT_INET) B> +MK_INET_SUPPORT=no B> +.endif B> +.endif B> + B> .if ${MK_INET_SUPPORT} != "no" B> SRCS+= ip_gre.c B> .endif B> B> +.if defined(KERNBUILDDIR) B> +OPT_INET6!= cat ${KERNBUILDDIR}/opt_inet6.h; echo B> +.if empty(OPT_INET6) B> +MK_INET6_SUPPORT=no B> +.endif B> +.endif B> + B> .if ${MK_INET6_SUPPORT} != "no" B> SRCS+= ip6_gre.c B> .endif Thanks for the fix. This code looks very much like a dirty workaround, and we already have it in other modules, e.g. if_gif. Maybe someone with Make-foo can handle this properly in the build infrastructure. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 16:11:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A0070F; Sat, 8 Nov 2014 16:11:54 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E2CF7F23; Sat, 8 Nov 2014 16:11:53 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id DC7A525D3A92; Sat, 8 Nov 2014 16:11:50 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id EB9A4C7700C; Sat, 8 Nov 2014 16:11:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id nsaKhtHErDAW; Sat, 8 Nov 2014 16:11:48 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4E073C76FF5; Sat, 8 Nov 2014 16:11:46 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274274 - head/sys/net From: "Bjoern A. Zeeb" In-Reply-To: <20141108160304.GQ1031@FreeBSD.org> Date: Sat, 8 Nov 2014 16:11:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <17FD4DFD-D5A0-45DC-B7AC-CD44EF49B33E@FreeBSD.org> References: <201411080723.sA87N2hx046823@svn.freebsd.org> <8B3F77C9-C79D-4303-ADB6-310B3928D51C@FreeBSD.org> <20141108160304.GQ1031@FreeBSD.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 16:11:54 -0000 On 08 Nov 2014, at 16:03 , Gleb Smirnoff wrote: > On Sat, Nov 08, 2014 at 03:06:20PM +0000, Bjoern A. Zeeb wrote: > B> > Modified: head/sys/net/if.c > B> > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > B> > --- head/sys/net/if.c Sat Nov 8 06:43:33 2014 = (r274273) > B> > +++ head/sys/net/if.c Sat Nov 8 07:23:01 2014 = (r274274) > B> > @@ -265,13 +265,12 @@ ifnet_byindex_ref(u_short idx) > B> > * Allocate an ifindex array entry; return 0 on success or an = error on > B> > * failure. > B> > */ > B> > -static int > B> > -ifindex_alloc_locked(u_short *idxp) > B> > +static u_short > B>=20 > B> That feels like going backwards; we should really make sure we = can support ifindexes >> 64k >=20 > This isn't backwards, since if_index was u_short before the commit. >=20 > I will take into account your wish and see if we can enlarge if_index. Yeah, I think we fixed most of the APIs to be able to extend it and = brooks had a spare a while ago I think. Last time this was discussed the leaning was to go straight to uint64_t = to avoid any problems for the next two decades ;-) /bz =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 16:38:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14635C6C; Sat, 8 Nov 2014 16:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBA15151; Sat, 8 Nov 2014 16:37:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8Gbxgt005927; Sat, 8 Nov 2014 16:37:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8Gbx4e005926; Sat, 8 Nov 2014 16:37:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411081637.sA8Gbx4e005926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 8 Nov 2014 16:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274294 - head/contrib/llvm/patches X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 16:38:00 -0000 Author: dim Date: Sat Nov 8 16:37:59 2014 New Revision: 274294 URL: https://svnweb.freebsd.org/changeset/base/274294 Log: Add llvm patch corresponding to r274286. Added: head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Added: head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-r274286-llvm-r201784-asm-dollar.diff Sat Nov 8 16:37:59 2014 (r274294) @@ -0,0 +1,55 @@ +Pull in r201784 from upstream llvm trunk (by Benjamin Kramer): + + AsmParser: Disable Darwin-style macro argument expansion on non-darwin targets. + + There is code in the wild that relies on $0 not being expanded. + +This fixes some cases of using $ signs in literals being incorrectly +assembled. + +Reported by: Richard Henderson +Upstream PR: http://llvm.org/PR21500 + +Introduced here: http://svnweb.freebsd.org/changeset/base/274286 + +Index: lib/MC/MCParser/AsmParser.cpp +=================================================================== +--- lib/MC/MCParser/AsmParser.cpp ++++ lib/MC/MCParser/AsmParser.cpp +@@ -1695,7 +1695,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + const MCAsmMacroParameters &Parameters, + const MCAsmMacroArguments &A, const SMLoc &L) { + unsigned NParameters = Parameters.size(); +- if (NParameters != 0 && NParameters != A.size()) ++ if ((!IsDarwin || NParameters != 0) && NParameters != A.size()) + return Error(L, "Wrong number of arguments"); + + // A macro without parameters is handled differently on Darwin: +@@ -1705,7 +1705,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + std::size_t End = Body.size(), Pos = 0; + for (; Pos != End; ++Pos) { + // Check for a substitution or escape. +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + // This macro has no parameters, look for $0, $1, etc. + if (Body[Pos] != '$' || Pos + 1 == End) + continue; +@@ -1728,7 +1728,7 @@ bool AsmParser::expandMacro(raw_svector_ostream &O + if (Pos == End) + break; + +- if (!NParameters) { ++ if (IsDarwin && !NParameters) { + switch (Body[Pos + 1]) { + // $$ => $ + case '$': +Index: test/MC/AsmParser/exprs.s +=================================================================== +--- test/MC/AsmParser/exprs.s ++++ test/MC/AsmParser/exprs.s +@@ -1,4 +1,4 @@ +-// RUN: llvm-mc -triple i386-unknown-unknown %s > %t ++// RUN: llvm-mc -triple i386-apple-darwin %s + + .macro check_expr + .if ($0) != ($1) From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 17:00:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C416414; Sat, 8 Nov 2014 17:00:09 +0000 (UTC) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFCF326; Sat, 8 Nov 2014 17:00:09 +0000 (UTC) Received: by mail-qg0-f45.google.com with SMTP id z107so3787647qgd.18 for ; Sat, 08 Nov 2014 09:00:08 -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-type; bh=pDDvBC0LY81qIl4pdNVSYWTzHRX3Vj+RK2Zwcbu1xyU=; b=qHgbjW/pLQj7RzMuC+RCXGcXxLQawaOKVQTF9UikyczFnlPfadoGtb02v8hgQvLTDY JUEXKsRP2IkKMTX4KZjMLG9rc7Iqq4MQDk7YU0AtX3N1PAQRYIbE0kiY2umiTzWHZ67e //vw/WK1+Xga3k3VtVYumj4CAFhPbP91A7tDGN1cV1T6/ndBqVyiDhvsPVigsOCcPnGQ zg8SuGP0F7SxTnki10TaQP8uyisB+XDpvrSqHUs2TOEXfLWH7SrWAkh1rHrwSHabXxIA r8qASFb1l2Y662xCWXN8sKYurQzi3KdiHKLgTFUwdaYKP9qi4bE8WSjZO5VL+fjWsNt9 C+GQ== X-Received: by 10.224.47.4 with SMTP id l4mr15827268qaf.36.1415466008343; Sat, 08 Nov 2014 09:00:08 -0800 (PST) Received: from kan ([2601:6:6780:780:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id 45sm8741283qgg.37.2014.11.08.09.00.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Nov 2014 09:00:07 -0800 (PST) Date: Sat, 8 Nov 2014 12:00:00 -0500 From: Alexander Kabaev To: Mark Johnston Subject: Re: svn commit: r274200 - head/share/mk Message-ID: <20141108120000.3f16feab@kan> In-Reply-To: <201411062246.sA6MkeLN018716@svn.freebsd.org> References: <201411062246.sA6MkeLN018716@svn.freebsd.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/GivU/EKY5jztYj/V4/o8gyA"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 17:00:09 -0000 --Sig_/GivU/EKY5jztYj/V4/o8gyA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 6 Nov 2014 22:46:40 +0000 (UTC) Mark Johnston wrote: > Author: markj > Date: Thu Nov 6 22:46:40 2014 > New Revision: 274200 > URL: https://svnweb.freebsd.org/changeset/base/274200 >=20 > Log: > Automatically build with debug symbols when building with WITH_CTF. > Otherwise there's nothing for ctfconvert to do, and it ends up > emitting an error for each object file. Also remove some redundant > checks from bsd.prog.mk and bsd.lib.mk. =20 > =20 > -.if ${MK_CTF} !=3D "no" && ${DEBUG_FLAGS:M-g} !=3D "" > +.if ${MK_CTF} !=3D "no" > CTFFLAGS+=3D -g > .endif > .else I have a question about this and another similar change. Does it have the effect of always leaving binaries with debug symbols in id WITH_CTF is in effect and do we now rely solely on install stripping binaries at later stage to get rid of the debug symbols? IMHO, we should only pass -g to ctfconvert if WITH_CTF is set _and_ user requested debug symbols explicitly. Your change seems to be breaking that. --=20 Alexander Kabaev --Sig_/GivU/EKY5jztYj/V4/o8gyA Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUXkwWQ6z1jMm+XZYRAtWdAKCKP07oHjfePn5xbuesqZ9aNIvaXACcCIJw DPBG5lqNxib1TDfWHyXMQ+c= =PfF9 -----END PGP SIGNATURE----- --Sig_/GivU/EKY5jztYj/V4/o8gyA-- From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 18:16:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 492C7C0C; Sat, 8 Nov 2014 18:16:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3554DBB3; Sat, 8 Nov 2014 18:16:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8IGec1052615; Sat, 8 Nov 2014 18:16:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8IGdJI052612; Sat, 8 Nov 2014 18:16:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201411081816.sA8IGdJI052612@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 8 Nov 2014 18:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274299 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 18:16:40 -0000 Author: markj Date: Sat Nov 8 18:16:39 2014 New Revision: 274299 URL: https://svnweb.freebsd.org/changeset/base/274299 Log: Revert r274200. Implicitly setting DEBUG_FLAGS when WITH_CTF is true is not the right way to do this. Requested by: kan Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.own.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat Nov 8 18:13:35 2014 (r274298) +++ head/share/mk/bsd.lib.mk Sat Nov 8 18:16:39 2014 (r274299) @@ -36,7 +36,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if ${MK_CTF} != "no" +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif .else Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Nov 8 18:13:35 2014 (r274298) +++ head/share/mk/bsd.own.mk Sat Nov 8 18:16:39 2014 (r274299) @@ -128,7 +128,6 @@ ____: .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} -DEBUG_FLAGS+= -g .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat Nov 8 18:13:35 2014 (r274298) +++ head/share/mk/bsd.prog.mk Sat Nov 8 18:16:39 2014 (r274299) @@ -20,7 +20,7 @@ NO_WERROR= CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if ${MK_CTF} != "no" +.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" CTFFLAGS+= -g .endif .endif From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 19:38:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B0F214F; Sat, 8 Nov 2014 19:38:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9C3F2BF; Sat, 8 Nov 2014 19:38:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA8JcZ0K090549; Sat, 8 Nov 2014 19:38:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA8JcYbQ090539; Sat, 8 Nov 2014 19:38:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201411081938.sA8JcYbQ090539@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 8 Nov 2014 19:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274300 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 19:38:36 -0000 Author: ae Date: Sat Nov 8 19:38:34 2014 New Revision: 274300 URL: https://svnweb.freebsd.org/changeset/base/274300 Log: Remove ip6_getdstifaddr() and all functions to work with auxiliary data. It isn't safe to keep unreferenced ifaddrs. Use in6ifa_ifwithaddr() to determine ifaddr corresponding to destination address. Since currently we keep addresses with embedded scope zone, in6ifa_ifwithaddr is called with zero zoneid and marked with XXX. Also remove route and lle lookups from ip6_input. Use in6ifa_ifwithaddr() instead. Sponsored by: Yandex LLC Modified: head/sys/netinet/tcp_input.c head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Nov 8 18:16:39 2014 (r274299) +++ head/sys/netinet/tcp_input.c Sat Nov 8 19:38:34 2014 (r274300) @@ -513,6 +513,7 @@ tcp6_input(struct mbuf **mp, int *offp, { struct mbuf *m = *mp; struct in6_ifaddr *ia6; + struct ip6_hdr *ip6; IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE); @@ -520,7 +521,8 @@ tcp6_input(struct mbuf **mp, int *offp, * draft-itojun-ipv6-tcp-to-anycast * better place to put this in? */ - ia6 = ip6_getdstifaddr(m); + ip6 = mtod(m, struct ip6_hdr *); + ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); if (ia6 && (ia6->ia6_flags & IN6_IFF_ANYCAST)) { struct ip6_hdr *ip6; @@ -1251,7 +1253,7 @@ relocked: if (isipv6 && !V_ip6_use_deprecated) { struct in6_ifaddr *ia6; - ia6 = ip6_getdstifaddr(m); + ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); if (ia6 != NULL && (ia6->ia6_flags & IN6_IFF_DEPRECATED)) { ifa_free(&ia6->ia_ifa); Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Sat Nov 8 18:16:39 2014 (r274299) +++ head/sys/netinet6/frag6.c Sat Nov 8 19:38:34 2014 (r274300) @@ -59,13 +59,6 @@ __FBSDID("$FreeBSD$"); #include -/* - * Define it to get a correct behavior on per-interface statistics. - * You will need to perform an extra routing table lookup, per fragment, - * to do it. This may, or may not be, a performance hit. - */ -#define IN6_IFSTAT_STRICT - static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *); static void frag6_deq(struct ip6asfrag *); static void frag6_insque(struct ip6q *, struct ip6q *); @@ -160,9 +153,7 @@ frag6_input(struct mbuf **mp, int *offp, struct ip6_frag *ip6f; struct ip6q *q6; struct ip6asfrag *af6, *ip6af, *af6dwn; -#ifdef IN6_IFSTAT_STRICT struct in6_ifaddr *ia; -#endif int offset = *offp, nxt, i, next; int first_frag = 0; int fragoff, frgpartlen; /* must be larger than u_int16_t */ @@ -183,18 +174,12 @@ frag6_input(struct mbuf **mp, int *offp, #endif dstifp = NULL; -#ifdef IN6_IFSTAT_STRICT /* find the destination interface of the packet. */ - if ((ia = ip6_getdstifaddr(m)) != NULL) { + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia != NULL) { dstifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); } -#else - /* we are violating the spec, this is not the destination interface */ - if ((m->m_flags & M_PKTHDR) != 0) - dstifp = m->m_pkthdr.rcvif; -#endif - /* jumbo payload can't contain a fragment header */ if (ip6->ip6_plen == 0) { icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset); Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Sat Nov 8 18:16:39 2014 (r274299) +++ head/sys/netinet6/icmp6.c Sat Nov 8 19:38:34 2014 (r274300) @@ -1313,7 +1313,8 @@ ni6_input(struct mbuf *m, int off) goto bad; /* else it's a link-local multicast, fine */ } else { /* unicast or anycast */ - if ((ia6 = ip6_getdstifaddr(m)) == NULL) + ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia6 == NULL) goto bad; /* XXX impossible */ if ((ia6->ia6_flags & IN6_IFF_TEMPORARY) && @@ -2136,13 +2137,13 @@ icmp6_rip6_input(struct mbuf **mp, int o void icmp6_reflect(struct mbuf *m, size_t off) { + struct in6_addr src, *srcp = NULL; struct ip6_hdr *ip6; struct icmp6_hdr *icmp6; struct in6_ifaddr *ia = NULL; + struct ifnet *outif = NULL; int plen; int type, code; - struct ifnet *outif = NULL; - struct in6_addr origdst, src, *srcp = NULL; /* too short to reflect */ if (off < sizeof(struct ip6_hdr)) { @@ -2189,43 +2190,18 @@ icmp6_reflect(struct mbuf *m, size_t off type = icmp6->icmp6_type; /* keep type for statistics */ code = icmp6->icmp6_code; /* ditto. */ - origdst = ip6->ip6_dst; - /* - * ip6_input() drops a packet if its src is multicast. - * So, the src is never multicast. - */ - ip6->ip6_dst = ip6->ip6_src; - /* * If the incoming packet was addressed directly to us (i.e. unicast), * use dst as the src for the reply. * The IN6_IFF_NOTREADY case should be VERY rare, but is possible * (for example) when we encounter an error while forwarding procedure * destined to a duplicated address of ours. - * Note that ip6_getdstifaddr() may fail if we are in an error handling - * procedure of an outgoing packet of our own, in which case we need - * to search in the ifaddr list. */ - if (!IN6_IS_ADDR_MULTICAST(&origdst)) { - if ((ia = ip6_getdstifaddr(m))) { - if (!(ia->ia6_flags & - (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY))) - srcp = &ia->ia_addr.sin6_addr; - } else { - struct sockaddr_in6 d; - - bzero(&d, sizeof(d)); - d.sin6_family = AF_INET6; - d.sin6_len = sizeof(d); - d.sin6_addr = origdst; - ia = (struct in6_ifaddr *) - ifa_ifwithaddr((struct sockaddr *)&d); - if (ia && - !(ia->ia6_flags & - (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY))) { - srcp = &ia->ia_addr.sin6_addr; - } - } + if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia != NULL && !(ia->ia6_flags & + (IN6_IFF_ANYCAST|IN6_IFF_NOTREADY))) + srcp = &ia->ia_addr.sin6_addr; } if (srcp == NULL) { @@ -2257,7 +2233,11 @@ icmp6_reflect(struct mbuf *m, size_t off } srcp = &src; } - + /* + * ip6_input() drops a packet if its src is multicast. + * So, the src is never multicast. + */ + ip6->ip6_dst = ip6->ip6_src; ip6->ip6_src = *srcp; ip6->ip6_flow = 0; ip6->ip6_vfc &= ~IPV6_VERSION_MASK; Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Sat Nov 8 18:16:39 2014 (r274299) +++ head/sys/netinet6/ip6_input.c Sat Nov 8 19:38:34 2014 (r274300) @@ -148,10 +148,6 @@ struct rwlock in6_ifaddr_lock; RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock"); static void ip6_init2(void *); -static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *); -static struct ip6aux *ip6_addaux(struct mbuf *); -static struct ip6aux *ip6_findaux(struct mbuf *m); -static void ip6_delaux (struct mbuf *); static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); #ifdef PULLDOWN_TEST static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); @@ -399,19 +395,15 @@ out: void ip6_input(struct mbuf *m) { + struct in6_addr odst; struct ip6_hdr *ip6; - int off = sizeof(struct ip6_hdr), nest; + struct in6_ifaddr *ia; u_int32_t plen; u_int32_t rtalert = ~0; + int off = sizeof(struct ip6_hdr), nest; int nxt, ours = 0; - struct ifnet *deliverifp = NULL, *ifp = NULL; - struct in6_addr odst; - struct route_in6 rin6; int srcrt = 0; - struct llentry *lle = NULL; - struct sockaddr_in6 dst6, *dst; - bzero(&rin6, sizeof(struct route_in6)); #ifdef IPSEC /* * should the inner packet be considered authentic? @@ -424,18 +416,12 @@ ip6_input(struct mbuf *m) #endif /* IPSEC */ - /* - * make sure we don't have onion peering information into m_tag. - */ - ip6_delaux(m); - if (m->m_flags & M_FASTFWD_OURS) { /* * Firewall changed destination to local. */ m->m_flags &= ~M_FASTFWD_OURS; ours = 1; - deliverifp = m->m_pkthdr.rcvif; ip6 = mtod(m, struct ip6_hdr *); goto hbhcheck; } @@ -462,10 +448,8 @@ ip6_input(struct mbuf *m) } /* drop the packet if IPv6 operation is disabled on the IF */ - if ((ND_IFINFO(m->m_pkthdr.rcvif)->flags & ND6_IFF_IFDISABLED)) { - m_freem(m); - return; - } + 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); @@ -626,7 +610,6 @@ ip6_input(struct mbuf *m) if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; ours = 1; - deliverifp = m->m_pkthdr.rcvif; goto hbhcheck; } if ((m->m_flags & M_IP6_NEXTHOP) && @@ -637,7 +620,7 @@ ip6_input(struct mbuf *m) * connected host. */ ip6_forward(m, 1); - goto out; + return; } passin: @@ -660,7 +643,6 @@ passin: IP6STAT_INC(ip6s_badscope); goto bad; } - /* * Multicast check. Assume packet is for us to avoid * prematurely taking locks. @@ -668,53 +650,16 @@ passin: if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { ours = 1; in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_mcast); - deliverifp = m->m_pkthdr.rcvif; goto hbhcheck; } - /* - * Unicast check - */ - - bzero(&dst6, sizeof(dst6)); - dst6.sin6_family = AF_INET6; - dst6.sin6_len = sizeof(struct sockaddr_in6); - dst6.sin6_addr = ip6->ip6_dst; - ifp = m->m_pkthdr.rcvif; - IF_AFDATA_RLOCK(ifp); - lle = lla_lookup(LLTABLE6(ifp), 0, - (struct sockaddr *)&dst6); - IF_AFDATA_RUNLOCK(ifp); - if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { - struct ifaddr *ifa; - struct in6_ifaddr *ia6; - int bad; - - bad = 1; - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != dst6.sin6_family) - continue; - if (sa_equal(&dst6, ifa->ifa_addr)) - break; - } - KASSERT(ifa != NULL, ("%s: ifa not found for lle %p", - __func__, lle)); - - ia6 = (struct in6_ifaddr *)ifa; - if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { - /* Count the packet in the ip address stats */ - counter_u64_add(ia6->ia_ifa.ifa_ipackets, 1); - counter_u64_add(ia6->ia_ifa.ifa_ibytes, - m->m_pkthdr.len); - - /* - * record address information into m_tag. - */ - (void)ip6_setdstifaddr(m, ia6); - - bad = 0; - } else { + * Unicast check + * XXX: For now we keep link-local IPv6 addresses with embedded + * scope zone id, therefore we use zero zoneid here. + */ + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia != NULL) { + if (ia->ia6_flags & IN6_IFF_NOTREADY) { char ip6bufs[INET6_ADDRSTRLEN]; char ip6bufd[INET6_ADDRSTRLEN]; /* address is not ready, so discard the packet. */ @@ -722,137 +667,15 @@ passin: "ip6_input: packet to an unready address %s->%s\n", ip6_sprintf(ip6bufs, &ip6->ip6_src), ip6_sprintf(ip6bufd, &ip6->ip6_dst))); - } - IF_ADDR_RUNLOCK(ifp); - LLE_RUNLOCK(lle); - if (bad) + ifa_free(&ia->ia_ifa); goto bad; - else { - ours = 1; - deliverifp = ifp; - goto hbhcheck; - } - } - if (lle != NULL) - LLE_RUNLOCK(lle); - - dst = &rin6.ro_dst; - dst->sin6_len = sizeof(struct sockaddr_in6); - dst->sin6_family = AF_INET6; - dst->sin6_addr = ip6->ip6_dst; - rin6.ro_rt = in6_rtalloc1((struct sockaddr *)dst, 0, 0, M_GETFIB(m)); - if (rin6.ro_rt) - RT_UNLOCK(rin6.ro_rt); - -#define rt6_key(r) ((struct sockaddr_in6 *)((r)->rt_nodes->rn_key)) - - /* - * Accept the packet if the forwarding interface to the destination - * according to the routing table is the loopback interface, - * unless the associated route has a gateway. - * Note that this approach causes to accept a packet if there is a - * route to the loopback interface for the destination of the packet. - * But we think it's even useful in some situations, e.g. when using - * a special daemon which wants to intercept the packet. - * - * XXX: some OSes automatically make a cloned route for the destination - * of an outgoing packet. If the outgoing interface of the packet - * is a loopback one, the kernel would consider the packet to be - * accepted, even if we have no such address assinged on the interface. - * We check the cloned flag of the route entry to reject such cases, - * assuming that route entries for our own addresses are not made by - * cloning (it should be true because in6_addloop explicitly installs - * the host route). However, we might have to do an explicit check - * while it would be less efficient. Or, should we rather install a - * reject route for such a case? - */ - if (rin6.ro_rt && - (rin6.ro_rt->rt_flags & - (RTF_HOST|RTF_GATEWAY)) == RTF_HOST && -#ifdef RTF_WASCLONED - !(rin6.ro_rt->rt_flags & RTF_WASCLONED) && -#endif -#ifdef RTF_CLONED - !(rin6.ro_rt->rt_flags & RTF_CLONED) && -#endif -#if 0 - /* - * The check below is redundant since the comparison of - * the destination and the key of the rtentry has - * already done through looking up the routing table. - */ - IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, - &rt6_key(rin6.ro_rt)->sin6_addr) -#endif - rin6.ro_rt->rt_ifp->if_type == IFT_LOOP) { - int free_ia6 = 0; - struct in6_ifaddr *ia6; - - /* - * found the loopback route to the interface address - */ - if (rin6.ro_rt->rt_gateway->sa_family == AF_LINK) { - struct sockaddr_in6 dest6; - - bzero(&dest6, sizeof(dest6)); - dest6.sin6_family = AF_INET6; - dest6.sin6_len = sizeof(dest6); - dest6.sin6_addr = ip6->ip6_dst; - ia6 = (struct in6_ifaddr *) - ifa_ifwithaddr((struct sockaddr *)&dest6); - if (ia6 == NULL) - goto bad; - free_ia6 = 1; - } - else - ia6 = (struct in6_ifaddr *)rin6.ro_rt->rt_ifa; - - /* - * record address information into m_tag. - */ - (void)ip6_setdstifaddr(m, ia6); - - /* - * packets to a tentative, duplicated, or somehow invalid - * address must not be accepted. - */ - if (!(ia6->ia6_flags & IN6_IFF_NOTREADY)) { - /* this address is ready */ - ours = 1; - deliverifp = ia6->ia_ifp; /* correct? */ - /* Count the packet in the ip address stats */ - counter_u64_add(ia6->ia_ifa.ifa_ipackets, 1); - counter_u64_add(ia6->ia_ifa.ifa_ibytes, - m->m_pkthdr.len); - if (free_ia6) - ifa_free(&ia6->ia_ifa); - goto hbhcheck; - } else { - char ip6bufs[INET6_ADDRSTRLEN]; - char ip6bufd[INET6_ADDRSTRLEN]; - /* address is not ready, so discard the packet. */ - nd6log((LOG_INFO, - "ip6_input: packet to an unready address %s->%s\n", - ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst))); - - if (free_ia6) - ifa_free(&ia6->ia_ifa); - goto bad; - } - } - - /* - * FAITH (Firewall Aided Internet Translator) - */ - if (V_ip6_keepfaith) { - if (rin6.ro_rt && rin6.ro_rt->rt_ifp && - rin6.ro_rt->rt_ifp->if_type == IFT_FAITH) { - /* XXX do we need more sanity checks? */ - ours = 1; - deliverifp = rin6.ro_rt->rt_ifp; /* faith */ - goto hbhcheck; } + /* Count the packet in the ip address stats */ + counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); + counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); + ifa_free(&ia->ia_ifa); + ours = 1; + goto hbhcheck; } /* @@ -867,43 +690,14 @@ passin: hbhcheck: /* - * record address information into m_tag, if we don't have one yet. - * note that we are unable to record it, if the address is not listed - * as our interface address (e.g. multicast addresses, addresses - * within FAITH prefixes and such). - */ - if (deliverifp) { - struct in6_ifaddr *ia6; - - if ((ia6 = ip6_getdstifaddr(m)) != NULL) { - ifa_free(&ia6->ia_ifa); - } else { - ia6 = in6_ifawithifp(deliverifp, &ip6->ip6_dst); - if (ia6) { - if (!ip6_setdstifaddr(m, ia6)) { - /* - * XXX maybe we should drop the packet here, - * as we could not provide enough information - * to the upper layers. - */ - } - ifa_free(&ia6->ia_ifa); - } - } - } - - /* * Process Hop-by-Hop options header if it's contained. * m may be modified in ip6_hopopts_input(). * If a JumboPayload option is included, plen will also be modified. */ plen = (u_int32_t)ntohs(ip6->ip6_plen); if (ip6->ip6_nxt == IPPROTO_HOPOPTS) { - int error; - - error = ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours); - if (error != 0) - goto out; + if (ip6_input_hbh(m, &plen, &rtalert, &off, &nxt, &ours) != 0) + return; } else nxt = ip6->ip6_nxt; @@ -950,7 +744,7 @@ passin: } } else if (!ours) { ip6_forward(m, srcrt); - goto out; + return; } ip6 = mtod(m, struct ip6_hdr *); @@ -975,7 +769,7 @@ passin: * Tell launch routine the next header */ IP6STAT_INC(ip6s_delivered); - in6_ifstat_inc(deliverifp, ifs6_in_deliver); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_deliver); nest = 0; while (nxt != IPPROTO_DONE) { @@ -1013,47 +807,9 @@ passin: nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt); } - goto out; + return; bad: m_freem(m); -out: - if (rin6.ro_rt) - RTFREE(rin6.ro_rt); -} - -/* - * set/grab in6_ifaddr correspond to IPv6 destination address. - * XXX backward compatibility wrapper - * - * XXXRW: We should bump the refcount on ia6 before sticking it in the m_tag, - * and then bump it when the tag is copied, and release it when the tag is - * freed. Unfortunately, m_tags don't support deep copies (yet), so instead - * we just bump the ia refcount when we receive it. This should be fixed. - */ -static struct ip6aux * -ip6_setdstifaddr(struct mbuf *m, struct in6_ifaddr *ia6) -{ - struct ip6aux *ip6a; - - ip6a = ip6_addaux(m); - if (ip6a) - ip6a->ip6a_dstia6 = ia6; - return ip6a; /* NULL if failed to set */ -} - -struct in6_ifaddr * -ip6_getdstifaddr(struct mbuf *m) -{ - struct ip6aux *ip6a; - struct in6_ifaddr *ia; - - ip6a = ip6_findaux(m); - if (ip6a) { - ia = ip6a->ip6a_dstia6; - ifa_ref(&ia->ia_ifa); - return ia; - } else - return NULL; } /* @@ -1816,42 +1572,6 @@ ip6_lasthdr(struct mbuf *m, int off, int } } -static struct ip6aux * -ip6_addaux(struct mbuf *m) -{ - struct m_tag *mtag; - - mtag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL); - if (!mtag) { - mtag = m_tag_get(PACKET_TAG_IPV6_INPUT, sizeof(struct ip6aux), - M_NOWAIT); - if (mtag) { - m_tag_prepend(m, mtag); - bzero(mtag + 1, sizeof(struct ip6aux)); - } - } - return mtag ? (struct ip6aux *)(mtag + 1) : NULL; -} - -static struct ip6aux * -ip6_findaux(struct mbuf *m) -{ - struct m_tag *mtag; - - mtag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL); - return mtag ? (struct ip6aux *)(mtag + 1) : NULL; -} - -static void -ip6_delaux(struct mbuf *m) -{ - struct m_tag *mtag; - - mtag = m_tag_find(m, PACKET_TAG_IPV6_INPUT, NULL); - if (mtag) - m_tag_delete(m, mtag); -} - /* * System control for IP6 */ Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Sat Nov 8 18:16:39 2014 (r274299) +++ head/sys/netinet6/ip6_var.h Sat Nov 8 19:38:34 2014 (r274300) @@ -257,37 +257,6 @@ VNET_PCPUSTAT_DECLARE(struct ip6stat, ip #endif #ifdef _KERNEL -/* - * IPv6 onion peeling state. - * it will be initialized when we come into ip6_input(). - * XXX do not make it a kitchen sink! - */ -struct ip6aux { - u_int32_t ip6a_flags; -#define IP6A_SWAP 0x01 /* swapped home/care-of on packet */ -#define IP6A_HASEEN 0x02 /* HA was present */ -#define IP6A_BRUID 0x04 /* BR Unique Identifier was present */ -#define IP6A_RTALERTSEEN 0x08 /* rtalert present */ - - /* ip6.ip6_src */ - struct in6_addr ip6a_careof; /* care-of address of the peer */ - struct in6_addr ip6a_home; /* home address of the peer */ - u_int16_t ip6a_bruid; /* BR unique identifier */ - - /* ip6.ip6_dst */ - struct in6_ifaddr *ip6a_dstia6; /* my ifaddr that matches ip6_dst */ - - /* rtalert */ - u_int16_t ip6a_rtalert; /* rtalert option value */ - - /* - * decapsulation history will be here. - * with IPsec it may not be accurate. - */ -}; -#endif - -#ifdef _KERNEL /* flags passed to ip6_output as last parameter */ #define IPV6_UNSPECSRC 0x01 /* allow :: as the source address */ #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ @@ -386,7 +355,6 @@ int ip6proto_register(short); int ip6proto_unregister(short); void ip6_input(struct mbuf *); -struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); @@ -394,10 +362,6 @@ char * ip6_get_prevhdr(struct mbuf *, in int ip6_nexthdr(struct mbuf *, int, int, int *); int ip6_lasthdr(struct mbuf *, int, int, int *); -#ifdef __notyet__ -struct ip6aux *ip6_findaux(struct mbuf *); -#endif - extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *, struct mbuf *); From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 20:11:09 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD6C18F8; Sat, 8 Nov 2014 20:11:09 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A65047A5; Sat, 8 Nov 2014 20:11:08 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA18767; Sat, 08 Nov 2014 22:12:54 +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 1XnCLc-000FBw-5Y; Sat, 08 Nov 2014 22:11:00 +0200 Message-ID: <545E7882.90209@FreeBSD.org> Date: Sat, 08 Nov 2014 22:09:38 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alexander Kabaev , Mark Johnston Subject: Re: svn commit: r274200 - head/share/mk References: <201411062246.sA6MkeLN018716@svn.freebsd.org> <20141108120000.3f16feab@kan> In-Reply-To: <20141108120000.3f16feab@kan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 20:11:10 -0000 On 08/11/2014 19:00, Alexander Kabaev wrote: > On Thu, 6 Nov 2014 22:46:40 +0000 (UTC) Mark Johnston > wrote: > >> Author: markj Date: Thu Nov 6 22:46:40 2014 New Revision: 274200 URL: >> https://svnweb.freebsd.org/changeset/base/274200 >> >> Log: Automatically build with debug symbols when building with WITH_CTF. >> Otherwise there's nothing for ctfconvert to do, and it ends up emitting >> an error for each object file. Also remove some redundant checks from >> bsd.prog.mk and bsd.lib.mk. > >> >> -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != >> "no" CTFFLAGS+= -g .endif .else > > I have a question about this and another similar change. Does it have the > effect of always leaving binaries with debug symbols in id WITH_CTF is in > effect and do we now rely solely on install stripping binaries at later > stage to get rid of the debug symbols? IMHO, we should only pass -g to > ctfconvert if WITH_CTF is set _and_ user requested debug symbols > explicitly. Your change seems to be breaking that. Hmm, I do not follow your logic here, sorry. So, you say that stripping should be ctfconvert's job? Why? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Nov 8 22:24:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B72B127; Sat, 8 Nov 2014 22:24:53 +0000 (UTC) Received: from mail-qg0-x22b.google.com (mail-qg0-x22b.google.com [IPv6:2607:f8b0:400d:c04::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E17CD3F3; Sat, 8 Nov 2014 22:24:52 +0000 (UTC) Received: by mail-qg0-f43.google.com with SMTP id f51so3978231qge.16 for ; Sat, 08 Nov 2014 14:24:52 -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-type; bh=MA/vSEmZvNo+qE7Qqui808CDSGUTOQhk/aFHirJFacg=; b=AtlL6G9I+hfD8UeZdnkfOZvfhDdW4TKM1h3VrgghtOK9pm8BRY0KxLumWGKcz8MWVt vAKChyTku6J1SitEMSvttpfQaIG7l7BkOtA93Pva8ViKIDGwDmMzgRsHGXTsAdPd3SQo tG+BGDndJWE293liUKpTz1xZeuU+uSAA32kwesDxqsNBNYC4nhrn8iEcyOY0kc2SWgZs T4ElXtCG+KUSjG38AsM2quNOw4J0D/PcJQaIh9s3NaSEQtkOZehAo64nYl1dPMo9hk0I o8mewaobyp5M70aBigC0a49OlDBMKLvDa92i3UYJrcVuZfflIKWJUrge848UqXINXTs1 AMvA== X-Received: by 10.140.106.34 with SMTP id d31mr19813003qgf.39.1415485492169; Sat, 08 Nov 2014 14:24:52 -0800 (PST) Received: from kan ([2601:6:6780:780:226:18ff:fe00:232e]) by mx.google.com with ESMTPSA id u8sm11744913qat.27.2014.11.08.14.24.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Nov 2014 14:24:51 -0800 (PST) Date: Sat, 8 Nov 2014 17:24:40 -0500 From: Alexander Kabaev To: Andriy Gapon Subject: Re: svn commit: r274200 - head/share/mk Message-ID: <20141108172440.12418020@kan> In-Reply-To: <545E7882.90209@FreeBSD.org> References: <201411062246.sA6MkeLN018716@svn.freebsd.org> <20141108120000.3f16feab@kan> <545E7882.90209@FreeBSD.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/LTlB.owL03b7LY1S/P6I9UB"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Mark Johnston , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 22:24:53 -0000 --Sig_/LTlB.owL03b7LY1S/P6I9UB Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 08 Nov 2014 22:09:38 +0200 Andriy Gapon wrote: > On 08/11/2014 19:00, Alexander Kabaev wrote: > > On Thu, 6 Nov 2014 22:46:40 +0000 (UTC) Mark Johnston > > wrote: > >=20 > >> Author: markj Date: Thu Nov 6 22:46:40 2014 New Revision: 274200 > >> URL: https://svnweb.freebsd.org/changeset/base/274200 > >>=20 > >> Log: Automatically build with debug symbols when building with > >> WITH_CTF. Otherwise there's nothing for ctfconvert to do, and it > >> ends up emitting an error for each object file. Also remove some > >> redundant checks from bsd.prog.mk and bsd.lib.mk. > > > >>=20 > >> -.if ${MK_CTF} !=3D "no" && ${DEBUG_FLAGS:M-g} !=3D "" +.if > >> ${MK_CTF} !=3D "no" CTFFLAGS+=3D -g .endif .else > >=20 > > I have a question about this and another similar change. Does it > > have the effect of always leaving binaries with debug symbols in id > > WITH_CTF is in effect and do we now rely solely on install > > stripping binaries at later stage to get rid of the debug symbols? > > IMHO, we should only pass -g to ctfconvert if WITH_CTF is set _and_ > > user requested debug symbols explicitly. Your change seems to be > > breaking that. >=20 > Hmm, I do not follow your logic here, sorry. > So, you say that stripping should be ctfconvert's job? Why? >=20 > --=20 > Andriy Gapon Because when building stuff with unwanted debug symbols one should make sure they are really gone and the patch basically undoes than promise. Whose job is it to strip .o's that end up in as the part of the .a archives, for example? DEBUG_FLAGS are there for users to be able to specify, khm, own debug flags and stuffing values in there automatically is just wrong. Also, there are these bits in our .mk files which I did not remember were there: .if !defined(DEBUG_FLAGS) STRIP?=3D -s .endif So, when present, DEBUG_FLAGS do prevent the stripping of binaries completely, making the patch as is even more wrong that I thought originally. --=20 Alexander Kabaev --Sig_/LTlB.owL03b7LY1S/P6I9UB Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUXpgyQ6z1jMm+XZYRAiU8AJ0e3GLmrB7W9eZM7aMyIxJfzfL/zgCeO1b9 6A3IN9jzQoqlyMMmB5FWeuo= =JcDF -----END PGP SIGNATURE----- --Sig_/LTlB.owL03b7LY1S/P6I9UB--