From owner-svn-src-head@FreeBSD.ORG Sun Nov 2 00:00:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:09:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:11:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:12:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:13:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:26:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 00:29:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 01:13:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 01:47:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 02:01:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 02:05:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 02:32:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 03:10:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 03:37:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D08A986C 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 68B06E0D for ; Sun, 2 Nov 2014 03:37:36 +0000 (UTC) Received: (qmail 75586 invoked by uid 89); 2 Nov 2014 03:37:33 -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 73712 invoked by uid 89); 2 Nov 2014 03:26:32 -0000 Received: by simscan 1.3.1 ppid: 73704, pid: 73708, t: 0.1373s 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 05:34:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 05:51:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:19:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:24:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:34:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:37:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:45:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:52:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 09:59:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C10E17CE for ; Sun, 2 Nov 2014 09:59:54 +0000 (UTC) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) (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 45BB910E for ; Sun, 2 Nov 2014 09:59:53 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id q1so8163489lam.10 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=VFd3TgOTFu5WhE6K74cYXpQ2JLxdFjJrrC3Bpbc/GX47EdU+ISjtI7yxGC7MVHEoqo ZauNPCmM1GHy++Q8OF4InnveLar8WALEICQW4/9j1kWa+d2LZYxias69eVv+ckAJBCKl JauQPm6TYzrpn+ubDcYUe1x0CKDkb7LkvfdusLBvQSxmT9rO1Abj72yu5vCMG/4ue3+s NwJ+2/HdaJNeHNk+fxGP0b7rS7MXnmLEu0wb5k4odtaTaEnWmHOxfDLFa2pf7a9z3AXr 4M3Wko6Bf2z/KxoWckERCtFQMQ1b/GmTxQ21jAZgJN/VwP60fZHZuiZzGxD+sah7tGNv RW5g== X-Gm-Message-State: ALoCoQnZKurE0w7MpvmHfGL3Tm4UETd+AeohnYl7AoWZ4HiZ0NPZooIgb0M9CfrpV15z/5aF+U0l 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 09:59:54 -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-head@FreeBSD.ORG Sun Nov 2 10:07:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 11:26:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 11:28:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 11:47:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 12:41:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 12:42:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 12:51:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:08:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:10:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:14:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:18:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:23:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:26:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:29:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 13:43:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 14:08:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 14:12:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 15:27:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 15:36:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 15:54:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 16:04:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 16:07:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 16:37:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 16:42:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 16:59:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 17:07:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 17:19:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 17:50:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 17:53:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 17:59:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:05:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:07:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:10:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:15:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:20:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:21:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:24:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:25:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:46:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:49:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:51:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:54:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 19:56:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:04:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:13:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:27:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:38:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:53:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:57:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 20:59:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:17:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:34:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:38:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:39:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:40:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:48:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 21:58:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 22:38:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 22:49:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 22:58:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Nov 2 23:30:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Nov 3 00:37:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 00:53:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 01:14:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 03:08:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 03:12:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 04:16:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 04:41:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 05:12:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 06:07:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 06:24:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 07:18:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 07:20:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 07:46:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 08:21:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 08:23:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 08:28:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 08:34:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 08:59:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 262179B5 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 E5A2AED1 for ; Mon, 3 Nov 2014 08:59:51 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9F73E205CF for ; Mon, 3 Nov 2014 03:59:44 -0500 (EST) Received: from web6 ([10.202.2.216]) by compute5.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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:02:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:08:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:17:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:19:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:20:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:21:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:26:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 09:29:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 10:01:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 10:08:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01427936 for ; Mon, 3 Nov 2014 10:08:56 +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 9706B8DE for ; Mon, 3 Nov 2014 10:08: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 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 10:08:57 -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-head@FreeBSD.ORG Mon Nov 3 10:34:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 10:42:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:05:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:11:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:15:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:18:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:29:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 11:49:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 12:55:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 13:01:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 13:02:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 13:14:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 14:35:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 14:57:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 15:25:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 15:40:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 15:59:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 16:01:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 16:31:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 16:57:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 16:59:58 2014 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 17:03:52 2014 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 17:07:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 17:38:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 17:51:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 18:31:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01F4535C for ; Mon, 3 Nov 2014 18:31:13 +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 9B67980C 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2014 18:31:13 -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-head@FreeBSD.ORG Mon Nov 3 18:50:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 19:00:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 19:03:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 19:16:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 19:23:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 19:36:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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:10:00 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:03:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:04:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:21:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:26:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:45:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 21:49:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 22:17:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 22:19:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 22:37:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 23:36:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 23:37:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Nov 3 23:43:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Nov 4 00:04:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 00:10:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 00:14:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 00:19:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 00:56:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 01:06:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 01:57:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 02:00:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 05:02:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 05:41:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 07:44:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 07:50:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 08:22:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 09:21:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 09:26:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 09:56:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 09:58:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 10:18:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 10:21:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 10:25:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 10:31:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90F99212 for ; Tue, 4 Nov 2014 10:31:56 +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 F2F95908 for ; Tue, 4 Nov 2014 10:31:55 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 10:31:56 -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-head@FreeBSD.ORG Tue Nov 4 10:45:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 10:55:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 11:29:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 11:40:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 11:46:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 05:35:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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:31:13 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 07:25:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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:50 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 13:41:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 14:22:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 14:23:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 14:42:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 14:56:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 15:11:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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:13 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 15:51:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 16:02:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 16:20:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 16:30:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 16:35:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 16:50:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 17:24:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 17:50:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 18:24:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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:58 +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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 18:52:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 19:45:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 19:51:28 2014 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 19:56:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 20:16:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 20:25:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 20:43:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 20:46:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 21:49:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 21:53:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 22:25:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:02:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:10:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:29:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:31:23 2014 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:38:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:46:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Nov 4 23:51:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Nov 5 00:58:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 01:01:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 01:24:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 01:47:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 01:57:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 02:08:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 02:11:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 02:36:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 02:58:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 03:47:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 04:02:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 04:09:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 04:18:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 05:49:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 05:55:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 06:22:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 06:42:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 06:52:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 07:22:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 14:55:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 15:03:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 15:32:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 16:13:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 16:30:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 16:38:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 19:54:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 20:13:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 20:28:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 20:58:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 21:04:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 22:46:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 22:50:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 23:04:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 23:06:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 23:54:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Nov 5 23:59:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Nov 6 00:48:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 00:51:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 01:05:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 01:46:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 02:41:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 04:13:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 07:27:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 07:37:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 07:44:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 08:12:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 09:37:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 10:07:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 10:16:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 10:30:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 10:42:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 11:07:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 11:08:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 12:19:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 13:05:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14126CC 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 98140C00 for ; Thu, 6 Nov 2014 13:05:29 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi2so1405699wib.13 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=gJKLB8uG/C0x777PxvF+tz0j/+OJyUF5zeNZCt5IgJlbtEtdC6j9Qm87ACTvS4V2p7 n3u5ZfRDk944iV7kqGpVGuXw9wQA1illSomqDGH+ZQoqJvdIdhaoeKvpEVucuRNC5WnU /gKYZXP0ONLz8jc64Ua2dzm/zXXxAwRHXT6j5RUkNSval5MoSWYQrGxpLeBCqnHzBXpe lqGfXknMuyWWOraDSMkXlw7aEcFA1f9xdOArjefruynsKcP/QvllY+Ix4rhsdSWacJmX 4Pjtlepa3VrRVxD8Jrg83eRLekjS5v9TIKbE/dNrnHm7+x1HfgFpaFulVNoK0PUDfMDP XcZA== X-Gm-Message-State: ALoCoQkl3xalLOTdn+6lv+hNMqdsB93kAz0vtzcFIAWSWhdjn4v+tFlbAybjiyU6TLSxq+KpKOGh 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 13:12:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 13:13:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 13:13:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 14:39:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 15:17:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:11:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72AC2DA4 for ; Thu, 6 Nov 2014 16:11:31 +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 D389231A for ; Thu, 6 Nov 2014 16:11:30 +0000 (UTC) Received: (qmail 27515 invoked by uid 89); 6 Nov 2014 16:10:39 -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:10:33 -0000 Received: (qmail 12226 invoked by uid 89); 6 Nov 2014 15:09:13 -0000 Received: by simscan 1.3.1 ppid: 12188, pid: 12192, t: 0.3195s 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 16:11:31 -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-head@FreeBSD.ORG Thu Nov 6 16:17:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:19:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:20:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:48:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:48:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 16:52:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:19:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:21:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:21:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:47:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:50:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:51:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 17:58:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 18:14:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 18:15:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 18:50:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 18:59:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A7DC7A9 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 6C8AF955 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 sA6IxpB3077087 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 sA6IxpX4077084 for svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 19:14:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 19:28:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 19:35:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 20:23:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 22:45:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 22:46:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 22:53:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:04:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:05:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:06:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:16:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:19:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Nov 6 23:45:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Nov 7 00:10:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 00:11:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 00:20:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 00:56:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 00:58:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 00:59:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 01:32:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 01:36:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 01:46:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 01:54:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 02:05:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 03:03:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 03:07:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 03:36:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 04:16:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 04:39:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 04:40:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 04:47:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 08:58:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 09:15:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 09:39:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 10:49:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 11:04:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 11:34:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 12:05:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 15:14:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 15:39:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 19:13:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 19:32:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 19:34:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 20:10:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 20:15:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 20:23:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 20:42:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Nov 7 21:30:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Nov 8 03:20:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 04:24:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 07:23:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 07:30:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 07:50:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 07:54:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 11:56:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 13:19:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 14:41:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 15:06:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 16:03:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 16:04:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 16:11:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 16:38:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 17:00:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 18:16:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 19:38:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 20:11:09 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Nov 8 22:24:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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--