From owner-svn-src-all@freebsd.org Sun Aug 5 01:28:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2C4105B2D7; Sun, 5 Aug 2018 01:28:17 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E83C171BDD; Sun, 5 Aug 2018 01:28:16 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Received: from smtp.freebsd.org (c-73-25-164-31.hsd1.or.comcast.net [73.25.164.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bwidawsk) by smtp.freebsd.org (Postfix) with ESMTPSA id 03D3C1CCC9; Sun, 5 Aug 2018 01:28:15 +0000 (UTC) (envelope-from bwidawsk@freebsd.org) Date: Sat, 4 Aug 2018 18:28:13 -0700 From: Ben Widawsky To: Warner Losh Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337157 - in head: . tools/tools/git Message-ID: <20180805012813.otoixfzbq4arecyi@smtp.freebsd.org> Mail-Followup-To: Warner Losh , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808021828.w72IS2ts055984@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 01:28:17 -0000 On 18-08-04 19:36:11, Warner Losh wrote: > > > On Sat, Aug 4, 2018, 7:11 PM Eitan Adler wrote: > > On Sat, 4 Aug 2018 at 10:16, Warner Losh wrote: > > > > > > > > On Sat, Aug 4, 2018, 6:08 PM Eitan Adler wrote: > >> > >> On Thu, 2 Aug 2018 at 11:28, Ben Widawsky wrote: > >> > +git_checkout() > >> > +{ > >> > +       # Delete master > >> > +       ${GIT} branch -D master > >> > + > >> > +       # Make master really be trunk > >> > +       ${GIT} checkout -b master trunk > >> > >> Can't this be git branch --force master trunk ? > > > > > > No. That won't work. We do not want to change the location of master. > This will reset it to trunk, which is nearly always wrong. > > See this: > > ${GIT} branch -D master > ${GIT} checkout -b master trunk > > For clarity I'd expect something closer to: > > git branch --force master trunk > git checkout master > > The end result is the same, but IMHO this is clearer in intent. > > > Oh, that... yes, you may be right. There is another script that it would be > wrong in, but not this one... > > Warner > LGTM. Thanks. To me, --force is a little more advanced usage, but I agree this is a more direct approach. Would one of you mind updating the wiki so that the two sources match (maybe also have the wiki point to this script)? I am currently unable to register for a wiki account. I've added you both as reviewers: https://reviews.freebsd.org/D16593 From owner-svn-src-all@freebsd.org Sun Aug 5 03:07:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7387C106072A; Sun, 5 Aug 2018 03:07:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2911764E0; Sun, 5 Aug 2018 03:07:43 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf1-x42d.google.com with SMTP id y10-v6so5174429pfn.8; Sat, 04 Aug 2018 20:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QMYu2QjsH/Nr7T3jkdX4Iv6e/VJnz2rtT8obP21KwzE=; b=eooKi8qTccFNMX792D/YXHaKKl0h209P+J70h2PeJt9pAV4G6X30bY5S3AyyazY2mu AVL4ALMV5v2RQj/uoDdWoNzPWnU9cnTWh9G2RXd0KaLZHE9rYfGfnhPdVsp8FU/Y48HL anCjU716frCXbqqTQsqEgQhrgc4Io5q8TNVv2af7x08dk/zSp53giKCPcs6spEj5AbpC cRuwIZ1vi8/QTlr36pQwLlphMmlJQBKJ7F3k9Tpz+0RbxqvIQfJplwWfEDWUufGGIAnB xxs1iMyfqkmLmvp2/O8Gq3eL8jBSOWvZPpW7TWnIbqoUhHuZs0/7Cuqk14mje8uCcIno VK5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QMYu2QjsH/Nr7T3jkdX4Iv6e/VJnz2rtT8obP21KwzE=; b=PJdClcHOGjRPtUCeLnI33qlESP8wB9hAv0h6ZUq+LDLOlLjIo2vXF0/TBi2KwzF0uV O174iKbqsMhiAx8EKV17qgQtiq/UtLAbI9EdiWwC0QIrfer0Rq8tvfWhZokeJQ0TfGjw aFvNabxoxM9L1Rcj3lhdBlxXy0H8SOp72eR/0uGk9sWZ6T8QksdzwCvL35bAkcJOopGk FHhfEunuWjSeBW/TkSLnl9wU3W3VS4LMwZ5xGBm9Z2FNW7oo6PWxQwAMUnM646kaxDLY dKcTXwbceyXZteAFvHcAVallNtXUCdul/MCYyYsN9uSgg37H5Mw8N4iFxvbP0kHNItv+ JaLA== X-Gm-Message-State: AOUpUlEPVcFUOh63IMCjZ1p53Bfl1CLvLvatRa8FQCtuVSoKvL4pxou8 jD4rYvyT+yUQkH3VRQKJvQC5PZEW X-Google-Smtp-Source: AAOMgpfU5KghA/DI+Ih1Rem7xouOIGyIMBhSx8BjfTt6uLEZPx6QsLI+n+G7eSSSEry8YEKqkD8X+A== X-Received: by 2002:a65:6551:: with SMTP id a17-v6mr9589204pgw.132.1533438462665; Sat, 04 Aug 2018 20:07:42 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id g5-v6sm5262390pfc.77.2018.08.04.20.07.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 20:07:41 -0700 (PDT) Sender: Mark Johnston Date: Sat, 4 Aug 2018 23:07:36 -0400 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337328 - in head/sys: kern sys Message-ID: <20180805030736.GA20016@raichu> References: <201808042026.w74KQt6V006467@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201808042026.w74KQt6V006467@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 03:07:44 -0000 On Sat, Aug 04, 2018 at 08:26:55PM +0000, Mark Johnston wrote: > Author: markj > Date: Sat Aug 4 20:26:54 2018 > New Revision: 337328 > URL: https://svnweb.freebsd.org/changeset/base/337328 > > Log: > Don't check rcv sockbuf limits when sending on a unix stream socket. > > sosend_generic() performs an initial comparison of the amount of data > (including control messages) to be transmitted with the send buffer > size. When transmitting on a unix socket, we then compare the amount > of data being sent with the amount of space in the receive buffer size; > if insufficient space is available, sbappendcontrol() returns an error > and the data is lost. This is easily triggered by sending control > messages together with an amount of data roughly equal to the send > buffer size, since the control message size may change in uipc_send() > as file descriptors are internalized. > > Fix the problem by removing the space check in sbappendcontrol(), > whose only consumer is the unix sockets code. The stream sockets code > uses the SB_STOP mechanism to ensure that senders will block if the > receive buffer fills up. > > PR: 181741 > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D16515 Sorry, I forgot: Tested by: jbeich, pho From owner-svn-src-all@freebsd.org Sun Aug 5 02:02:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6760B105D144; Sun, 5 Aug 2018 02:02:51 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1AA773671; Sun, 5 Aug 2018 02:02:50 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w7522nYf094392 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Aug 2018 19:02:49 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w7522nZ8094391; Sat, 4 Aug 2018 19:02:49 -0700 (PDT) (envelope-from jmg) Date: Sat, 4 Aug 2018 19:02:49 -0700 From: John-Mark Gurney To: Kristof Provost Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336221 - head/sys/net Message-ID: <20180805020249.GL2884@funkthat.com> Mail-Followup-To: John-Mark Gurney , Kristof Provost , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201807121635.w6CGZZAN046919@repo.freebsd.org> <20180803230405.GI420@FreeBSD.org> <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sat, 04 Aug 2018 19:02:49 -0700 (PDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 02:02:51 -0000 Kristof Provost wrote this message on Sat, Aug 04, 2018 at 12:49 +0200: > On 4 Aug 2018, at 1:04, Gleb Smirnoff wrote: > > On Thu, Jul 12, 2018 at 04:35:35PM +0000, Kristof Provost wrote: > > K> Author: kp > > K> Date: Thu Jul 12 16:35:35 2018 > > K> New Revision: 336221 > > K> URL: https://svnweb.freebsd.org/changeset/base/336221 > > K> > > K> Log: > > K> pf: Increate default state table size > > K> > > K> The typical system now has a lot more memory than when pf was > > new, and is also > > K> expected to handle more connections. Increase the default size of > > the state > > K> table. > > K> Note that users can overrule this using 'set limit states' in > > pf.conf. > > K> > > K> From OpenBSD: > > K> The year is 2018. > > K> Mercury, Bowie, Cash, Motorola and DEC all left us. > > K> Just pf still has a default state table limit of 10000. > > K> Had! Now it's a tiny little bit more, 100k. > > K> lead guitar: me > > K> ok chorus: phessler theo claudio benno > > K> background school girl laughing: bob > > > > For FreeBSD it would also make sense to bump hash sizes along with > > this change. > > > Yeah, Olivier did some benchmarking work around this: > https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md > > He found a roughly 10% increase in throughput by increasing the hash > size to 256K. > I???ve been thinking about making the hash size dynamically configurable > (so we could calculate it based in the state limit, rather than expect > users to tune this manually), but that???s probably not going to get > done any time soon. Yes, this would be best... Also, tests on non-amd64 hardware would be good as well... > I???ll see about increasing the default (although perhaps not to 256K, > because if my math is right that???s cost us ~20MB of memory) soon, > because that???s mostly a quick win. I can see a default of maybe 64k (giving an average of just under 2 per bucket). IMO if you have that busy of a firewall, some tuning should be expected. Also, I don't know the hash used, but another option is to use a non-power of 2 hash... Increasing the memory required on smaller systems and not making sure it's documented how to save that memory is a bad idea... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@freebsd.org Sun Aug 5 02:41:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75723105F276 for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0776E74DCE for ; Sun, 5 Aug 2018 02:41:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id y10-v6so8184614ioa.10 for ; Sat, 04 Aug 2018 19:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=CA3rJaYUIAQWcyDpn7yDG5zprgSNl0tBmt1kNvB4ga0lFmScfgQWmNmdOlpoy+V4RT HDK56suwuzhyZPDDeMKGe9FYmdU1nHiPx4e0oTbL067BkFIyL1GDPXczJbSxCYMXd2wX 3Vb7AX4XFerrv7/dEx8YQb6iax+Tm7SnU3fpSBAGiEdcIFlmJBB1Ag6l82tqZcottjIn 2LEUypiXA3Co1XQbls3q8CIqRFDAZxxi1fNIYzS73jU8/BpCRGt+VLBXTotmy8Id+wsJ RKadv2sxiVAfucv8o6jOTJOK/psDFBeUrHvkY77omDU71N32p0nhMbKF1Z7kCMbPNz6k Dgsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=tAGX+eNLsn0zENwkH7MP5QHXxorJt6D5MOWW3UlL9bs=; b=U9t0DR07ZZkbpdF15LRePx+jYa3C/2c2xmZqaGvqpfuAgfRz4/4hgg6s4phSjyzhcR n1YgHC52ilKfIHyAn7nHFItGAvEg+CUjjFzneDUilAL+S/ecYceZxZi1uy12uMhbbvMz 3pg6DLwd6+zCkNGy/PyUYgeIyzmiGxAYJnB3v5z/fiZRXGhROMsG8NIwV0gfqD4Imr9C NiXkQuUys8WDmNsjvXUDcLJUW1tWa0BFauXIx3N0QuwK4pmq5/Avg/TdGubgwroj4lCs cdo3NaI2sSkFTVe3zh6LjsKWDjg08IGdp10zoMjV+piPyd9K9813Q5cUBIhGVjUYPzz/ XQKA== X-Gm-Message-State: AOUpUlEsqI7MIqsg5LmBx8tnl3UnGitNrqWExvh5VbHbu02zveUq4ZqP h/Bo1w1wJauynRD6B43np5+GK00b5quUH9Lq+Tfp8Q== X-Google-Smtp-Source: AA+uWPzmrx2NC1CMHRrWltrzZK24oCDHWgNiaVuUwza5vIQin6TzJ9p85vyK8/M8ergJ3a2p4ACpKF38RgVonwhPGtE= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr10942135ioa.168.1533436878188; Sat, 04 Aug 2018 19:41:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:4485:0:0:0:0:0 with HTTP; Sat, 4 Aug 2018 19:41:17 -0700 (PDT) X-Originating-IP: [86.153.210.77] In-Reply-To: References: <201808042208.w74M8OmD057603@repo.freebsd.org> From: Warner Losh Date: Sat, 4 Aug 2018 20:41:17 -0600 X-Google-Sender-Auth: FneHxHEE--m4n3_OlVEGuN48a9I Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 02:41:19 -0000 On Sat, Aug 4, 2018 at 5:01 PM, Warner Losh wrote: > > > On Sat, Aug 4, 2018, 11:48 PM Conrad Meyer wrote: > >> If not stale, it was inaccurate as-is. It seems to be used by a bunch >> of different clock-related drivers and routines, e.g., >> >> $ rg '(tz_minuteswest|tz_dst|utc_offset)' | wc -l >> 36 >> > > Right. Nothings sets it any more though and hasn't in 30 years. Adjkerntz > is what is used today. The other code was left for still lingering legacy > uses in the early 1990s... > Amplifying a bit, This was introduced around 4.2BSD, along with a compiled in default TIMEZONE to replace the older ftime from Version 7 which itself was an improvement on Verison 6's gtime routines (etc, there's been a lot of churn in this area unlike 'open' or 'read'). It was used by localtime() to offset the system time by this value to get local time. You could compile it into the kernel, or set it with date -t. troff also used it in one place. Otherwise, the kernel just provided an interface for userland to get this value (gettimeofday) and set it (settimeofday). This continued in 4.3BSD pretty much the same. Then in 4.4BSD David Olson's TZ stuff went in, and it became obsolete (so with FreeBSD 1.0). NetBSD has eliminated the variable, and returns 0's. This is what I'm advocating that FreeBSD do. phk introduced utc_offset() in r62962 (12 years ago) to consolidate people doing the adjkerntz stuff all over the tree. As part of this work, he moved tz_minuteswest and tz_dsttime from sys/kernel.h to sys/clock.h. This itself is an earlier cleanup which broke part tz into tz_minueswest and tz_dsttime in r110299 (15 years ago). This appears to have been inspired by getting them out from under Giant. tz itself originated with the 4.4 import at the dawn of the project. Why phk didn't just delete them at any number of these weigh points, I can only speculate. They were kinda sorta in use in FreeBSD since early days for various RTC things. TIMEZONE (from 4.x BSD days) was eliminated from config in 1995 by dg with the introduction of adjkerntz which was supposed to be controlling for this offset. This is a longer way of saying, we can kill it, along with way too much historical detail. Warner From owner-svn-src-all@freebsd.org Sun Aug 5 04:20:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F059A106327C; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7FA478F21; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891BF194BC; Sun, 5 Aug 2018 04:20:52 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w754Kqc3049088; Sun, 5 Aug 2018 04:20:52 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w754Kqx8049087; Sun, 5 Aug 2018 04:20:52 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808050420.w754Kqx8049087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 5 Aug 2018 04:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337342 - head/etc X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 337342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 04:20:53 -0000 Author: brd Date: Sun Aug 5 04:20:52 2018 New Revision: 337342 URL: https://svnweb.freebsd.org/changeset/base/337342 Log: Fix build after r337340. Approved by: will (mentor) Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sun Aug 5 04:16:00 2018 (r337341) +++ head/etc/Makefile Sun Aug 5 04:20:52 2018 (r337342) @@ -70,10 +70,6 @@ BSM_ETC_DIR= ${DESTDIR}/etc/security BIN1+= amd.map .endif -.if ${MK_AUTOFS} != "no" -BIN1+= auto_master -.endif - .if ${MK_FTP} != "no" BIN1+= ftpusers .endif From owner-svn-src-all@freebsd.org Sun Aug 5 06:08:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B6DC1067C8D; Sun, 5 Aug 2018 06:08:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5E0C7D9C9; Sun, 5 Aug 2018 06:08:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6FB81A655; Sun, 5 Aug 2018 06:08:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7568NDW003563; Sun, 5 Aug 2018 06:08:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7568NtA003562; Sun, 5 Aug 2018 06:08:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050608.w7568NtA003562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337344 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 06:08:24 -0000 Author: manu Date: Sun Aug 5 06:08:23 2018 New Revision: 337344 URL: https://svnweb.freebsd.org/changeset/base/337344 Log: arm: allwinner: Remove old unused clocks Remove the old clocks for allwinner as now all the SoCs have been converted to clkng. The only old clock now is the gmac clock which still lives under the /clocks dts node. Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Aug 5 04:40:13 2018 (r337343) +++ head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:08:23 2018 (r337344) @@ -38,23 +38,7 @@ arm/allwinner/a10_hdmiaudio.c optional hdmi sound arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard -arm/allwinner/clk/aw_ahbclk.c standard -arm/allwinner/clk/aw_apbclk.c standard -arm/allwinner/clk/aw_axiclk.c standard -arm/allwinner/clk/aw_codecclk.c standard -arm/allwinner/clk/aw_cpuclk.c standard -arm/allwinner/clk/aw_cpusclk.c standard -arm/allwinner/clk/aw_debeclk.c standard -arm/allwinner/clk/aw_gate.c standard arm/allwinner/clk/aw_gmacclk.c standard -arm/allwinner/clk/aw_hdmiclk.c standard -arm/allwinner/clk/aw_lcdclk.c standard -arm/allwinner/clk/aw_modclk.c standard -arm/allwinner/clk/aw_mmcclk.c standard -arm/allwinner/clk/aw_oscclk.c standard -arm/allwinner/clk/aw_pll.c standard -arm/allwinner/clk/aw_thsclk.c standard -arm/allwinner/clk/aw_usbclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard From owner-svn-src-all@freebsd.org Sun Aug 5 06:10:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCE61067E45; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6230F7DBBD; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44B561A65A; Sun, 5 Aug 2018 06:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756AEwS003705; Sun, 5 Aug 2018 06:10:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756AEVR003704; Sun, 5 Aug 2018 06:10:14 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050610.w756AEVR003704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337345 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 06:10:14 -0000 Author: manu Date: Sun Aug 5 06:10:13 2018 New Revision: 337345 URL: https://svnweb.freebsd.org/changeset/base/337345 Log: arm: allwinner: Disconnect A10/A20 HDMI driver It doesn't work since 2 years when we stopped patching DTS. The DTS now have the correct bindings but they are a lot different from our hacked ones we used to have (and more representative of the reality). Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:08:23 2018 (r337344) +++ head/sys/arm/allwinner/files.allwinner Sun Aug 5 06:10:13 2018 (r337345) @@ -32,10 +32,6 @@ arm/allwinner/aw_thermal.c standard dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev -arm/allwinner/a10_fb.c optional vt -arm/allwinner/a10_hdmi.c optional hdmi -arm/allwinner/a10_hdmiaudio.c optional hdmi sound - arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard arm/allwinner/clk/aw_gmacclk.c standard From owner-svn-src-all@freebsd.org Sun Aug 5 06:15:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C6E71068155; Sun, 5 Aug 2018 06:15:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E637E090; Sun, 5 Aug 2018 06:15:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6CA31A7FA; Sun, 5 Aug 2018 06:15:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756FZgI008811; Sun, 5 Aug 2018 06:15:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756FZcn008810; Sun, 5 Aug 2018 06:15:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050615.w756FZcn008810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337346 - head/sys/dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/extres/clk X-SVN-Commit-Revision: 337346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 06:15:36 -0000 Author: manu Date: Sun Aug 5 06:15:35 2018 New Revision: 337346 URL: https://svnweb.freebsd.org/changeset/base/337346 Log: extres: clkdiv: Fix div_with_table We didn't allowed a divider register value of 0 which can exists and also didn't wrote the value but the divider, which result of a wrong frequency to be selected Modified: head/sys/dev/extres/clk/clk_div.c Modified: head/sys/dev/extres/clk/clk_div.c ============================================================================== --- head/sys/dev/extres/clk/clk_div.c Sun Aug 5 06:10:13 2018 (r337345) +++ head/sys/dev/extres/clk/clk_div.c Sun Aug 5 06:15:35 2018 (r337346) @@ -97,19 +97,21 @@ clknode_div_table_get_divider(struct clknode_div_sc *s return (0); } -static uint32_t -clknode_div_table_get_value(struct clknode_div_sc *sc, uint32_t divider) +static int +clknode_div_table_get_value(struct clknode_div_sc *sc, uint32_t *divider) { struct clk_div_table *table; if (!(sc->div_flags & CLK_DIV_WITH_TABLE)) - return (divider); + return (0); for (table = sc->div_table; table->divider != 0; table++) - if (table->divider == sc->divider) - return (table->value); + if (table->divider == *divider) { + *divider = table->value; + return (0); + } - return (0); + return (ENOENT); } static int @@ -164,7 +166,7 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin { struct clknode_div_sc *sc; uint64_t divider, _fin, _fout; - uint32_t reg, i_div, f_div, hw_i_div; + uint32_t div_value, reg, i_div, f_div, hw_i_div; int rv; sc = clknode_get_softc(clk); @@ -215,9 +217,11 @@ clknode_div_set_freq(struct clknode *clk, uint64_t fin (*fout != (_fin / divider))) return (ERANGE); - divider = clknode_div_table_get_value(sc, divider); - if (divider == 0) + div_value = divider; + if (clknode_div_table_get_value(sc, &div_value) != 0) return (ERANGE); + if (div_value != divider) + i_div = div_value; DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, From owner-svn-src-all@freebsd.org Sun Aug 5 06:16:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6F1A1068241; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5E27E226; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E5831A7FB; Sun, 5 Aug 2018 06:16:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w756Gb2x008896; Sun, 5 Aug 2018 06:16:37 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w756GbBV008895; Sun, 5 Aug 2018 06:16:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808050616.w756GbBV008895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 5 Aug 2018 06:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337347 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 337347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 06:16:37 -0000 Author: manu Date: Sun Aug 5 06:16:36 2018 New Revision: 337347 URL: https://svnweb.freebsd.org/changeset/base/337347 Log: allwinner: a64: Add THS clock support The clock for the thermal sensor controller was missing when this driver was made. Modified: head/sys/arm/allwinner/clkng/ccu_a64.c Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sun Aug 5 06:15:35 2018 (r337346) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sun Aug 5 06:16:36 2018 (r337347) @@ -192,6 +192,8 @@ static struct aw_ccung_gate a64_ccu_gates[] = { CCU_GATE(CLK_BUS_DBG, "bus-dbg", "ahb1", 0x70, 7) + CCU_GATE(CLK_THS, "ths", "thsdiv", 0x74, 31) + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) CCU_GATE(CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) CCU_GATE(CLK_USB_HSIC, "usb-hsic", "pll_hsic", 0xcc, 10) @@ -489,6 +491,22 @@ PREDIV_CLK(ahb2_clk, CLK_AHB2, /* id */ 0, 0, 2, AW_CLK_FACTOR_HAS_COND | AW_CLK_FACTOR_FIXED, /* prediv */ 0, 2, 1); /* prediv condition */ +static const char *ths_parents[] = {"osc24M"}; +static struct clk_div_table ths_div_table[] = { + { .value = 0, .divider = 1, }, + { .value = 1, .divider = 2, }, + { .value = 2, .divider = 4, }, + { .value = 3, .divider = 6, }, + { }, +}; +DIV_CLK(ths_clk, + 0, /* id */ + "thsdiv", ths_parents, /* name, parents */ + 0x74, /* offset */ + 0, 2, /* div shift, div width */ + CLK_DIV_WITH_TABLE, /* flags */ + ths_div_table); /* div table */ + static const char *mod_parents[] = {"osc24M", "pll_periph0_2x", "pll_periph1_2x"}; NM_CLK(nand_clk, CLK_NAND, "nand", mod_parents, /* id, name, parents */ @@ -725,6 +743,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_DIV, .clk.div = &axi_clk}, { .type = AW_CLK_DIV, .clk.div = &apb1_clk}, { .type = AW_CLK_DIV, .clk.div = &apb_clk}, + { .type = AW_CLK_DIV, .clk.div = &ths_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &osc12m_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph0_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_periph1_clk}, From owner-svn-src-all@freebsd.org Sun Aug 5 07:09:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F65106C5B3; Sun, 5 Aug 2018 07:09:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id AF03682C79; Sun, 5 Aug 2018 07:09:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 14FE0D69B89; Sun, 5 Aug 2018 17:08:58 +1000 (AEST) Date: Sun, 5 Aug 2018 17:08:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <201808042208.w74M8OmD057603@repo.freebsd.org> Message-ID: <20180805161913.C1770@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=JAFv7INFKiA87vfPrSIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 07:09:09 -0000 On Sat, 4 Aug 2018, Conrad Meyer wrote: > Log: > settimeofday(2): Remove stale note about timezone > > Contrary to the removed comment, the kernel does appear to use the timezone > argument of settimeofday. The comment dates to the BSD4.4 import; I assume it > is just stale. The kernel not only appears to use the timezone set by settimeofday(), but does use it. Applications may use it too, and adjkerntz(8) does use it. The kernel and adjkerntz also use the machdep.adjkerntz and machdep.wall_cmos_clock sysctls (these are MI but have old names for compatibility), and the final utc_offset() is: (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) adjkerntz(8) does very little when wall_cmos_clock == 0. Otherwise, it manages tz_minuteswest, but I think this is only to compensate for other applications setting it. It gets the correct offset from userland and normally just puts that in adjkerntz, leaving tz_minuteswest as 0, but if tz_minuteswest != 0 then I think it preserves this mistake but compensates for it but adjusting adjkerntz so that the final offset comes out right. The broken comment applied to both gettimeofday() and settimeofday(), and is wrongest for gettimeofday(). The kernel really does use tz_minuteswest, and gettimeofday() is the only way to determine its setting. adjkerntz makes critical use of reading it even if it doesn't change it, to compensate for the foot shooting of other applications setting it. Of course, adjkerntz can't do much if other applications set it after adjkerntz(8) runs. adjkerntz normally runs at boot time before other applications have had much chance to clobber tz_minuteswest. Then it is possible for another application to clobber it. adjkerntz might be confused when it runs about 6 months later to adjust the dst, but the time becomong wrong immediately when the other application clobbers tz_minuteswest is a larger problem. The comment was almost correct in 4.4BSD-Lite2. get/settimeofday() supported the timezone parameter, but the kernel didn't use tz_minuteswest except in the i386 inittodr() which was only called at boot time before settimeofday() can run, and in some hp code where the use seems to be read-only. > Modified: head/lib/libc/sys/gettimeofday.2 > ============================================================================== > --- head/lib/libc/sys/gettimeofday.2 Sat Aug 4 21:57:17 2018 (r337333) > +++ head/lib/libc/sys/gettimeofday.2 Sat Aug 4 22:08:24 2018 (r337334) > @@ -28,7 +28,7 @@ > .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 > .\" $FreeBSD$ > .\" > -.Dd December 27, 2015 > +.Dd August 4, 2018 > .Dt GETTIMEOFDAY 2 > .Os > .Sh NAME > @@ -44,11 +44,6 @@ > .Ft int > .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" > .Sh DESCRIPTION > -.Bf -symbolic > -Note: timezone is no longer used; this information is kept outside > -the kernel. > -.Ef > -.Pp > The system's notion of the current Greenwich time and the current time > zone is obtained with the > .Fn gettimeofday The note should have been placed after this section to more obviously cancel what this section says about time zones. This section also doesn't say anything about the wall_cmos_clock and adjkerntz sysctls or there interaction with tz_minuteswest which is what actually determines the system's notion of the current time zone. Bruce From owner-svn-src-all@freebsd.org Sun Aug 5 11:14:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61E9E1072DF3; Sun, 5 Aug 2018 11:14:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17ECB8BD85; Sun, 5 Aug 2018 11:14:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5EC1D837; Sun, 5 Aug 2018 11:14:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75BED00061977; Sun, 5 Aug 2018 11:14:13 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75BED7N061975; Sun, 5 Aug 2018 11:14:13 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201808051114.w75BED7N061975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 5 Aug 2018 11:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337348 - in head: share/man/man4 sys/dev/usb/input sys/modules/usb/uep X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/input sys/modules/usb/uep X-SVN-Commit-Revision: 337348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 11:14:14 -0000 Author: wulf Date: Sun Aug 5 11:14:13 2018 New Revision: 337348 URL: https://svnweb.freebsd.org/changeset/base/337348 Log: uep(4): add evdev support To compile this driver with evdev support enabled, place following lines into the kernel configuration file: options EVDEV_SUPPORT device evdev Note: Native and evdev modes are mutually exclusive. Reviewed by: gonzo, wblock (docs) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11156 Modified: head/share/man/man4/uep.4 head/sys/dev/usb/input/uep.c head/sys/modules/usb/uep/Makefile Modified: head/share/man/man4/uep.4 ============================================================================== --- head/share/man/man4/uep.4 Sun Aug 5 06:16:36 2018 (r337347) +++ head/share/man/man4/uep.4 Sun Aug 5 11:14:13 2018 (r337348) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 25, 2010 +.Dd August 5, 2018 .Dt UEP 4 .Os .Sh NAME @@ -44,28 +44,46 @@ module at boot time, place the following line in .Bd -literal -offset indent uep_load="YES" .Ed +.Pp +To compile this driver with evdev support enabled, place the +following lines into the kernel configuration file: +.Bd -ragged -offset indent +.Cd "options EVDEV_SUPPORT" +.Cd "device evdev" +.Ed .Sh DESCRIPTION The .Nm driver provides support for the eGalax onscreen touch panels. .Pp -The driver is stub. -It just probes and attaches to USB device, creates device entry +The driver is a stub. +It just probes and attaches to USB device, creates a device entry and feeds reassembled packets from the hardware to it. +Depending on compile-time kernel options it supports either native +or evdev operation modes. .Pp -To get mouse working in -.Xr X 7 , -one needs to install +To get the mouse working in +.Xr X 7 +in native mode, install .Pa ports/x11-drivers/xf86-input-egalax . +.Pp +To get the mouse working in +.Xr X 7 +in evdev mode, install +.Pa ports/x11-drivers/xf86-input-evdev . .Sh FILES .Nm -creates a blocking pseudo\-device file, -.Pa /dev/uep0 . +creates a blocking pseudo-device file, +.Pa /dev/uep0 +in native mode or +.Pa /dev/input/eventN +in evdev mode. .Sh SEE ALSO .Xr usb 4 , .Xr loader.conf 5 , .Xr xorg.conf 5 Pq Pa ports/x11/xorg , -.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax . +.Xr egalax 4 Pq Pa ports/x11-drivers/xf86-input-egalax , +.Xr evdev 4 Pq Pa ports/x11-drivers/xf86-input-evdev . .Sh AUTHORS .An -nosplit The @@ -74,6 +92,8 @@ driver was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . .Sh BUGS .Nm -can't act like +cannot act like .Xr sysmouse 4 , -since the latter does not support absolute motion events. +as +.Xr sysmouse 4 +does not support absolute motion events. Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Sun Aug 5 06:16:36 2018 (r337347) +++ head/sys/dev/usb/input/uep.c Sun Aug 5 11:14:13 2018 (r337348) @@ -32,6 +32,8 @@ * http://www.eeti.com.tw/pdf/Software%20Programming%20Guide_v2.0.pdf */ +#include "opt_evdev.h" + #include #include #include @@ -49,9 +51,14 @@ #include #include "usbdevs.h" +#ifdef EVDEV_SUPPORT +#include +#include +#else #include #include #include +#endif #define USB_DEBUG_VAR uep_debug #include @@ -90,11 +97,15 @@ struct uep_softc { struct mtx mtx; struct usb_xfer *xfer[UEP_N_TRANSFER]; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev; +#else struct usb_fifo_sc fifo; u_int pollrate; u_int state; #define UEP_ENABLED 0x01 +#endif /* Reassembling buffer. */ u_char buf[UEP_PACKET_LEN_MAX]; @@ -107,6 +118,18 @@ static device_probe_t uep_probe; static device_attach_t uep_attach; static device_detach_t uep_detach; +#ifdef EVDEV_SUPPORT + +static evdev_open_t uep_ev_open; +static evdev_close_t uep_ev_close; + +static const struct evdev_methods uep_evdev_methods = { + .ev_open = &uep_ev_open, + .ev_close = &uep_ev_close, +}; + +#else /* !EVDEV_SUPPORT */ + static usb_fifo_cmd_t uep_start_read; static usb_fifo_cmd_t uep_stop_read; static usb_fifo_open_t uep_open; @@ -121,6 +144,7 @@ static struct usb_fifo_methods uep_fifo_methods = { .f_stop_read = &uep_stop_read, .basename[0] = "uep", }; +#endif /* !EVDEV_SUPPORT */ static int get_pkt_len(u_char *buf) @@ -154,6 +178,9 @@ static void uep_process_pkt(struct uep_softc *sc, u_char *buf) { int32_t x, y; +#ifdef EVDEV_SUPPORT + int touch; +#endif if ((buf[0] & 0xFE) != 0x80) { DPRINTF("bad input packet format 0x%.2x\n", buf[0]); @@ -186,7 +213,17 @@ uep_process_pkt(struct uep_softc *sc, u_char *buf) DPRINTFN(2, "x %u y %u\n", x, y); +#ifdef EVDEV_SUPPORT + touch = buf[0] & (1 << 0); + if (touch) { + evdev_push_abs(sc->evdev, ABS_X, x); + evdev_push_abs(sc->evdev, ABS_Y, y); + } + evdev_push_key(sc->evdev, BTN_TOUCH, touch); + evdev_sync(sc->evdev); +#else uep_put_queue(sc, buf); +#endif } static void @@ -261,12 +298,13 @@ uep_intr_callback(struct usb_xfer *xfer, usb_error_t e } case USB_ST_SETUP: tr_setup: +#ifndef EVDEV_SUPPORT /* check if we can put more data into the FIFO */ - if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) != 0) { - usbd_xfer_set_frame_len(xfer, 0, - usbd_xfer_max_len(xfer)); - usbd_transfer_submit(xfer); - } + if (usb_fifo_put_bytes_max(sc->fifo.fp[USB_FIFO_RX]) == 0) + break; +#endif + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); break; default: @@ -330,6 +368,28 @@ uep_attach(device_t dev) goto detach; } +#ifdef EVDEV_SUPPORT + sc->evdev = evdev_alloc(); + evdev_set_name(sc->evdev, device_get_desc(dev)); + evdev_set_phys(sc->evdev, device_get_nameunit(dev)); + evdev_set_id(sc->evdev, BUS_USB, uaa->info.idVendor, + uaa->info.idProduct, 0); + evdev_set_serial(sc->evdev, usb_get_serial(uaa->device)); + evdev_set_methods(sc->evdev, sc, &uep_evdev_methods); + evdev_support_prop(sc->evdev, INPUT_PROP_DIRECT); + evdev_support_event(sc->evdev, EV_SYN); + evdev_support_event(sc->evdev, EV_ABS); + evdev_support_event(sc->evdev, EV_KEY); + evdev_support_key(sc->evdev, BTN_TOUCH); + evdev_support_abs(sc->evdev, ABS_X, 0, 0, UEP_MAX_X, 0, 0, 0); + evdev_support_abs(sc->evdev, ABS_Y, 0, 0, UEP_MAX_Y, 0, 0, 0); + + error = evdev_register_mtx(sc->evdev, &sc->mtx); + if (error) { + DPRINTF("evdev_register_mtx error=%s\n", usbd_errstr(error)); + goto detach; + } +#else /* !EVDEV_SUPPORT */ error = usb_fifo_attach(uaa->device, sc, &sc->mtx, &uep_fifo_methods, &sc->fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); @@ -338,6 +398,7 @@ uep_attach(device_t dev) DPRINTF("usb_fifo_attach error=%s\n", usbd_errstr(error)); goto detach; } +#endif /* !EVDEV_SUPPORT */ sc->buf_len = 0; @@ -354,7 +415,11 @@ uep_detach(device_t dev) { struct uep_softc *sc = device_get_softc(dev); +#ifdef EVDEV_SUPPORT + evdev_free(sc->evdev); +#else usb_fifo_detach(&sc->fifo); +#endif usbd_transfer_unsetup(sc->xfer, UEP_N_TRANSFER); @@ -363,7 +428,31 @@ uep_detach(device_t dev) return (0); } +#ifdef EVDEV_SUPPORT + static void +uep_ev_close(struct evdev_dev *evdev, void *ev_softc) +{ + struct uep_softc *sc = (struct uep_softc *)ev_softc; + + mtx_assert(&sc->mtx, MA_OWNED); + usbd_transfer_stop(sc->xfer[UEP_INTR_DT]); +} + +static int +uep_ev_open(struct evdev_dev *evdev, void *ev_softc) +{ + struct uep_softc *sc = (struct uep_softc *)ev_softc; + + mtx_assert(&sc->mtx, MA_OWNED); + usbd_transfer_start(sc->xfer[UEP_INTR_DT]); + + return (0); +} + +#else /* !EVDEV_SUPPORT */ + +static void uep_start_read(struct usb_fifo *fifo) { struct uep_softc *sc = usb_fifo_softc(fifo); @@ -424,6 +513,7 @@ uep_close(struct usb_fifo *fifo, int fflags) usb_fifo_free_buffer(fifo); } } +#endif /* !EVDEV_SUPPORT */ static devclass_t uep_devclass; @@ -442,5 +532,8 @@ static driver_t uep_driver = { DRIVER_MODULE(uep, uhub, uep_driver, uep_devclass, NULL, NULL); MODULE_DEPEND(uep, usb, 1, 1, 1); +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(uep, evdev, 1, 1, 1); +#endif MODULE_VERSION(uep, 1); USB_PNP_HOST_INFO(uep_devs); Modified: head/sys/modules/usb/uep/Makefile ============================================================================== --- head/sys/modules/usb/uep/Makefile Sun Aug 5 06:16:36 2018 (r337347) +++ head/sys/modules/usb/uep/Makefile Sun Aug 5 11:14:13 2018 (r337348) @@ -5,7 +5,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/input KMOD= uep -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ - uep.c +SRCS= opt_bus.h opt_evdev.h opt_usb.h device_if.h bus_if.h usb_if.h \ + vnode_if.h usbdevs.h uep.c .include From owner-svn-src-all@freebsd.org Sun Aug 5 11:15:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E81D41072E8D; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E0E98BF35; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B4D41D84A; Sun, 5 Aug 2018 11:15:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75BFScG062074; Sun, 5 Aug 2018 11:15:28 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75BFSAa062073; Sun, 5 Aug 2018 11:15:28 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808051115.w75BFSAa062073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 5 Aug 2018 11:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337349 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 337349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 11:15:29 -0000 Author: kp Date: Sun Aug 5 11:15:28 2018 New Revision: 337349 URL: https://svnweb.freebsd.org/changeset/base/337349 Log: zfsboot: Fix startup crash On a FreeNAS mini XL, with geli encrypted drives the loader crashed in geli_read(). When we iterate over the list of disks and allocate the zfsdsk structures we don’t zero out the gdev pointer. In one case that resulted in geli_read() (called on the bogus pointer) dividing by zero. Use calloc() to ensure the zfsdsk structure is always zeroed, so the pointer is initialised to NULL. As a side benefit it gets rid of one #ifdef LOADER_GELI_SUPPORT. Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Aug 5 11:14:13 2018 (r337348) +++ head/stand/i386/zfsboot/zfsboot.c Sun Aug 5 11:15:28 2018 (r337349) @@ -707,10 +707,7 @@ main(void) } setheap(heap_next, heap_end); - zdsk = malloc(sizeof(struct zfsdsk)); -#ifdef LOADER_GELI_SUPPORT - zdsk->gdev = NULL; -#endif + zdsk = calloc(1, sizeof(struct zfsdsk)); zdsk->dsk.drive = *(uint8_t *)PTOV(ARGS); zdsk->dsk.type = zdsk->dsk.drive & DRV_HARD ? TYPE_AD : TYPE_FD; zdsk->dsk.unit = zdsk->dsk.drive & DRV_MASK; @@ -758,7 +755,7 @@ main(void) if (!int13probe(i | DRV_HARD)) break; - zdsk = malloc(sizeof(struct zfsdsk)); + zdsk = calloc(1, sizeof(struct zfsdsk)); zdsk->dsk.drive = i | DRV_HARD; zdsk->dsk.type = zdsk->dsk.drive & TYPE_AD; zdsk->dsk.unit = i; From owner-svn-src-all@freebsd.org Sun Aug 5 13:54:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E6F01053809; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 311579069A; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111111F264; Sun, 5 Aug 2018 13:54:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75DsbRv044202; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75DsbeH044200; Sun, 5 Aug 2018 13:54:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808051354.w75DsbeH044200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 5 Aug 2018 13:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337350 - in head: share/man/man4 sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: share/man/man4 sys/net X-SVN-Commit-Revision: 337350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 13:54:38 -0000 Author: kp Date: Sun Aug 5 13:54:37 2018 New Revision: 337350 URL: https://svnweb.freebsd.org/changeset/base/337350 Log: pf: Increase default hash table size Now that we (by default) limit the number of states to 100.000 it makse sense to also adjust the default size of the hash table. Based on the benchmarking results in https://github.com/ocochard/netbenches/blob/master/Atom_C2758_8Cores-Chelsio_T540-CR/pf-states_hashsize/results/fbsd12-head.r332390/README.md 128K entries offers a good compromise between performance and memory use. Users may still overrule this setting with the net.pf.states_hashsize and net.pf.source_nodes_hashsize loader(8) tunables. Modified: head/share/man/man4/pf.4 head/sys/net/pfvar.h Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Sun Aug 5 11:15:28 2018 (r337349) +++ head/share/man/man4/pf.4 Sun Aug 5 13:54:37 2018 (r337350) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2013 +.Dd August 5, 2018 .Dt PF 4 .Os .Sh NAME @@ -84,11 +84,11 @@ tunables are available. .It Va net.pf.states_hashsize Size of hash tables that store states. Should be power of 2. -Default value is 32768. +Default value is 131072. .It Va net.pf.source_nodes_hashsize Size of hash table that store source nodes. Should be power of 2. -Default value is 8192. +Default value is 32768. .El .Pp Read only Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Sun Aug 5 11:15:28 2018 (r337349) +++ head/sys/net/pfvar.h Sun Aug 5 13:54:37 2018 (r337350) @@ -1470,7 +1470,7 @@ struct pf_idhash { extern u_long pf_hashmask; extern u_long pf_srchashmask; -#define PF_HASHSIZ (32768) +#define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); VNET_DECLARE(struct pf_idhash *, pf_idhash); From owner-svn-src-all@freebsd.org Sun Aug 5 14:06:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA8CD1053C23; Sun, 5 Aug 2018 14:06:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A22490B3B; Sun, 5 Aug 2018 14:06:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 202DF2198C; Sun, 5 Aug 2018 14:06:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.2.164] (ptr-8rgnodu50paeznfgda2.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240b:b802:30d1:a917:bc05:823a]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 661A74154D; Sun, 5 Aug 2018 16:06:32 +0200 (CEST) From: "Kristof Provost" To: "John-Mark Gurney" Cc: "Gleb Smirnoff" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336221 - head/sys/net Date: Sun, 05 Aug 2018 16:06:30 +0200 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <20180805020249.GL2884@funkthat.com> References: <201807121635.w6CGZZAN046919@repo.freebsd.org> <20180803230405.GI420@FreeBSD.org> <25795E0A-A362-44B2-AC5A-573442FC256D@FreeBSD.org> <20180805020249.GL2884@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 14:06:34 -0000 On 5 Aug 2018, at 4:02, John-Mark Gurney wrote: > Also, I don't know the hash used, but another option is to use a > non-power of 2 hash... > I remember seeing patches someone experimented with a new hash algorithm, but I can’t seem to find it anywhere right now. I believe the patch was abandoned, perhaps because of disappointing results. > Increasing the memory required on smaller systems and not making sure > it's documented how to save that memory is a bad idea... > The relevant tuneables are documented in the pf(4) man page. Regards, Kristof From owner-svn-src-all@freebsd.org Sun Aug 5 14:22:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E4241054255 for ; Sun, 5 Aug 2018 14:22:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 172F691284 for ; Sun, 5 Aug 2018 14:22:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 01b49d23-98bb-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 01b49d23-98bb-11e8-93fa-f3ebd9db2b94; Sun, 05 Aug 2018 14:22:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w75EMcJo048329; Sun, 5 Aug 2018 08:22:38 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533478958.9860.18.camel@freebsd.org> Subject: Re: svn commit: r337334 - head/lib/libc/sys From: Ian Lepore To: Warner Losh , "Rodney W. Grimes" Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 05 Aug 2018 08:22:38 -0600 In-Reply-To: References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 14:22:49 -0000 On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: > On Sat, Aug 4, 2018 at 4:24 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > Author: cem > > > Date: Sat Aug  4 22:08:24 2018 > > > New Revision: 337334 > > > URL: https://svnweb.freebsd.org/changeset/base/337334 > > > > > > Log: > > >   settimeofday(2): Remove stale note about timezone > > > > > >   Contrary to the removed comment, the kernel does appear to use the > > timezone > > > > > >   argument of settimeofday.  The comment dates to the BSD4.4 import; I > > assume it > > > > > >   is just stale. > > In what way is the kernel using TZ?   It shouldn't be. > > Or is it using the TZ to adjust the passed in time to UTC/GMT, > > which I would of thought is done before calling settimeofday. > > Specifically, for compatibility, we store minutes west of UTC on > settimeofday and we retrieve it for settimeofday. Otherwise it's 100% > unused by anything else at all in the system. Well, technically, we use it > for utc_offset, we don't really use that elsewhere (one can find references > in utc_offset, but usually we set this via adjkerntz, which is actively > used in the system). tz_minuteswest likely should just be removed, and the > argument to settimzeofday should just be completely ignored. > utc_offset is used by all RTC drivers, and by the convenience routines that convert times to/from FAT filesystem format (which I assume are used by FAT filesystem code, but I haven't checked that). So if the tz info passed to settimeofday() ends up in utc_offset, how can we be sure nobody is relying on that? > One could test it with date -t, nothing does that today. That should be > removed also. Likewise date -d. > > So while hyper technically, one could use this, nobody does, nor has since > between 4.3 and 4.4 when it was realized that storing the timezone in the > kernel was a really stupid idea. That's what the language used in the man > page that you removed was trying to say. > > Warner > > > > > > > > > > Modified: > > >   head/lib/libc/sys/gettimeofday.2 > > > > > > Modified: head/lib/libc/sys/gettimeofday.2 > > > ============================================================ > > ================== > > > > > > --- head/lib/libc/sys/gettimeofday.2  Sat Aug  4 21:57:17 2018 > > (r337333) > > > > > > +++ head/lib/libc/sys/gettimeofday.2  Sat Aug  4 22:08:24 2018 > > (r337334) > > > > > > @@ -28,7 +28,7 @@ > > >  .\"     @(#)gettimeofday.2   8.2 (Berkeley) 5/26/95 > > >  .\" $FreeBSD$ > > >  .\" > > > -.Dd December 27, 2015 > > > +.Dd August 4, 2018 > > >  .Dt GETTIMEOFDAY 2 > > >  .Os > > >  .Sh NAME > > > @@ -44,11 +44,6 @@ > > >  .Ft int > > >  .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" > > >  .Sh DESCRIPTION > > > -.Bf -symbolic > > > -Note: timezone is no longer used; this information is kept outside > > > -the kernel. > > > -.Ef > > > -.Pp > > >  The system's notion of the current Greenwich time and the current time > > >  zone is obtained with the > > >  .Fn gettimeofday > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > From owner-svn-src-all@freebsd.org Sun Aug 5 14:35:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 130561054906; Sun, 5 Aug 2018 14:35:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B01B4919DD; Sun, 5 Aug 2018 14:35:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88AF41F8B6; Sun, 5 Aug 2018 14:35:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75EZZq8064554; Sun, 5 Aug 2018 14:35:35 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75EZVvl064533; Sun, 5 Aug 2018 14:35:31 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808051435.w75EZVvl064533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 5 Aug 2018 14:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337351 - in stable/11: contrib/libarchive/cat contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/tes... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive/cat contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/test... X-SVN-Commit-Revision: 337351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 14:35:36 -0000 Author: mm Date: Sun Aug 5 14:35:30 2018 New Revision: 337351 URL: https://svnweb.freebsd.org/changeset/base/337351 Log: MFH r336801,r336854: MFH r336801 (cem): Cherry-pick upstream 2c8c83b9 Relevant vendor changes: Fix issue #948: out-of-bounds read in lha_read_data_none() MFH r336854: Sync libarchive with vendor. Important vendor changes: PR #993: Chdir to -C directory for metalog processing OSS-Fuzz #4969: Check size of the extended time field in zip archives PR #973: Record informational compression level in gzip header amdbugs: 877 Security: CVE-2017-14503 Added: stable/11/contrib/libarchive/tar/test/test_option_C_mtree.c - copied unchanged from r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c Modified: stable/11/contrib/libarchive/cat/bsdcat.c stable/11/contrib/libarchive/cpio/cpio.c stable/11/contrib/libarchive/libarchive/archive_entry.c stable/11/contrib/libarchive/libarchive/archive_entry.h stable/11/contrib/libarchive/libarchive/archive_openssl_hmac_private.h stable/11/contrib/libarchive/libarchive/archive_read.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/11/contrib/libarchive/libarchive/archive_virtual.c stable/11/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/11/contrib/libarchive/libarchive/test/test_write_filter_gzip.c stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/11/contrib/libarchive/tar/bsdtar.c stable/11/contrib/libarchive/tar/test/test_option_fflags.c stable/11/contrib/libarchive/tar/write.c stable/11/contrib/libarchive/test_utils/test_main.c stable/11/usr.bin/tar/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/cat/bsdcat.c ============================================================================== --- stable/11/contrib/libarchive/cat/bsdcat.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/cat/bsdcat.c Sun Aug 5 14:35:30 2018 (r337351) @@ -61,7 +61,7 @@ usage(FILE *stream, int eval) static void version(void) { - printf("bsdcat %s - %s\n", + printf("bsdcat %s - %s \n", BSDCAT_VERSION_STRING, archive_version_details()); exit(0); Modified: stable/11/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cpio.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/cpio/cpio.c Sun Aug 5 14:35:30 2018 (r337351) @@ -499,7 +499,7 @@ long_help(void) static void version(void) { - fprintf(stdout,"bsdcpio %s - %s\n", + fprintf(stdout,"bsdcpio %s - %s \n", BSDCPIO_VERSION_STRING, archive_version_details()); exit(0); Modified: stable/11/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_entry.c Sun Aug 5 14:35:30 2018 (r337351) @@ -1491,7 +1491,7 @@ archive_entry_acl_next(struct archive_entry *entry, in * the style of the generated ACL. */ wchar_t * -archive_entry_acl_to_text_w(struct archive_entry *entry, ssize_t *len, +archive_entry_acl_to_text_w(struct archive_entry *entry, la_ssize_t *len, int flags) { return (archive_acl_to_text_w(&entry->acl, len, flags, @@ -1499,7 +1499,7 @@ archive_entry_acl_to_text_w(struct archive_entry *entr } char * -archive_entry_acl_to_text(struct archive_entry *entry, ssize_t *len, +archive_entry_acl_to_text(struct archive_entry *entry, la_ssize_t *len, int flags) { return (archive_acl_to_text_l(&entry->acl, len, flags, NULL)); Modified: stable/11/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_entry.h Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_entry.h Sun Aug 5 14:35:30 2018 (r337351) @@ -42,6 +42,7 @@ #include #include /* for wchar_t */ +#include #include #if defined(_WIN32) && !defined(__CYGWIN__) Modified: stable/11/contrib/libarchive/libarchive/archive_openssl_hmac_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_openssl_hmac_private.h Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_openssl_hmac_private.h Sun Aug 5 14:35:30 2018 (r337351) @@ -28,7 +28,8 @@ #include #include -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) +#if OPENSSL_VERSION_NUMBER < 0x10100000L || \ + (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) #include /* malloc, free */ #include /* memset */ static inline HMAC_CTX *HMAC_CTX_new(void) Modified: stable/11/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_read.c Sun Aug 5 14:35:30 2018 (r337351) @@ -821,7 +821,7 @@ archive_read_format_capabilities(struct archive *_a) * DO NOT intermingle calls to this function and archive_read_data_block * to read a single entry body. */ -ssize_t +la_ssize_t archive_read_data(struct archive *_a, void *buff, size_t s) { struct archive *a = (struct archive *)_a; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 5 14:35:30 2018 (r337351) @@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_rea * Prepare variables used to read a file content. */ lha->entry_bytes_remaining = lha->compsize; + if (lha->entry_bytes_remaining < 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid LHa entry size"); + return (ARCHIVE_FATAL); + } lha->entry_offset = 0; lha->entry_crc_calculated = 0; Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Aug 5 14:35:30 2018 (r337351) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_entry.h" #include "archive_private.h" +#include "archive_rb.h" #include "archive_read_private.h" #include "archive_string.h" #include "archive_pack_dev.h" @@ -75,8 +76,6 @@ __FBSDID("$FreeBSD$"); #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ -#define MTREE_HASHTABLE_SIZE 1024 - #define MAX_LINE_LEN (1024 * 1024) struct mtree_option { @@ -85,13 +84,13 @@ struct mtree_option { }; struct mtree_entry { + struct archive_rb_node rbnode; + struct mtree_entry *next_dup; struct mtree_entry *next; struct mtree_option *options; char *name; char full; char used; - unsigned int name_hash; - struct mtree_entry *hashtable_next; }; struct mtree { @@ -104,11 +103,12 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; - struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; + struct archive_rb_tree entry_rbtree; struct archive_string current_dir; struct archive_string contents_name; struct archive_entry_linkresolver *resolver; + struct archive_rb_tree rbtree; int64_t cur_size; char checkfs; @@ -117,7 +117,6 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); -static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -219,9 +218,30 @@ free_options(struct mtree_option *head) } } +static int +mtree_cmp_node(const struct archive_rb_node *n1, + const struct archive_rb_node *n2) +{ + const struct mtree_entry *e1 = (const struct mtree_entry *)n1; + const struct mtree_entry *e2 = (const struct mtree_entry *)n2; + + return (strcmp(e1->name, e2->name)); +} + +static int +mtree_cmp_key(const struct archive_rb_node *n, const void *key) +{ + const struct mtree_entry *e = (const struct mtree_entry *)n; + + return (strcmp(e->name, key)); +} + int archive_read_support_format_mtree(struct archive *_a) { + static const struct archive_rb_tree_ops rb_ops = { + mtree_cmp_node, mtree_cmp_key, + }; struct archive_read *a = (struct archive_read *)_a; struct mtree *mtree; int r; @@ -237,6 +257,8 @@ archive_read_support_format_mtree(struct archive *_a) } mtree->fd = -1; + __archive_rb_tree_init(&mtree->rbtree, &rb_ops); + r = __archive_read_register_format(a, mtree, "mtree", mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL); @@ -875,12 +897,11 @@ process_add_entry(struct archive_read *a, struct mtree struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry, *ht_iter; + struct mtree_entry *entry; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; - unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -891,8 +912,6 @@ process_add_entry(struct archive_read *a, struct mtree entry->name = NULL; entry->used = 0; entry->full = 0; - entry->name_hash = 0; - entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -945,15 +964,17 @@ process_add_entry(struct archive_read *a, struct mtree memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); - entry->name_hash = hash(entry->name); - ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; - if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { - while (ht_iter->hashtable_next) - ht_iter = ht_iter->hashtable_next; - ht_iter->hashtable_next = entry; - } else { - mtree->entry_hashtable[ht_idx] = entry; + entry->next_dup = NULL; + if (entry->full) { + if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) { + struct mtree_entry *alt; + alt = (struct mtree_entry *)__archive_rb_tree_find_node( + &mtree->rbtree, entry->name); + while (alt->next_dup) + alt = alt->next_dup; + alt->next_dup = entry; + } } for (iter = *global; iter != NULL; iter = iter->next) { @@ -1148,14 +1169,13 @@ parse_file(struct archive_read *a, struct archive_entr * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { - if (mp->full && !mp->used - && mentry->name_hash == mp->name_hash - && strcmp(mentry->name, mp->name) == 0) { + mp = (struct mtree_entry *)__archive_rb_tree_find_node( + &mtree->rbtree, mentry->name); + for (; mp; mp = mp->next_dup) { + if (mp->full && !mp->used) { /* Later lines override earlier ones. */ mp->used = 1; - r1 = parse_line(a, entry, mtree, mp, - &parsed_kws); + r1 = parse_line(a, entry, mtree, mp, &parsed_kws); if (r1 < r) r = r1; } @@ -1988,20 +2008,4 @@ readline(struct archive_read *a, struct mtree *mtree, } find_off = u - mtree->line.s; } -} - -static unsigned int -hash(const char *p) -{ - /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, - as used by ELF for hashing function names. */ - unsigned g, h = 0; - while (*p != '\0') { - h = (h << 4) + *p++; - if ((g = h & 0xF0000000) != 0) { - h ^= g >> 24; - h &= 0x0FFFFFFF; - } - } - return h; } Modified: stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Aug 5 14:35:30 2018 (r337351) @@ -511,7 +511,13 @@ process_extra(struct archive_read *a, const char *p, s case 0x5455: { /* Extended time field "UT". */ - int flags = p[offset]; + int flags; + if (datasize == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Incomplete extended time field"); + return ARCHIVE_FAILED; + } + flags = p[offset]; offset++; datasize--; /* Flag bits indicate which dates are present. */ Modified: stable/11/contrib/libarchive/libarchive/archive_virtual.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_virtual.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_virtual.c Sun Aug 5 14:35:30 2018 (r337351) @@ -124,13 +124,13 @@ archive_write_finish_entry(struct archive *a) return ((a->vtable->archive_write_finish_entry)(a)); } -ssize_t +la_ssize_t archive_write_data(struct archive *a, const void *buff, size_t s) { return ((a->vtable->archive_write_data)(a, buff, s)); } -ssize_t +la_ssize_t archive_write_data_block(struct archive *a, const void *buff, size_t s, la_int64_t o) { Modified: stable/11/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c Sun Aug 5 14:35:30 2018 (r337351) @@ -226,7 +226,12 @@ archive_compressor_gzip_open(struct archive_write_filt data->compressed[7] = (uint8_t)(t>>24)&0xff; } else memset(&data->compressed[4], 0, 4); - data->compressed[8] = 0; /* No deflate options */ + if (data->compression_level == 9) + data->compressed[8] = 2; + else if(data->compression_level == 1) + data->compressed[8] = 4; + else + data->compressed[8] = 0; data->compressed[9] = 3; /* OS=Unix */ data->stream.next_out += 10; data->stream.avail_out -= 10; Modified: stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c Sun Aug 5 14:35:30 2018 (r337351) @@ -180,7 +180,7 @@ archive_write_ar_header(struct archive_write *a, struc } memset(buff, ' ', 60); - strncpy(&buff[AR_fmag_offset], "`\n", 2); + memcpy(&buff[AR_fmag_offset], "`\n", 2); if (strcmp(pathname, "/") == 0 ) { /* Entry is archive symbol table in GNU format */ @@ -189,7 +189,7 @@ archive_write_ar_header(struct archive_write *a, struc } if (strcmp(pathname, "__.SYMDEF") == 0) { /* Entry is archive symbol table in BSD format */ - strncpy(buff + AR_name_offset, "__.SYMDEF", 9); + memcpy(buff + AR_name_offset, "__.SYMDEF", 9); goto stat; } if (strcmp(pathname, "//") == 0) { @@ -225,7 +225,7 @@ archive_write_ar_header(struct archive_write *a, struc * actually 15 bytes. */ if (strlen(filename) <= 15) { - strncpy(&buff[AR_name_offset], + memcpy(&buff[AR_name_offset], filename, strlen(filename)); buff[AR_name_offset + strlen(filename)] = '/'; } else { @@ -248,7 +248,7 @@ archive_write_ar_header(struct archive_write *a, struc return (ARCHIVE_FATAL); } - strncpy(se, filename, strlen(filename)); + memcpy(se, filename, strlen(filename)); strcpy(se + strlen(filename), "/\n"); ss = strstr(ar->strtab, se); @@ -285,11 +285,11 @@ archive_write_ar_header(struct archive_write *a, struc * archive header. */ if (strlen(filename) <= 16 && strchr(filename, ' ') == NULL) { - strncpy(&buff[AR_name_offset], filename, strlen(filename)); + memcpy(&buff[AR_name_offset], filename, strlen(filename)); buff[AR_name_offset + strlen(filename)] = ' '; } else { - strncpy(buff + AR_name_offset, "#1/", 3); + memcpy(buff + AR_name_offset, "#1/", 3); if (format_decimal(strlen(filename), buff + AR_name_offset + 3, AR_name_size - 3)) { Modified: stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/test/test_sparse_basic.c Sun Aug 5 14:35:30 2018 (r337351) @@ -118,13 +118,26 @@ create_sparse_file(const char *path, const struct spar assert(handle != INVALID_HANDLE_VALUE); assert(DeviceIoControl(handle, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dmy, NULL) != 0); + + size_t offsetSoFar = 0; + while (s->type != END) { if (s->type == HOLE) { - LARGE_INTEGER distance; + LARGE_INTEGER fileOffset, beyondOffset, distanceToMove; + fileOffset.QuadPart = offsetSoFar; + beyondOffset.QuadPart = offsetSoFar + s->size; + distanceToMove.QuadPart = s->size; - distance.QuadPart = s->size; - assert(SetFilePointerEx(handle, distance, - NULL, FILE_CURRENT) != 0); + FILE_ZERO_DATA_INFORMATION zeroInformation; + zeroInformation.FileOffset = fileOffset; + zeroInformation.BeyondFinalZero = beyondOffset; + + DWORD bytesReturned; + assert(SetFilePointerEx(handle, distanceToMove, + NULL, FILE_CURRENT) != 0); + assert(SetEndOfFile(handle) != 0); + assert(DeviceIoControl(handle, FSCTL_SET_ZERO_DATA, &zeroInformation, + sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &bytesReturned, NULL) != 0); } else { DWORD w, wr; size_t size; @@ -139,6 +152,7 @@ create_sparse_file(const char *path, const struct spar size -= wr; } } + offsetSoFar += s->size; s++; } assertEqualInt(CloseHandle(handle), 1); @@ -484,10 +498,15 @@ DEFINE_TEST(test_sparse_basic) * on all platform. */ const struct sparse sparse_file0[] = { + // 0 // 1024 { DATA, 1024 }, { HOLE, 2048000 }, + // 2049024 // 2051072 { DATA, 2048 }, { HOLE, 2048000 }, + // 4099072 // 4103168 { DATA, 4096 }, { HOLE, 20480000 }, + // 24583168 // 24591360 { DATA, 8192 }, { HOLE, 204800000 }, + // 229391360 // 229391361 { DATA, 1 }, { END, 0 } }; const struct sparse sparse_file1[] = { Modified: stable/11/contrib/libarchive/libarchive/test/test_write_filter_gzip.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_write_filter_gzip.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/test/test_write_filter_gzip.c Sun Aug 5 14:35:30 2018 (r337351) @@ -39,6 +39,7 @@ DEFINE_TEST(test_write_filter_gzip) struct archive* a; char *buff, *data; size_t buffsize, datasize; + unsigned char *rbuff; char path[16]; size_t used1, used2; int i, r, use_prog = 0; @@ -58,6 +59,7 @@ DEFINE_TEST(test_write_filter_gzip) /* * Write a 100 files and read them all back. + * Use default compression level (6). */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -93,6 +95,14 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 0); /* RFC 1952 flag for compression level 6 */ + assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); r = archive_read_support_filter_gzip(a); @@ -116,7 +126,7 @@ DEFINE_TEST(test_write_filter_gzip) /* * Repeat the cycle again, this time setting some compression - * options. + * options. Compression level is 9. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -150,6 +160,14 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 2); /* RFC 1952 flag for compression level 9 */ + /* Curiously, this test fails; the test data above compresses * better at default compression than at level 9. */ /* @@ -181,7 +199,7 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); /* - * Repeat again, with much lower compression. + * Repeat again, with compression level 1 */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -212,6 +230,14 @@ DEFINE_TEST(test_write_filter_gzip) failure("Compression-level=1 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 4); /* RFC 1952 flag for compression level 1 */ assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); Modified: stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/libarchive/test/test_write_filter_zstd.c Sun Aug 5 14:35:30 2018 (r337351) @@ -125,7 +125,7 @@ DEFINE_TEST(test_write_filter_zstd) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_filter_option(a, NULL, "compression-level", "9")); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_filter_option(a, NULL, "compression-level", "15")); + archive_write_set_filter_option(a, NULL, "compression-level", "6")); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); for (i = 0; i < 100; i++) { sprintf(path, "file%03d", i); @@ -140,7 +140,7 @@ DEFINE_TEST(test_write_filter_zstd) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); - failure("compression-level=15 wrote %d bytes, default wrote %d bytes", + failure("compression-level=6 wrote %d bytes, default wrote %d bytes", (int)used2, (int)used1); assert(used2 < used1); Modified: stable/11/contrib/libarchive/tar/bsdtar.c ============================================================================== --- stable/11/contrib/libarchive/tar/bsdtar.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/tar/bsdtar.c Sun Aug 5 14:35:30 2018 (r337351) @@ -920,7 +920,7 @@ usage(void) static void version(void) { - printf("bsdtar %s - %s\n", + printf("bsdtar %s - %s \n", BSDTAR_VERSION_STRING, archive_version_details()); exit(0); Copied: stable/11/contrib/libarchive/tar/test/test_option_C_mtree.c (from r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/tar/test/test_option_C_mtree.c Sun Aug 5 14:35:30 2018 (r337351, copy of r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Arshan Khanifar + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_C_mtree) +{ + char *p0; + size_t s; + int r; + p0 = NULL; + char *content = "./foo type=file uname=root gname=root mode=0755\n"; + char *filename = "output.tar"; + + /* an absolute path to mtree file */ + char *mtree_file = "/METALOG.mtree"; + char *absolute_path = malloc(strlen(testworkdir) + strlen(mtree_file) + 1); + strcpy(absolute_path, testworkdir); + strcat(absolute_path, mtree_file ); + + /* Create an archive using an mtree file. */ + assertMakeFile(absolute_path, 0777, content); + assertMakeDir("bar", 0775); + assertMakeFile("bar/foo", 0777, "abc"); + + r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path); + + failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path); + assertEqualInt(r, 0); + assertEmptyFile("step1.out"); + assertEmptyFile("step1.err"); + + /* Do validation of the constructed archive. */ + + p0 = slurpfile(&s, "output.tar"); + if (!assert(p0 != NULL)) + goto done; + if (!assert(s >= 2048)) + goto done; + assertEqualMem(p0 + 0, "./foo", 5); + assertEqualMem(p0 + 512, "abc", 3); + assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8); + assertEqualMem(p0 + 1536, "\0\0\0\0\0\0\0\0", 8); +done: + free(p0); +} + + Modified: stable/11/contrib/libarchive/tar/test/test_option_fflags.c ============================================================================== --- stable/11/contrib/libarchive/tar/test/test_option_fflags.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/tar/test/test_option_fflags.c Sun Aug 5 14:35:30 2018 (r337351) @@ -25,6 +25,10 @@ #include "test.h" __FBSDID("$FreeBSD$"); +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) +#define chmod _chmod +#endif + static void clear_fflags(const char *pathname) { Modified: stable/11/contrib/libarchive/tar/write.c ============================================================================== --- stable/11/contrib/libarchive/tar/write.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/tar/write.c Sun Aug 5 14:35:30 2018 (r337351) @@ -503,7 +503,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar } set_chdir(bsdtar, arg); } else { - if (*arg != '/' && (arg[0] != '@' || arg[1] != '/')) + if (*arg != '/') do_chdir(bsdtar); /* Handle a deferred -C */ if (*arg == '@') { if (append_archive_filename(bsdtar, a, Modified: stable/11/contrib/libarchive/test_utils/test_main.c ============================================================================== --- stable/11/contrib/libarchive/test_utils/test_main.c Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/contrib/libarchive/test_utils/test_main.c Sun Aug 5 14:35:30 2018 (r337351) @@ -2115,7 +2115,7 @@ void assertVersion(const char *prog, const char *base) int r; char *p, *q; size_t s; - unsigned int prog_len = strlen(base); + size_t prog_len = strlen(base); r = systemf("%s --version >version.stdout 2>version.stderr", prog); if (r != 0) Modified: stable/11/usr.bin/tar/tests/Makefile ============================================================================== --- stable/11/usr.bin/tar/tests/Makefile Sun Aug 5 13:54:37 2018 (r337350) +++ stable/11/usr.bin/tar/tests/Makefile Sun Aug 5 14:35:30 2018 (r337351) @@ -40,6 +40,7 @@ TESTS_SRCS= \ test_help.c \ test_leading_slash.c \ test_missing_file.c \ + test_option_C_mtree.c \ test_option_C_upper.c \ test_option_H_upper.c \ test_option_L_upper.c \ From owner-svn-src-all@freebsd.org Sun Aug 5 14:36:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 926D51054966; Sun, 5 Aug 2018 14:36:17 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45B0A91AF9; Sun, 5 Aug 2018 14:36:17 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25E9F1F8B7; Sun, 5 Aug 2018 14:36:17 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75EaHii064647; Sun, 5 Aug 2018 14:36:17 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75EaCYd064624; Sun, 5 Aug 2018 14:36:12 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201808051436.w75EaCYd064624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 5 Aug 2018 14:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337352 - in stable/10: contrib/libarchive/cat contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/tes... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive/cat contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test contrib/libarchive/test... X-SVN-Commit-Revision: 337352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 14:36:18 -0000 Author: mm Date: Sun Aug 5 14:36:12 2018 New Revision: 337352 URL: https://svnweb.freebsd.org/changeset/base/337352 Log: MFH r336801,r336854: MFH r336801 (cem): Cherry-pick upstream 2c8c83b9 Relevant vendor changes: Fix issue #948: out-of-bounds read in lha_read_data_none() MFH r336854: Sync libarchive with vendor. Important vendor changes: PR #993: Chdir to -C directory for metalog processing OSS-Fuzz #4969: Check size of the extended time field in zip archives PR #973: Record informational compression level in gzip header amdbugs: 877 Security: CVE-2017-14503 Added: stable/10/contrib/libarchive/tar/test/test_option_C_mtree.c - copied unchanged from r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c Modified: stable/10/contrib/libarchive/cat/bsdcat.c stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_openssl_hmac_private.h stable/10/contrib/libarchive/libarchive/archive_read.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_virtual.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_gzip.c stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c stable/10/contrib/libarchive/tar/bsdtar.c stable/10/contrib/libarchive/tar/test/test_option_fflags.c stable/10/contrib/libarchive/tar/write.c stable/10/contrib/libarchive/test_utils/test_main.c stable/10/usr.bin/tar/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/cat/bsdcat.c ============================================================================== --- stable/10/contrib/libarchive/cat/bsdcat.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/cat/bsdcat.c Sun Aug 5 14:36:12 2018 (r337352) @@ -61,7 +61,7 @@ usage(FILE *stream, int eval) static void version(void) { - printf("bsdcat %s - %s\n", + printf("bsdcat %s - %s \n", BSDCAT_VERSION_STRING, archive_version_details()); exit(0); Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/cpio/cpio.c Sun Aug 5 14:36:12 2018 (r337352) @@ -499,7 +499,7 @@ long_help(void) static void version(void) { - fprintf(stdout,"bsdcpio %s - %s\n", + fprintf(stdout,"bsdcpio %s - %s \n", BSDCPIO_VERSION_STRING, archive_version_details()); exit(0); Modified: stable/10/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_entry.c Sun Aug 5 14:36:12 2018 (r337352) @@ -1491,7 +1491,7 @@ archive_entry_acl_next(struct archive_entry *entry, in * the style of the generated ACL. */ wchar_t * -archive_entry_acl_to_text_w(struct archive_entry *entry, ssize_t *len, +archive_entry_acl_to_text_w(struct archive_entry *entry, la_ssize_t *len, int flags) { return (archive_acl_to_text_w(&entry->acl, len, flags, @@ -1499,7 +1499,7 @@ archive_entry_acl_to_text_w(struct archive_entry *entr } char * -archive_entry_acl_to_text(struct archive_entry *entry, ssize_t *len, +archive_entry_acl_to_text(struct archive_entry *entry, la_ssize_t *len, int flags) { return (archive_acl_to_text_l(&entry->acl, len, flags, NULL)); Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Sun Aug 5 14:36:12 2018 (r337352) @@ -42,6 +42,7 @@ #include #include /* for wchar_t */ +#include #include #if defined(_WIN32) && !defined(__CYGWIN__) Modified: stable/10/contrib/libarchive/libarchive/archive_openssl_hmac_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_openssl_hmac_private.h Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_openssl_hmac_private.h Sun Aug 5 14:36:12 2018 (r337352) @@ -28,7 +28,8 @@ #include #include -#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) +#if OPENSSL_VERSION_NUMBER < 0x10100000L || \ + (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) #include /* malloc, free */ #include /* memset */ static inline HMAC_CTX *HMAC_CTX_new(void) Modified: stable/10/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_read.c Sun Aug 5 14:36:12 2018 (r337352) @@ -821,7 +821,7 @@ archive_read_format_capabilities(struct archive *_a) * DO NOT intermingle calls to this function and archive_read_data_block * to read a single entry body. */ -ssize_t +la_ssize_t archive_read_data(struct archive *_a, void *buff, size_t s) { struct archive *a = (struct archive *)_a; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 5 14:36:12 2018 (r337352) @@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_rea * Prepare variables used to read a file content. */ lha->entry_bytes_remaining = lha->compsize; + if (lha->entry_bytes_remaining < 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid LHa entry size"); + return (ARCHIVE_FATAL); + } lha->entry_offset = 0; lha->entry_crc_calculated = 0; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Sun Aug 5 14:36:12 2018 (r337352) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_entry.h" #include "archive_private.h" +#include "archive_rb.h" #include "archive_read_private.h" #include "archive_string.h" #include "archive_pack_dev.h" @@ -75,8 +76,6 @@ __FBSDID("$FreeBSD$"); #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ -#define MTREE_HASHTABLE_SIZE 1024 - #define MAX_LINE_LEN (1024 * 1024) struct mtree_option { @@ -85,13 +84,13 @@ struct mtree_option { }; struct mtree_entry { + struct archive_rb_node rbnode; + struct mtree_entry *next_dup; struct mtree_entry *next; struct mtree_option *options; char *name; char full; char used; - unsigned int name_hash; - struct mtree_entry *hashtable_next; }; struct mtree { @@ -104,11 +103,12 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; - struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; + struct archive_rb_tree entry_rbtree; struct archive_string current_dir; struct archive_string contents_name; struct archive_entry_linkresolver *resolver; + struct archive_rb_tree rbtree; int64_t cur_size; char checkfs; @@ -117,7 +117,6 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); -static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -219,9 +218,30 @@ free_options(struct mtree_option *head) } } +static int +mtree_cmp_node(const struct archive_rb_node *n1, + const struct archive_rb_node *n2) +{ + const struct mtree_entry *e1 = (const struct mtree_entry *)n1; + const struct mtree_entry *e2 = (const struct mtree_entry *)n2; + + return (strcmp(e1->name, e2->name)); +} + +static int +mtree_cmp_key(const struct archive_rb_node *n, const void *key) +{ + const struct mtree_entry *e = (const struct mtree_entry *)n; + + return (strcmp(e->name, key)); +} + int archive_read_support_format_mtree(struct archive *_a) { + static const struct archive_rb_tree_ops rb_ops = { + mtree_cmp_node, mtree_cmp_key, + }; struct archive_read *a = (struct archive_read *)_a; struct mtree *mtree; int r; @@ -237,6 +257,8 @@ archive_read_support_format_mtree(struct archive *_a) } mtree->fd = -1; + __archive_rb_tree_init(&mtree->rbtree, &rb_ops); + r = __archive_read_register_format(a, mtree, "mtree", mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL); @@ -875,12 +897,11 @@ process_add_entry(struct archive_read *a, struct mtree struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry, *ht_iter; + struct mtree_entry *entry; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; - unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -891,8 +912,6 @@ process_add_entry(struct archive_read *a, struct mtree entry->name = NULL; entry->used = 0; entry->full = 0; - entry->name_hash = 0; - entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -945,15 +964,17 @@ process_add_entry(struct archive_read *a, struct mtree memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); - entry->name_hash = hash(entry->name); - ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; - if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { - while (ht_iter->hashtable_next) - ht_iter = ht_iter->hashtable_next; - ht_iter->hashtable_next = entry; - } else { - mtree->entry_hashtable[ht_idx] = entry; + entry->next_dup = NULL; + if (entry->full) { + if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) { + struct mtree_entry *alt; + alt = (struct mtree_entry *)__archive_rb_tree_find_node( + &mtree->rbtree, entry->name); + while (alt->next_dup) + alt = alt->next_dup; + alt->next_dup = entry; + } } for (iter = *global; iter != NULL; iter = iter->next) { @@ -1148,14 +1169,13 @@ parse_file(struct archive_read *a, struct archive_entr * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { - if (mp->full && !mp->used - && mentry->name_hash == mp->name_hash - && strcmp(mentry->name, mp->name) == 0) { + mp = (struct mtree_entry *)__archive_rb_tree_find_node( + &mtree->rbtree, mentry->name); + for (; mp; mp = mp->next_dup) { + if (mp->full && !mp->used) { /* Later lines override earlier ones. */ mp->used = 1; - r1 = parse_line(a, entry, mtree, mp, - &parsed_kws); + r1 = parse_line(a, entry, mtree, mp, &parsed_kws); if (r1 < r) r = r1; } @@ -1988,20 +2008,4 @@ readline(struct archive_read *a, struct mtree *mtree, } find_off = u - mtree->line.s; } -} - -static unsigned int -hash(const char *p) -{ - /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, - as used by ELF for hashing function names. */ - unsigned g, h = 0; - while (*p != '\0') { - h = (h << 4) + *p++; - if ((g = h & 0xF0000000) != 0) { - h ^= g >> 24; - h &= 0x0FFFFFFF; - } - } - return h; } Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Sun Aug 5 14:36:12 2018 (r337352) @@ -511,7 +511,13 @@ process_extra(struct archive_read *a, const char *p, s case 0x5455: { /* Extended time field "UT". */ - int flags = p[offset]; + int flags; + if (datasize == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Incomplete extended time field"); + return ARCHIVE_FAILED; + } + flags = p[offset]; offset++; datasize--; /* Flag bits indicate which dates are present. */ Modified: stable/10/contrib/libarchive/libarchive/archive_virtual.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_virtual.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_virtual.c Sun Aug 5 14:36:12 2018 (r337352) @@ -124,13 +124,13 @@ archive_write_finish_entry(struct archive *a) return ((a->vtable->archive_write_finish_entry)(a)); } -ssize_t +la_ssize_t archive_write_data(struct archive *a, const void *buff, size_t s) { return ((a->vtable->archive_write_data)(a, buff, s)); } -ssize_t +la_ssize_t archive_write_data_block(struct archive *a, const void *buff, size_t s, la_int64_t o) { Modified: stable/10/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c Sun Aug 5 14:36:12 2018 (r337352) @@ -226,7 +226,12 @@ archive_compressor_gzip_open(struct archive_write_filt data->compressed[7] = (uint8_t)(t>>24)&0xff; } else memset(&data->compressed[4], 0, 4); - data->compressed[8] = 0; /* No deflate options */ + if (data->compression_level == 9) + data->compressed[8] = 2; + else if(data->compression_level == 1) + data->compressed[8] = 4; + else + data->compressed[8] = 0; data->compressed[9] = 3; /* OS=Unix */ data->stream.next_out += 10; data->stream.avail_out -= 10; Modified: stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Sun Aug 5 14:36:12 2018 (r337352) @@ -180,7 +180,7 @@ archive_write_ar_header(struct archive_write *a, struc } memset(buff, ' ', 60); - strncpy(&buff[AR_fmag_offset], "`\n", 2); + memcpy(&buff[AR_fmag_offset], "`\n", 2); if (strcmp(pathname, "/") == 0 ) { /* Entry is archive symbol table in GNU format */ @@ -189,7 +189,7 @@ archive_write_ar_header(struct archive_write *a, struc } if (strcmp(pathname, "__.SYMDEF") == 0) { /* Entry is archive symbol table in BSD format */ - strncpy(buff + AR_name_offset, "__.SYMDEF", 9); + memcpy(buff + AR_name_offset, "__.SYMDEF", 9); goto stat; } if (strcmp(pathname, "//") == 0) { @@ -225,7 +225,7 @@ archive_write_ar_header(struct archive_write *a, struc * actually 15 bytes. */ if (strlen(filename) <= 15) { - strncpy(&buff[AR_name_offset], + memcpy(&buff[AR_name_offset], filename, strlen(filename)); buff[AR_name_offset + strlen(filename)] = '/'; } else { @@ -248,7 +248,7 @@ archive_write_ar_header(struct archive_write *a, struc return (ARCHIVE_FATAL); } - strncpy(se, filename, strlen(filename)); + memcpy(se, filename, strlen(filename)); strcpy(se + strlen(filename), "/\n"); ss = strstr(ar->strtab, se); @@ -285,11 +285,11 @@ archive_write_ar_header(struct archive_write *a, struc * archive header. */ if (strlen(filename) <= 16 && strchr(filename, ' ') == NULL) { - strncpy(&buff[AR_name_offset], filename, strlen(filename)); + memcpy(&buff[AR_name_offset], filename, strlen(filename)); buff[AR_name_offset + strlen(filename)] = ' '; } else { - strncpy(buff + AR_name_offset, "#1/", 3); + memcpy(buff + AR_name_offset, "#1/", 3); if (format_decimal(strlen(filename), buff + AR_name_offset + 3, AR_name_size - 3)) { Modified: stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/test/test_sparse_basic.c Sun Aug 5 14:36:12 2018 (r337352) @@ -118,13 +118,26 @@ create_sparse_file(const char *path, const struct spar assert(handle != INVALID_HANDLE_VALUE); assert(DeviceIoControl(handle, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dmy, NULL) != 0); + + size_t offsetSoFar = 0; + while (s->type != END) { if (s->type == HOLE) { - LARGE_INTEGER distance; + LARGE_INTEGER fileOffset, beyondOffset, distanceToMove; + fileOffset.QuadPart = offsetSoFar; + beyondOffset.QuadPart = offsetSoFar + s->size; + distanceToMove.QuadPart = s->size; - distance.QuadPart = s->size; - assert(SetFilePointerEx(handle, distance, - NULL, FILE_CURRENT) != 0); + FILE_ZERO_DATA_INFORMATION zeroInformation; + zeroInformation.FileOffset = fileOffset; + zeroInformation.BeyondFinalZero = beyondOffset; + + DWORD bytesReturned; + assert(SetFilePointerEx(handle, distanceToMove, + NULL, FILE_CURRENT) != 0); + assert(SetEndOfFile(handle) != 0); + assert(DeviceIoControl(handle, FSCTL_SET_ZERO_DATA, &zeroInformation, + sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &bytesReturned, NULL) != 0); } else { DWORD w, wr; size_t size; @@ -139,6 +152,7 @@ create_sparse_file(const char *path, const struct spar size -= wr; } } + offsetSoFar += s->size; s++; } assertEqualInt(CloseHandle(handle), 1); @@ -484,10 +498,15 @@ DEFINE_TEST(test_sparse_basic) * on all platform. */ const struct sparse sparse_file0[] = { + // 0 // 1024 { DATA, 1024 }, { HOLE, 2048000 }, + // 2049024 // 2051072 { DATA, 2048 }, { HOLE, 2048000 }, + // 4099072 // 4103168 { DATA, 4096 }, { HOLE, 20480000 }, + // 24583168 // 24591360 { DATA, 8192 }, { HOLE, 204800000 }, + // 229391360 // 229391361 { DATA, 1 }, { END, 0 } }; const struct sparse sparse_file1[] = { Modified: stable/10/contrib/libarchive/libarchive/test/test_write_filter_gzip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_write_filter_gzip.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/test/test_write_filter_gzip.c Sun Aug 5 14:36:12 2018 (r337352) @@ -39,6 +39,7 @@ DEFINE_TEST(test_write_filter_gzip) struct archive* a; char *buff, *data; size_t buffsize, datasize; + unsigned char *rbuff; char path[16]; size_t used1, used2; int i, r, use_prog = 0; @@ -58,6 +59,7 @@ DEFINE_TEST(test_write_filter_gzip) /* * Write a 100 files and read them all back. + * Use default compression level (6). */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -93,6 +95,14 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 0); /* RFC 1952 flag for compression level 6 */ + assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); r = archive_read_support_filter_gzip(a); @@ -116,7 +126,7 @@ DEFINE_TEST(test_write_filter_gzip) /* * Repeat the cycle again, this time setting some compression - * options. + * options. Compression level is 9. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -150,6 +160,14 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 2); /* RFC 1952 flag for compression level 9 */ + /* Curiously, this test fails; the test data above compresses * better at default compression than at level 9. */ /* @@ -181,7 +199,7 @@ DEFINE_TEST(test_write_filter_gzip) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); /* - * Repeat again, with much lower compression. + * Repeat again, with compression level 1 */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); @@ -212,6 +230,14 @@ DEFINE_TEST(test_write_filter_gzip) failure("Compression-level=1 wrote %d bytes; default wrote %d bytes", (int)used2, (int)used1); assert(used2 > used1); + + /* Basic gzip header tests */ + rbuff = (unsigned char *)buff; + assertEqualInt(rbuff[0], 0x1f); + assertEqualInt(rbuff[1], 0x8b); + assertEqualInt(rbuff[2], 0x08); + assertEqualInt(rbuff[3], 0x00); + assertEqualInt(rbuff[8], 4); /* RFC 1952 flag for compression level 1 */ assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); Modified: stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/libarchive/test/test_write_filter_zstd.c Sun Aug 5 14:36:12 2018 (r337352) @@ -125,7 +125,7 @@ DEFINE_TEST(test_write_filter_zstd) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_filter_option(a, NULL, "compression-level", "9")); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_filter_option(a, NULL, "compression-level", "15")); + archive_write_set_filter_option(a, NULL, "compression-level", "6")); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); for (i = 0; i < 100; i++) { sprintf(path, "file%03d", i); @@ -140,7 +140,7 @@ DEFINE_TEST(test_write_filter_zstd) assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); - failure("compression-level=15 wrote %d bytes, default wrote %d bytes", + failure("compression-level=6 wrote %d bytes, default wrote %d bytes", (int)used2, (int)used1); assert(used2 < used1); Modified: stable/10/contrib/libarchive/tar/bsdtar.c ============================================================================== --- stable/10/contrib/libarchive/tar/bsdtar.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/tar/bsdtar.c Sun Aug 5 14:36:12 2018 (r337352) @@ -920,7 +920,7 @@ usage(void) static void version(void) { - printf("bsdtar %s - %s\n", + printf("bsdtar %s - %s \n", BSDTAR_VERSION_STRING, archive_version_details()); exit(0); Copied: stable/10/contrib/libarchive/tar/test/test_option_C_mtree.c (from r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/tar/test/test_option_C_mtree.c Sun Aug 5 14:36:12 2018 (r337352, copy of r336854, head/contrib/libarchive/tar/test/test_option_C_mtree.c) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Arshan Khanifar + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_C_mtree) +{ + char *p0; + size_t s; + int r; + p0 = NULL; + char *content = "./foo type=file uname=root gname=root mode=0755\n"; + char *filename = "output.tar"; + + /* an absolute path to mtree file */ + char *mtree_file = "/METALOG.mtree"; + char *absolute_path = malloc(strlen(testworkdir) + strlen(mtree_file) + 1); + strcpy(absolute_path, testworkdir); + strcat(absolute_path, mtree_file ); + + /* Create an archive using an mtree file. */ + assertMakeFile(absolute_path, 0777, content); + assertMakeDir("bar", 0775); + assertMakeFile("bar/foo", 0777, "abc"); + + r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path); + + failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path); + assertEqualInt(r, 0); + assertEmptyFile("step1.out"); + assertEmptyFile("step1.err"); + + /* Do validation of the constructed archive. */ + + p0 = slurpfile(&s, "output.tar"); + if (!assert(p0 != NULL)) + goto done; + if (!assert(s >= 2048)) + goto done; + assertEqualMem(p0 + 0, "./foo", 5); + assertEqualMem(p0 + 512, "abc", 3); + assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8); + assertEqualMem(p0 + 1536, "\0\0\0\0\0\0\0\0", 8); +done: + free(p0); +} + + Modified: stable/10/contrib/libarchive/tar/test/test_option_fflags.c ============================================================================== --- stable/10/contrib/libarchive/tar/test/test_option_fflags.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/tar/test/test_option_fflags.c Sun Aug 5 14:36:12 2018 (r337352) @@ -25,6 +25,10 @@ #include "test.h" __FBSDID("$FreeBSD$"); +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) +#define chmod _chmod +#endif + static void clear_fflags(const char *pathname) { Modified: stable/10/contrib/libarchive/tar/write.c ============================================================================== --- stable/10/contrib/libarchive/tar/write.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/tar/write.c Sun Aug 5 14:36:12 2018 (r337352) @@ -503,7 +503,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar } set_chdir(bsdtar, arg); } else { - if (*arg != '/' && (arg[0] != '@' || arg[1] != '/')) + if (*arg != '/') do_chdir(bsdtar); /* Handle a deferred -C */ if (*arg == '@') { if (append_archive_filename(bsdtar, a, Modified: stable/10/contrib/libarchive/test_utils/test_main.c ============================================================================== --- stable/10/contrib/libarchive/test_utils/test_main.c Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/contrib/libarchive/test_utils/test_main.c Sun Aug 5 14:36:12 2018 (r337352) @@ -2115,7 +2115,7 @@ void assertVersion(const char *prog, const char *base) int r; char *p, *q; size_t s; - unsigned int prog_len = strlen(base); + size_t prog_len = strlen(base); r = systemf("%s --version >version.stdout 2>version.stderr", prog); if (r != 0) Modified: stable/10/usr.bin/tar/tests/Makefile ============================================================================== --- stable/10/usr.bin/tar/tests/Makefile Sun Aug 5 14:35:30 2018 (r337351) +++ stable/10/usr.bin/tar/tests/Makefile Sun Aug 5 14:36:12 2018 (r337352) @@ -41,6 +41,7 @@ TESTS_SRCS= \ test_help.c \ test_leading_slash.c \ test_missing_file.c \ + test_option_C_mtree.c \ test_option_C_upper.c \ test_option_H_upper.c \ test_option_L_upper.c \ From owner-svn-src-all@freebsd.org Sun Aug 5 15:24:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1471055813 for ; Sun, 5 Aug 2018 15:24:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DC4F92D11 for ; Sun, 5 Aug 2018 15:24:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id d16-v6so10061948itj.0 for ; Sun, 05 Aug 2018 08:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=w1BKI0Y0TtxiNDgyKwS3GABH3mwx8MDkdcR8/sTvRAo95E1VFgQVUt+6MUY9AVmcf+ a7zuD5bAO1rQ+tP0ERRdQQn4IytMPZxlBj3mNHwB5HyDGTrT88jzDnu18DQBoSmhvu0h L0WJRM/j78XFbKasMXj7b83tBiJ26R6GclMmq4QwBznSMG9qz/JGgIBqLtYeJD1hoxVE b9eQPaymas7MMFVlC3P6kHp2KTIp2+Ipk7coh1IZ1QYtRBLrX5YT2tlcS6tNLJWaCZfh BSjZ2Prs0L51xW1ttD1M6xTn91nLNe22stpr3mAmcpNuVTdAun4NN5RDNBflLZnBNMhH XoRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W6oQIsaSXnu27uL398v7l4P22nuEkOpuCRkNX5TCCts=; b=rfer++rqa1pXZr6NuKZwUMACqTKQrGcHnc9TMlu2cqyPFfSWUzhRgzwtYgbYHRwwEC GPs+cDmK48cIhSVOdziVE39YmH6b7mWxHmEFSDTaQfEByZ9P90SpKri6TKEQujbq/mtt EHzKl2nfWGASTYYkAJYm7BfzIRXDtsgvK5BcqHfGLch9/7urlYAGh2WjBGgNqNbUt4wr 9crqx16OtI5cKJJMKbRTisqvutS4H0sBOSWeqRfq0oVIATMHbp7VHEGzKq7azMfRiSPh z3PhBo+BKuwT2PxdU26gCw4lqu+IH+rcyRd8G05wx1OCL73SudQ/9w4WCws9dZm/9e0j vngw== X-Gm-Message-State: AOUpUlGI3ylF5QquDhX6utf6v7vw6oL+ORZW6NoZB0RKJpnf52GGVxQ9 UtVvG/FJhJzDhGlt0h9Ad3zXLvmfChOJipjxHednAQ== X-Google-Smtp-Source: AAOMgpcXns3FsAB3wxipbRw4HXW2sNYHa3RVB1v9rkEG0/oce+PIOgP8DoStgLkbupDpkZtaIRJCLdH5/Nl3PVD2hpA= X-Received: by 2002:a02:3344:: with SMTP id k4-v6mr10291860jak.45.1533482676535; Sun, 05 Aug 2018 08:24:36 -0700 (PDT) MIME-Version: 1.0 References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> In-Reply-To: <1533478958.9860.18.camel@freebsd.org> From: Warner Losh Date: Sun, 5 Aug 2018 16:24:23 +0100 Message-ID: Subject: Re: svn commit: r337334 - head/lib/libc/sys To: Ian Lepore Cc: "Rodney W. Grimes" , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 15:24:38 -0000 On Sun, Aug 5, 2018, 3:22 PM Ian Lepore wrote: > On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: > > On Sat, Aug 4, 2018 at 4:24 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > Author: cem > > > > Date: Sat Aug 4 22:08:24 2018 > > > > New Revision: 337334 > > > > URL: https://svnweb.freebsd.org/changeset/base/337334 > > > > > > > > Log: > > > > settimeofday(2): Remove stale note about timezone > > > > > > > > Contrary to the removed comment, the kernel does appear to use the > > > timezone > > > > > > > > argument of settimeofday. The comment dates to the BSD4.4 import; > I > > > assume it > > > > > > > > is just stale. > > > In what way is the kernel using TZ? It shouldn't be. > > > Or is it using the TZ to adjust the passed in time to UTC/GMT, > > > which I would of thought is done before calling settimeofday. > > > > Specifically, for compatibility, we store minutes west of UTC on > > settimeofday and we retrieve it for settimeofday. Otherwise it's 100% > > unused by anything else at all in the system. Well, technically, we use > it > > for utc_offset, we don't really use that elsewhere (one can find > references > > in utc_offset, but usually we set this via adjkerntz, which is actively > > used in the system). tz_minuteswest likely should just be removed, and > the > > argument to settimzeofday should just be completely ignored. > > > > utc_offset is used by all RTC drivers, and by the convenience routines > that convert times to/from FAT filesystem format (which I assume are > used by FAT filesystem code, but I haven't checked that). So if the tz > info passed to settimeofday() ends up in utc_offset, how can we be sure > nobody is relying on that? > Nobody is setting that. No one else still preserves this info. It was obsoleted in BSD 4.4 with the introduction of the Olsen TZ code. I'd be highly surprised if some set this given we have no rc knob for it. It's completely undocumented. The only code that might use it is IBCS, but even that is doubtful... everybody has transitioned to the documented adjkerntz interface for that stuff. So while in theory someone might, I really doubt it given the history and what other systems are doing. Warner > One could test it with date -t, nothing does that today. That should be > > removed also. Likewise date -d. > > > > So while hyper technically, one could use this, nobody does, nor has > since > > between 4.3 and 4.4 when it was realized that storing the timezone in the > > kernel was a really stupid idea. That's what the language used in the man > > page that you removed was trying to say. > > > > Warner > > > > > > > > > > > > > > > Modified: > > > > head/lib/libc/sys/gettimeofday.2 > > > > > > > > Modified: head/lib/libc/sys/gettimeofday.2 > > > > ============================================================ > > > ================== > > > > > > > > --- head/lib/libc/sys/gettimeofday.2 Sat Aug 4 21:57:17 2018 > > > (r337333) > > > > > > > > +++ head/lib/libc/sys/gettimeofday.2 Sat Aug 4 22:08:24 2018 > > > (r337334) > > > > > > > > @@ -28,7 +28,7 @@ > > > > .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd December 27, 2015 > > > > +.Dd August 4, 2018 > > > > .Dt GETTIMEOFDAY 2 > > > > .Os > > > > .Sh NAME > > > > @@ -44,11 +44,6 @@ > > > > .Ft int > > > > .Fn settimeofday "const struct timeval *tp" "const struct timezone > *tzp" > > > > .Sh DESCRIPTION > > > > -.Bf -symbolic > > > > -Note: timezone is no longer used; this information is kept outside > > > > -the kernel. > > > > -.Ef > > > > -.Pp > > > > The system's notion of the current Greenwich time and the current > time > > > > zone is obtained with the > > > > .Fn gettimeofday > > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > > > From owner-svn-src-all@freebsd.org Sun Aug 5 18:19:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8E710596CA; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9FF97CA0; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4593421C19; Sun, 5 Aug 2018 18:19:41 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75IJfmr077116; Sun, 5 Aug 2018 18:19:41 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75IJfwi077115; Sun, 5 Aug 2018 18:19:41 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051819.w75IJfwi077115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 18:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337353 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 18:19:42 -0000 Author: tsoome Date: Sun Aug 5 18:19:40 2018 New Revision: 337353 URL: https://svnweb.freebsd.org/changeset/base/337353 Log: loader: cstyle cleanup for biosdisk.c Also switch u_int to uint32_t. Also replace "write" by "dowrite". No functional changes intended. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 14:36:12 2018 (r337352) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:19:40 2018 (r337353) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); /* * BIOS disk device handling. - * + * * Ideas and algorithms from: * * - NetBSD libi386/biosdisk.c @@ -50,20 +50,20 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libi386.h" -#define BIOS_NUMDRIVES 0x475 -#define BIOSDISK_SECSIZE 512 -#define BUFSIZE (1 * BIOSDISK_SECSIZE) +#define BIOS_NUMDRIVES 0x475 +#define BIOSDISK_SECSIZE 512 +#define BUFSIZE (1 * BIOSDISK_SECSIZE) -#define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ -#define WDMAJOR 0 /* major numbers for devices we frontend for */ -#define WFDMAJOR 1 -#define FDMAJOR 2 -#define DAMAJOR 4 +#define DT_ATAPI 0x10 /* disk type for ATAPI floppies */ +#define WDMAJOR 0 /* major numbers for devices we frontend for */ +#define WFDMAJOR 1 +#define FDMAJOR 2 +#define DAMAJOR 4 #ifdef DISK_DEBUG -# define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) +#define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else -# define DEBUG(fmt, args...) +#define DEBUG(fmt, args...) #endif /* @@ -164,7 +164,7 @@ bd_init(void) * Check the BIOS equipment list for number * of fixed disks. */ - if(base == 0x80 && + if (base == 0x80 && (nfd >= *(unsigned char *)PTOV(BIOS_NUMDRIVES))) break; #endif @@ -184,7 +184,7 @@ bd_init(void) } } bcache_add_dev(nbdinfo); - return(0); + return (0); } /* @@ -207,7 +207,7 @@ bd_int13probe(struct bdinfo *bd) (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ return (0); /* skip device */ - if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ + if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ ret = 0; /* set error */ /* Convert max cyl # -> # of cylinders */ @@ -318,7 +318,7 @@ bd_print(int verbose) ret = disk_print(&dev, line, verbose); disk_close(&dev); if (ret != 0) - return (ret); + return (ret); } } return (ret); @@ -410,7 +410,7 @@ bd_ioctl(struct open_file *f, u_long cmd, void *data) switch (cmd) { case DIOCGSECTORSIZE: - *(u_int *)data = BD(dev).bd_sectorsize; + *(uint32_t *)data = BD(dev).bd_sectorsize; break; case DIOCGMEDIASIZE: *(uint64_t *)data = BD(dev).bd_sectors * BD(dev).bd_sectorsize; @@ -432,176 +432,182 @@ bd_strategy(void *devdata, int rw, daddr_t dblk, size_ bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, - size, buf, rsize)); + return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, + buf, rsize)); } static int bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize) { - struct disk_devdesc *dev = (struct disk_devdesc *)devdata; - uint64_t disk_blocks; - int blks, rc; + struct disk_devdesc *dev = (struct disk_devdesc *)devdata; + uint64_t disk_blocks; + int blks, rc; #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - char fragbuf[BIOSDISK_SECSIZE]; - size_t fragsize; + char fragbuf[BIOSDISK_SECSIZE]; + size_t fragsize; - fragsize = size % BIOSDISK_SECSIZE; + fragsize = size % BIOSDISK_SECSIZE; #else - if (size % BD(dev).bd_sectorsize) - panic("bd_strategy: %d bytes I/O not multiple of block size", size); + if (size % BD(dev).bd_sectorsize) { + panic("bd_strategy: %d bytes I/O not multiple of block size", + size); + } #endif - DEBUG("open_disk %p", dev); + DEBUG("open_disk %p", dev); - /* - * Check the value of the size argument. We do have quite small - * heap (64MB), but we do not know good upper limit, so we check against - * INT_MAX here. This will also protect us against possible overflows - * while translating block count to bytes. - */ - if (size > INT_MAX) { - DEBUG("too large read: %zu bytes", size); - return (EIO); - } + /* + * Check the value of the size argument. We do have quite small + * heap (64MB), but we do not know good upper limit, so we check against + * INT_MAX here. This will also protect us against possible overflows + * while translating block count to bytes. + */ + if (size > INT_MAX) { + DEBUG("too large read: %zu bytes", size); + return (EIO); + } - blks = size / BD(dev).bd_sectorsize; - if (dblk > dblk + blks) - return (EIO); + blks = size / BD(dev).bd_sectorsize; + if (dblk > dblk + blks) + return (EIO); - if (rsize) - *rsize = 0; + if (rsize) + *rsize = 0; - /* Get disk blocks, this value is either for whole disk or for partition */ - if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { - /* DIOCGMEDIASIZE returns bytes. */ - disk_blocks /= BD(dev).bd_sectorsize; - } else { - /* We should not get here. Just try to survive. */ - disk_blocks = BD(dev).bd_sectors - dev->d_offset; - } + /* + * Get disk blocks, this value is either for whole disk or for + * partition. + */ + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE returns bytes. */ + disk_blocks /= BD(dev).bd_sectorsize; + } else { + /* We should not get here. Just try to survive. */ + disk_blocks = BD(dev).bd_sectors - dev->d_offset; + } - /* Validate source block address. */ - if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) - return (EIO); + /* Validate source block address. */ + if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks) + return (EIO); - /* - * Truncate if we are crossing disk or partition end. - */ - if (dblk + blks >= dev->d_offset + disk_blocks) { - blks = dev->d_offset + disk_blocks - dblk; - size = blks * BD(dev).bd_sectorsize; - DEBUG("short read %d", blks); - } + /* + * Truncate if we are crossing disk or partition end. + */ + if (dblk + blks >= dev->d_offset + disk_blocks) { + blks = dev->d_offset + disk_blocks - dblk; + size = blks * BD(dev).bd_sectorsize; + DEBUG("short read %d", blks); + } - switch (rw & F_MASK) { - case F_READ: - DEBUG("read %d from %lld to %p", blks, dblk, buf); + switch (rw & F_MASK) { + case F_READ: + DEBUG("read %d from %lld to %p", blks, dblk, buf); - if (blks && (rc = bd_read(dev, dblk, blks, buf))) { - /* Filter out floppy controller errors */ - if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { - printf("read %d from %lld to %p, error: 0x%x\n", blks, dblk, - buf, rc); - } - return (EIO); - } + if (blks && (rc = bd_read(dev, dblk, blks, buf))) { + /* Filter out floppy controller errors */ + if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) { + printf("read %d from %lld to %p, error: 0x%x\n", + blks, dblk, buf, rc); + } + return (EIO); + } #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */ - DEBUG("bd_strategy: frag read %d from %d+%d to %p", - fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE)); - if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) { - DEBUG("frag read error"); - return(EIO); - } - bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize); + DEBUG("bd_strategy: frag read %d from %d+%d to %p", + fragsize, dblk, blks, buf + (blks * BIOSDISK_SECSIZE)); + if (fragsize && bd_read(od, dblk + blks, 1, fragsize)) { + DEBUG("frag read error"); + return (EIO); + } + bcopy(fragbuf, buf + (blks * BIOSDISK_SECSIZE), fragsize); #endif - break; - case F_WRITE : - DEBUG("write %d from %lld to %p", blks, dblk, buf); + break; + case F_WRITE : + DEBUG("write %d from %lld to %p", blks, dblk, buf); - if (blks && bd_write(dev, dblk, blks, buf)) { - DEBUG("write error"); - return (EIO); - } + if (blks && bd_write(dev, dblk, blks, buf)) { + DEBUG("write error"); + return (EIO); + } #ifdef BD_SUPPORT_FRAGS - if(fragsize) { - DEBUG("Attempted to write a frag"); - return (EIO); - } + if (fragsize) { + DEBUG("Attempted to write a frag"); + return (EIO); + } #endif - break; - default: - /* DO NOTHING */ - return (EROFS); - } + break; + default: + /* DO NOTHING */ + return (EROFS); + } - if (rsize) - *rsize = size; - return (0); + if (rsize) + *rsize = size; + return (0); } static int bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int write) + int dowrite) { - static struct edd_packet packet; + static struct edd_packet packet; - packet.len = sizeof(struct edd_packet); - packet.count = blks; - packet.off = VTOPOFF(dest); - packet.seg = VTOPSEG(dest); - packet.lba = dblk; - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - if (write) + packet.len = sizeof(struct edd_packet); + packet.count = blks; + packet.off = VTOPOFF(dest); + packet.seg = VTOPSEG(dest); + packet.lba = dblk; + v86.ctl = V86_FLAGS; + v86.addr = 0x13; /* Should we Write with verify ?? 0x4302 ? */ - v86.eax = 0x4300; - else - v86.eax = 0x4200; - v86.edx = BD(dev).bd_unit; - v86.ds = VTOPSEG(&packet); - v86.esi = VTOPOFF(&packet); - v86int(); - if (V86_CY(v86.efl)) - return (v86.eax >> 8); - return (0); + if (dowrite) + v86.eax = 0x4300; + else + v86.eax = 0x4200; + v86.edx = BD(dev).bd_unit; + v86.ds = VTOPSEG(&packet); + v86.esi = VTOPOFF(&packet); + v86int(); + if (V86_CY(v86.efl)) + return (v86.eax >> 8); + return (0); } static int bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, - int write) + int dowrite) { - u_int x, bpc, cyl, hd, sec; + uint32_t x, bpc, cyl, hd, sec; - bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ - x = dblk; - cyl = x / bpc; /* block # / blocks per cylinder */ - x %= bpc; /* block offset into cylinder */ - hd = x / BD(dev).bd_sec; /* offset / blocks per track */ - sec = x % BD(dev).bd_sec; /* offset into track */ + bpc = BD(dev).bd_sec * BD(dev).bd_hds; /* blocks per cylinder */ + x = dblk; + cyl = x / bpc; /* block # / blocks per cylinder */ + x %= bpc; /* block offset into cylinder */ + hd = x / BD(dev).bd_sec; /* offset / blocks per track */ + sec = x % BD(dev).bd_sec; /* offset into track */ - /* correct sector number for 1-based BIOS numbering */ - sec++; + /* correct sector number for 1-based BIOS numbering */ + sec++; - if (cyl > 1023) - /* CHS doesn't support cylinders > 1023. */ - return (1); + if (cyl > 1023) { + /* CHS doesn't support cylinders > 1023. */ + return (1); + } - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - if (write) - v86.eax = 0x300 | blks; - else - v86.eax = 0x200 | blks; - v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; - v86.edx = (hd << 8) | BD(dev).bd_unit; - v86.es = VTOPSEG(dest); - v86.ebx = VTOPOFF(dest); - v86int(); - if (V86_CY(v86.efl)) - return (v86.eax >> 8); - return (0); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + if (dowrite) + v86.eax = 0x300 | blks; + else + v86.eax = 0x200 | blks; + v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; + v86.edx = (hd << 8) | BD(dev).bd_unit; + v86.es = VTOPSEG(dest); + v86.ebx = VTOPOFF(dest); + v86int(); + if (V86_CY(v86.efl)) + return (v86.eax >> 8); + return (0); } static void @@ -614,111 +620,112 @@ bd_io_workaround(struct disk_devdesc *dev) static int -bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write) +bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, + int dowrite) { - u_int x, sec, result, resid, retry, maxfer; - caddr_t p, xp, bbuf; + u_int x, sec, result, resid, retry, maxfer; + caddr_t p, xp, bbuf; - /* Just in case some idiot actually tries to read/write -1 blocks... */ - if (blks < 0) - return (-1); + /* Just in case some idiot actually tries to read/write -1 blocks... */ + if (blks < 0) + return (-1); - resid = blks; - p = dest; + resid = blks; + p = dest; - /* - * Workaround for a problem with some HP ProLiant BIOS failing to work out - * the boot disk after installation. hrs and kuriyama discovered this - * problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and discovered - * that an int13h call seems to cause a buffer overrun in the bios. The - * problem is alleviated by doing an extra read before the buggy read. It - * is not immediately known whether other models are similarly affected. - */ - if (dblk >= 0x100000000) - bd_io_workaround(dev); + /* + * Workaround for a problem with some HP ProLiant BIOS failing to work + * out the boot disk after installation. hrs and kuriyama discovered + * this problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and + * discovered that an int13h call seems to cause a buffer overrun in + * the bios. The problem is alleviated by doing an extra read before + * the buggy read. It is not immediately known whether other models + * are similarly affected. + */ + if (dblk >= 0x100000000) + bd_io_workaround(dev); - /* Decide whether we have to bounce */ - if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && - (VTOP(dest) >> 16) != (VTOP(dest + - blks * BD(dev).bd_sectorsize) >> 16))) { + /* Decide whether we have to bounce */ + if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 && + (VTOP(dest) >> 16) != + (VTOP(dest + blks * BD(dev).bd_sectorsize) >> 16))) { - /* - * There is a 64k physical boundary somewhere in the - * destination buffer, or the destination buffer is above - * first 1MB of physical memory so we have to arrange a - * suitable bounce buffer. Allocate a buffer twice as large - * as we need to. Use the bottom half unless there is a break - * there, in which case we use the top half. - */ - x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; - x = min(x, (unsigned)blks); - bbuf = PTOV(V86_IO_BUFFER); - maxfer = x; /* limit transfers to bounce region size */ - } else { - bbuf = NULL; - maxfer = 0; - } + /* + * There is a 64k physical boundary somewhere in the + * destination buffer, or the destination buffer is above + * first 1MB of physical memory so we have to arrange a + * suitable bounce buffer. Allocate a buffer twice as large + * as we need to. Use the bottom half unless there is a break + * there, in which case we use the top half. + */ + x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize; + x = min(x, (unsigned)blks); + bbuf = PTOV(V86_IO_BUFFER); + maxfer = x; /* limit transfers to bounce region size */ + } else { + bbuf = NULL; + maxfer = 0; + } - while (resid > 0) { - /* - * Play it safe and don't cross track boundaries. - * (XXX this is probably unnecessary) - */ - sec = dblk % BD(dev).bd_sec; /* offset into track */ - x = min(BD(dev).bd_sec - sec, resid); - if (maxfer > 0) - x = min(x, maxfer); /* fit bounce buffer */ + while (resid > 0) { + /* + * Play it safe and don't cross track boundaries. + * (XXX this is probably unnecessary) + */ + sec = dblk % BD(dev).bd_sec; /* offset into track */ + x = min(BD(dev).bd_sec - sec, resid); + if (maxfer > 0) + x = min(x, maxfer); /* fit bounce buffer */ - /* where do we transfer to? */ - xp = bbuf == NULL ? p : bbuf; + /* where do we transfer to? */ + xp = bbuf == NULL ? p : bbuf; - /* - * Put your Data In, Put your Data out, - * Put your Data In, and shake it all about - */ - if (write && bbuf != NULL) - bcopy(p, bbuf, x * BD(dev).bd_sectorsize); + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + if (dowrite && bbuf != NULL) + bcopy(p, bbuf, x * BD(dev).bd_sectorsize); - /* - * Loop retrying the operation a couple of times. The BIOS - * may also retry. - */ - for (retry = 0; retry < 3; retry++) { - /* if retrying, reset the drive */ - if (retry > 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; - v86.edx = BD(dev).bd_unit; - v86int(); - } + /* + * Loop retrying the operation a couple of times. The BIOS + * may also retry. + */ + for (retry = 0; retry < 3; retry++) { + /* if retrying, reset the drive */ + if (retry > 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0; + v86.edx = BD(dev).bd_unit; + v86int(); + } - if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, write); - else - result = bd_chs_io(dev, dblk, x, xp, write); - if (result == 0) - break; - } + if (BD(dev).bd_flags & BD_MODEEDD1) + result = bd_edd_io(dev, dblk, x, xp, write); + else + result = bd_chs_io(dev, dblk, x, xp, write); + if (result == 0) + break; + } - if (write) - DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, - p, VTOP(p), dblk, result ? "failed" : "ok"); - else - DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, - dblk, p, VTOP(p), result ? "failed" : "ok"); - if (result) { - return (result); + if (dowrite) + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); + else + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); + if (result) { + return (result); + } + if (!dowrite && bbuf != NULL) + bcopy(bbuf, p, x * BD(dev).bd_sectorsize); + p += (x * BD(dev).bd_sectorsize); + dblk += x; + resid -= x; } - if (!write && bbuf != NULL) - bcopy(bbuf, p, x * BD(dev).bd_sectorsize); - p += (x * BD(dev).bd_sectorsize); - dblk += x; - resid -= x; - } -/* hexdump(dest, (blks * BD(dev).bd_sectorsize)); */ - return(0); + return (0); } static int @@ -753,15 +760,15 @@ uint32_t bd_getbigeom(int bunit) { - v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; - v86.edx = 0x80 + bunit; - v86int(); - if (V86_CY(v86.efl)) - return 0x4f010f; - return ((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) | - (v86.edx & 0xff00) | (v86.ecx & 0x3f); + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x800; + v86.edx = 0x80 + bunit; + v86int(); + if (V86_CY(v86.efl)) + return (0x4f010f); + return (((v86.ecx & 0xc0) << 18) | ((v86.ecx & 0xff00) << 8) | + (v86.edx & 0xff00) | (v86.ecx & 0x3f)); } /* @@ -773,49 +780,49 @@ bd_getbigeom(int bunit) int bd_getdev(struct i386_devdesc *d) { - struct disk_devdesc *dev; - int biosdev; - int major; - int rootdev; - char *nip, *cp; - int i, unit; + struct disk_devdesc *dev; + int biosdev; + int major; + int rootdev; + char *nip, *cp; + int i, unit; - dev = (struct disk_devdesc *)d; - biosdev = bd_unit2bios(dev->dd.d_unit); - DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); - if (biosdev == -1) /* not a BIOS device */ - return(-1); - if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, - BD(dev).bd_sectorsize) != 0) /* oops, not a viable device */ - return (-1); - else - disk_close(dev); + dev = (struct disk_devdesc *)d; + biosdev = bd_unit2bios(dev->dd.d_unit); + DEBUG("unit %d BIOS device %d", dev->dd.d_unit, biosdev); + if (biosdev == -1) /* not a BIOS device */ + return (-1); + if (disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, + BD(dev).bd_sectorsize) != 0) /* oops, not a viable device */ + return (-1); + else + disk_close(dev); - if (biosdev < 0x80) { - /* floppy (or emulated floppy) or ATAPI device */ - if (bdinfo[dev->dd.d_unit].bd_type == DT_ATAPI) { - /* is an ATAPI disk */ - major = WFDMAJOR; + if (biosdev < 0x80) { + /* floppy (or emulated floppy) or ATAPI device */ + if (bdinfo[dev->dd.d_unit].bd_type == DT_ATAPI) { + /* is an ATAPI disk */ + major = WFDMAJOR; + } else { + /* is a floppy disk */ + major = FDMAJOR; + } } else { - /* is a floppy disk */ - major = FDMAJOR; + /* assume an IDE disk */ + major = WDMAJOR; } - } else { - /* assume an IDE disk */ - major = WDMAJOR; - } - /* default root disk unit number */ - unit = biosdev & 0x7f; + /* default root disk unit number */ + unit = biosdev & 0x7f; - /* XXX a better kludge to set the root disk unit number */ - if ((nip = getenv("root_disk_unit")) != NULL) { - i = strtol(nip, &cp, 0); - /* check for parse error */ - if ((cp != nip) && (*cp == 0)) - unit = i; - } + /* XXX a better kludge to set the root disk unit number */ + if ((nip = getenv("root_disk_unit")) != NULL) { + i = strtol(nip, &cp, 0); + /* check for parse error */ + if ((cp != nip) && (*cp == 0)) + unit = i; + } - rootdev = MAKEBOOTDEV(major, dev->d_slice + 1, unit, dev->d_partition); - DEBUG("dev is 0x%x\n", rootdev); - return(rootdev); + rootdev = MAKEBOOTDEV(major, dev->d_slice + 1, unit, dev->d_partition); + DEBUG("dev is 0x%x\n", rootdev); + return (rootdev); } From owner-svn-src-all@freebsd.org Sun Aug 5 18:24:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58AE310598EC; Sun, 5 Aug 2018 18:24:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F399470088; Sun, 5 Aug 2018 18:24:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C55EA21DBD; Sun, 5 Aug 2018 18:24:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75IOZ74082352; Sun, 5 Aug 2018 18:24:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75IOZhZ082351; Sun, 5 Aug 2018 18:24:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051824.w75IOZhZ082351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 18:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337354 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 18:24:36 -0000 Author: tsoome Date: Sun Aug 5 18:24:35 2018 New Revision: 337354 URL: https://svnweb.freebsd.org/changeset/base/337354 Log: loader: 337353 did miss to rename 2 write instances 2 write instances got somehow missed. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:19:40 2018 (r337353) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:24:35 2018 (r337354) @@ -702,9 +702,9 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks } if (BD(dev).bd_flags & BD_MODEEDD1) - result = bd_edd_io(dev, dblk, x, xp, write); + result = bd_edd_io(dev, dblk, x, xp, dowrite); else - result = bd_chs_io(dev, dblk, x, xp, write); + result = bd_chs_io(dev, dblk, x, xp, dowrite); if (result == 0) break; } From owner-svn-src-all@freebsd.org Sun Aug 5 19:17:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C42F105B150; Sun, 5 Aug 2018 19:17:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B967389F; Sun, 5 Aug 2018 19:17:08 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D51E0225E2; Sun, 5 Aug 2018 19:17:07 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75JH7ht012781; Sun, 5 Aug 2018 19:17:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75JH706012780; Sun, 5 Aug 2018 19:17:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808051917.w75JH706012780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 5 Aug 2018 19:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337356 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 19:17:08 -0000 Author: tsoome Date: Sun Aug 5 19:17:07 2018 New Revision: 337356 URL: https://svnweb.freebsd.org/changeset/base/337356 Log: loader: bd_open() should cleanup from disk_open() error Since bd_open() does early increment for reference counter and bcache allocation, it also should undo those in case of the error. Also remove unused variables rdev, g_err. Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Aug 5 18:27:36 2018 (r337355) +++ head/stand/i386/libi386/biosdisk.c Sun Aug 5 19:17:07 2018 (r337356) @@ -337,11 +337,11 @@ bd_print(int verbose) static int bd_open(struct open_file *f, ...) { - struct disk_devdesc *dev, rdev; + struct disk_devdesc *dev; struct disk_devdesc disk; - int err, g_err; va_list ap; uint64_t size; + int rc; va_start(ap, f); dev = va_arg(ap, struct disk_devdesc *); @@ -365,6 +365,7 @@ bd_open(struct open_file *f, ...) disk.d_slice = -1; disk.d_partition = -1; disk.d_offset = 0; + if (disk_open(&disk, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize) == 0) { @@ -376,10 +377,17 @@ bd_open(struct open_file *f, ...) disk_close(&disk); } - err = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, + rc = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize, BD(dev).bd_sectorsize); + if (rc != 0) { + BD(dev).bd_open--; + if (BD(dev).bd_open == 0) { + bcache_free(BD(dev).bd_bcache); + BD(dev).bd_bcache = NULL; + } + } - return (err); + return (rc); } static int From owner-svn-src-all@freebsd.org Sun Aug 5 19:21:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FC40105B4D4; Sun, 5 Aug 2018 19:21:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C28AC73CB0; Sun, 5 Aug 2018 19:21:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A37072264D; Sun, 5 Aug 2018 19:21:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75JLpEN014550; Sun, 5 Aug 2018 19:21:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75JLpvQ014548; Sun, 5 Aug 2018 19:21:51 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808051921.w75JLpvQ014548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 19:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337357 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 337357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 19:21:52 -0000 Author: rmacklem Date: Sun Aug 5 19:21:50 2018 New Revision: 337357 URL: https://svnweb.freebsd.org/changeset/base/337357 Log: Copy all bits of a file handle in case there is padding in the structure. At least on x86, fhandle_t is a packed structure, so I believe an assignment will copy all the bits. However, for some current/future architectures, there might be padding in the structure that doesn't get copied via an assignment. Since NFS assumes a file handle is an opaque blob of bits that can be compared via memcmp()/bcmp(), all the bits including any padding must be copied. This patch replaces the assignments with a call to a byte copy function. Spotted during code inspection. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Aug 5 19:17:07 2018 (r337356) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Aug 5 19:21:50 2018 (r337357) @@ -3954,7 +3954,7 @@ nfsrv_pnfscreate(struct vnode *vp, struct vattr *vap, tdsc->p = p; tdsc->pf = tpf; tdsc->createva = *vap; - tdsc->fh = fh; + NFSBCOPY(&fh, &tdsc->fh, sizeof(fh)); tdsc->va = va; tdsc->dvp = dvp[i]; tdsc->done = 0; @@ -5014,7 +5014,7 @@ nfsrv_writedsrpc(fhandle_t *fhp, off_t off, int len, s error = 0; for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->off = off; tdrpc->len = len; tdrpc->nmp = *nmpp; @@ -5200,7 +5200,7 @@ nfsrv_setattrdsrpc(fhandle_t *fhp, struct ucred *cred, for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; tdrpc->inprog = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->nmp = *nmpp; tdrpc->vp = vp; tdrpc->cred = cred; @@ -5348,7 +5348,7 @@ nfsrv_setacldsrpc(fhandle_t *fhp, struct ucred *cred, for (i = 0; i < mirrorcnt - 1; i++, tdrpc++) { tdrpc->done = 0; tdrpc->inprog = 0; - tdrpc->fh = *fhp; + NFSBCOPY(fhp, &tdrpc->fh, sizeof(*fhp)); tdrpc->nmp = *nmpp; tdrpc->vp = vp; tdrpc->cred = cred; Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 5 19:17:07 2018 (r337356) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Aug 5 19:21:50 2018 (r337357) @@ -6907,7 +6907,7 @@ nfsrv_recalloldlayout(NFSPROC_T *p) lyp->lay_stateid.seqid = 1; clientid = lyp->lay_clientid; stateid = lyp->lay_stateid; - fh = lyp->lay_fh; + NFSBCOPY(&lyp->lay_fh, &fh, sizeof(fh)); laytype = lyp->lay_type; break; } From owner-svn-src-all@freebsd.org Sun Aug 5 20:14:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D7E105CB22; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 376A675F0F; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1880C22F82; Sun, 5 Aug 2018 20:14:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KE866044277; Sun, 5 Aug 2018 20:14:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KE8Pu044276; Sun, 5 Aug 2018 20:14:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052014.w75KE8Pu044276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337360 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 20:14:08 -0000 Author: rmacklem Date: Sun Aug 5 20:14:07 2018 New Revision: 337360 URL: https://svnweb.freebsd.org/changeset/base/337360 Log: Add a man page that describes the setup of a pNFS service. This is a content change. Added: head/usr.sbin/nfsd/pnfsserver.4 (contents, props changed) Added: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/nfsd/pnfsserver.4 Sun Aug 5 20:14:07 2018 (r337360) @@ -0,0 +1,405 @@ +.\" Copyright (c) 2018 Rick Macklem +.\" +.\" 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 August 5, 2018 +.Dt PNFSSERVER 4 +.Os +.Sh NAME +.Nm pNFSserver +.Nd NFS Version 4.1 Parallel NFS Protocol Server +.Sh DESCRIPTION +A set of FreeBSD servers may be configured to provide a +.Xr pnfs 4 +service. +One FreeBSD system needs to be configured as a MetaData Server (MDS) and +at least one additional FreeBSD system needs to be configured as one or +more Data Servers (DS)s. +.Pp +These FreeBSD systems are configured to be NFSv4.1 servers, see +.Xr nfsd 8 +and +.Xr exports 5 +if you are not familiar with configuring a NFSv4.1 server. +.Sh DS server configuration +The DS(s) need to be configured as NFSv4.1 server(s), with a top level exported +directory used for storage of data files. +This directory must be owned by +.Dq root +and would normally have a mode of +.Dq 700 . +Within this directory there needs to be additional directories named +ds0,...,dsN (where N is 19 by default) also owned by +.Dq root +with mode +.Dq 700 . +These are the directories where the data files are stored. +The following command can be run by root when in the top level exported +directory to create these subdirectories. +.Bd -literal -offset indent +jot -w ds 20 0 | xargs mkdir -m 700 +.Ed +.sp +Note that +.Dq 20 +is the default and can be set to a larger value on the MDS as shown below. +.sp +The top level exported directory used for storage of data files must be +exported to the MDS with the +.Dq maproot=root sec=sys +export options so that the MDS can create entries in these subdirectories. +It must also be exported to all pNFS aware clients, but these clients do +not require the +.Dq maproot=root +export option and this directory should be exported to them with the same +options as used by the MDS to export file system(s) to the clients. +.Pp +It is possible to have multiple DSs on the same FreeBSD system, but each +of these DSs must have a separate top level exported directory used for storage +of data files and each +of these DSs must be mountable via a separate IP address. +Alias addresses can be set on the DS server system for a network +interface via +.Xr ifconfig 8 +to create these different IP addresses. +Multiple DSs on the same server may be useful when data for different file systems +on the MDS are being stored on different file system volumes on the FreeBSD +DS system. +.Sh MDS server configuration +The MDS must be a separate FreeBSD system from the FreeBSD DS system(s) and +NFS clients. +It is configured as a NFSv4.1 server with file system(s) exported to +clients. +However, the +.Dq -p +command line argument for +.Xr nfsd +is used to indicate that it is running as the MDS for a pNFS server. +.Pp +The DS(s) must all be mounted on the MDS using the following mount options: +.Bd -literal -offset indent +nfsv4,minorversion=1,soft,retrans=2 +.Ed +.sp +so that they can be defined as DSs in the +.Dq -p +option. +Normally these mounts would be entered in the +.Xr fstab 5 +on the MDS. +For example, if there are four DSs named nfsv4-data[0-3], the +.Xr fstab 5 +lines might look like: +.Bd -literal -offset +nfsv4-data0:/ /data0 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data1:/ /data1 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data2:/ /data2 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data3:/ /data3 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +.Ed +.sp +The +.Xr nfsd 8 +command line option +.Dq -p +indicates that the NFS server is a pNFS MDS and specifies what +DSs are to be used. +.br +For the above +.Xr fstab 5 +example, the +.Xr nfsd 8 +nfs_server_flags line in your +.Xr rc.conf 5 +might look like: +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0,nfsv4-data1:/data1,nfsv4-data2:/data2,nfsv4-data3:/data3" +.Ed +.sp +This example specifies that the data files should be distributed over the +four DSs and File layouts will be issued to pNFS enabled clients. +If issuing Flexible File layouts is desired for this case, setting the sysctl +.Dq vfs.nfsd.default_flexfile +non-zero in your +.Xr sysctl.conf 5 +file will make the +.Nm +do that. +.br +Alternately, this variant of +.Dq nfs_server_flags +will specify that two way mirroring is to be done, via the +.Dq -m +command line option. +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0,nfsv4-data1:/data1,nfsv4-data2:/data2,nfsv4-data3:/data3 -m 2" +.Ed +.sp +With two way mirroring, the data file for each exported file on the MDS +will be stored on two of the DSs. +When mirroring is enabled, the server will always issue Flexible File layouts. +.Pp +It is also possible to specify which DSs are to be used to store data files for +specific exported file systems on the MDS. +For example, if the MDS has exported two file systems +.Dq /export1 +and +.Dq /export2 +to clients, the following variant of +.Dq nfs_server_flags +will specify that data files for +.Dq /export1 +will be stored on nfsv4-data0 and nfsv4-data1, whereas the data files for +.Dq /export2 +will be store on nfsv4-data2 and nfsv4-data3. +.Bd -literal -offset +nfs_server_flags="-u -t -n 128 -p nfsv4-data0:/data0#/export1,nfsv4-data1:/data1#/export1,nfsv4-data2:/data2#/export2,nfsv4-data3:/data3#/export2" +.Ed +.sp +This can be used by system administrators to control where data files are +stored and might be useful for control of storage use. +For this case, it may be convenient to co-locate more than one of the DSs +on the same FreeBSD server, using separate file systems on the DS system +for storage of the respective DS's data files. +If mirroring is desired for this case, the +.Dq -m +option also needs to be specified. +There must be enough DSs assigned to each exported file system on the MDS +to support the level of mirroring. +The above example would be fine for two way mirroring, but four way mirroring +would not work, since there are only two DSs assigned to each exported file +system on the MDS. +.Pp +The number of subdirectories in each DS is defined by the +.Dq vfs.nfs.dsdirsize +sysctl on the MDS. +This value can be increased from the default of 20, but only when the +.Xr nfsd 8 +is not running and after the additional ds20,... subdirectories have been +created on all the DSs. +For a service that will store a large number of files this sysctl should be +set much larger, to avoid the number of entries in a subdirectory from +getting too large. +.Sh Client mounts +Once operational, NFSv4.1 FreeBSD client mounts done with the +.Dq pnfs +option should do I/O directly on the DSs. +The clients mounting the MDS must be running the +.Xr nfscbd +daemon for pNFS to work. +Set +.Bd -literal -offset indent +nfscbd_enable="YES" +.Ed +.sp +in the +.Xr rc.conf 5 +on these clients. +Non-pNFS aware clients or NFSv3 mounts will do all I/O RPCs on the MDS, +which acts as a proxy for the appropriate DS(s). +.Sh Backing up a pNFS service +Since the data is separated from the metadata, the simple way to back up +a pNFS service is to do so from an NFS client that has the service mounted +on it. +If you back up the MDS exported file system(s) on the MDS, you must do it +in such a way that the +.Dq system +namespace extended attributes get backed up. +.Sh Handling of failed mirrored DSs +When a mirrored DS fails, it can be disabled one of three ways: +.sp +1 - The MDS detects a problem when trying to do proxy +operations on the DS. +This can take a couple of minutes +after the DS failure or network partitioning occurs. +.sp +2 - A pNFS client can report an I/O error that occurred for a DS to the MDS in +the arguments for a LayoutReturn operation. +.sp +3 - The system administrator can perform the pnfsdskill(8) command on the MDS +to disable it. If the system administrator does a pnfsdskill(8) and it fails +with ENXIO (Device not configured) that normally means the DS was already +disabled via #1 or #2. Since doing this is harmless, once a system +administrator knows that there is a problem with a mirrored DS, doing the +command is recommended. +.sp +Once a system administrator knows that a mirrored DS has malfunctioned +or has been network partitioned, they should do the following as root/su +on the MDS: +.Bd -literal -offset indent +# pnfsdskill +# umount -N +.Ed +.sp +Note that the must be the exact mounted-on path +string used when the DS was mounted on the MDS. +.Pp +Once the mirrored DS has been disabled, the pNFS service should continue to +function, but file updates will only happen on the DS(s) +that have not been disabled. Assuming two way mirroring, that implies +the one DS of the pair stored in the +.Dq pnfsd.dsfile +extended attribute for the file on the MDS, for files stored on the disabled DS. +.Pp +The next step is to clear the IP address in the +.Dq pnfsd.dsfile +extended attribute on all files on the MDS for the failed DS. +This is done so that, when the disabled DS is repaired and brought back online, +the data files on this DS will not be used, since they may be out of date. +The command that clears the IP address is +.Xr pnfsdsfile 8 +with the +.Dq -r +option. +.Bd -literal -offset +For example: +# pnfsdsfile -r nfsv4-data3 yyy.c +yyy.c: nfsv4-data2.home.rick ds0/207508569ff983350c000000ec7c0200e4c57b2e0000000000000000 0.0.0.0 ds0/207508569ff983350c000000ec7c0200e4c57b2e0000000000000000 +.Ed +.sp +replaces nfsv4-data3 with an IPv4 address of 0.0.0.0, so that nfsv4-data3 +will not get used. +.Pp +Normally this will be called within a +.Xr find 1 +command for all regular +files in the exported directory tree and must be done on the MDS. +When used with +.Xr find 1 , +you will probably also want the +.Dq -q +option so that it won't spit out the results for every file. +If the disabled/repaired DS is nfsv4-data3, the commands done on the MDS +would be: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile -q -r nfsv4-data3 {} \; +.Ed +.sp +There is a problem with the above command if the file found by +.Xr find 1 +is renamed or unlinked before the +.Xr pnfsdsfile 8 +command is done on it. +This should normally generate an error message. +A simple unlink is harmless +but a link/unlink or rename might result in the file not having been processed +under its new name. +To check that all files have their IP addresses set to 0.0.0.0 these +commands can be used (assuming the +.Xr sh 1 +shell): +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile {} \; | sed "/nfsv4-data3/!d" +.Ed +.sp +Any line(s) printed require the +.Xr pnfsdsfile 8 +with +.Dq -r +to be done again. +Once this is done, the replaced/repaired DS can be brought back online. +It should have empty ds0,...,dsN directories under the top level exported +directory for storage of data files just like it did when first set up. +Mount it on the MDS exactly as you did before disabling it. +For the nfsv4-data3 example, the command would be: +.Bd -literal -offset +# mount -t nfs -o nfsv4,minorversion=1,soft,retrans=2 nfsv4-data3:/ /data3 +.Ed +.sp +Then restart the nfsd to re-enable the DS. +.Bd -literal -offset +# /etc/rc.d/nfsd restart +.Ed +.sp +Now, new files can be stored on nfsv4-data3, +but files with the IP address zeroed out on the MDS will not yet use the +repaired DS (nfsv4-data3). +The next step is to go through the exported file tree on the MDS and, +for each of the +files with an IPv4 address of 0.0.0.0 in its extended attribute, copy the file +data to the repaired DS and re-enable use of this mirror for it. +This command for copying the file data for one MDS file is +.Xr pnfsdscopymr 8 +and it will also normally be used in a +.Xr find 1 . +For the example case, the commands on the MDS would be: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdscopymr -r /data3 {} \; +.Ed +.sp +When this completes, the recovery should be complete or at least nearly so. +As noted above, if a link/unlink or rename occurs on a file name while the +above +.Xr find 1 +is in progress, it may not get copied. +To check for any file(s) not yet copied, the commands are: +.Bd -literal -offset +# cd +# find . -type f -exec pnfsdsfile {} \; | sed "/0\.0\.0\.0/!d" +.Ed +.sp +If this command prints out any file name(s), these files must +have the +.Xr pnfsdscopymr 8 +command done on them to complete the recovery. +.Bd -literal -offset +# pnfsdscopymr -r /data3 +.Ed +.sp +All of these commands are designed to be +done while the pNFS service is running and can be re-run safely. +.Pp +For a more detailed discussion of the setup and management of a pNFS service +see: +.Bd -literal -offset indent +http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt +.Ed +.sp +.Sh SEE ALSO +.Xr nfsv4 4 , +.Xr pnfs 4 , +.Xr exports 5 , +.Xr fstab 5 , +.Xr rc.conf 5 , +.Xr sysctl.conf 5 , +.Xr nfscbd 8 , +.Xr nfsd 8 , +.Xr nfsuserd 8 , +.Xr pnfsdscopymr 8 , +.Xr pnfsdsfile 8 , +.Xr pnfsdskill 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 12.0 . +.Sh BUGS +Since the MDS cannot be mirrored, it is a single point of failure just +as a non +.Tn pNFS +server is. +For non-mirrored configurations, all FreeBSD systems used in the service +are single points of failure. From owner-svn-src-all@freebsd.org Sun Aug 5 20:15:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5424105CBE0; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC347607D; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4671F22F83; Sun, 5 Aug 2018 20:15:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KFYck044383; Sun, 5 Aug 2018 20:15:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KFYIR044382; Sun, 5 Aug 2018 20:15:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052015.w75KFYIR044382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337361 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 20:15:34 -0000 Author: rmacklem Date: Sun Aug 5 20:15:33 2018 New Revision: 337361 URL: https://svnweb.freebsd.org/changeset/base/337361 Log: Add pnfsserver.4 to the Makefile for nfsd. Modified: head/usr.sbin/nfsd/Makefile Modified: head/usr.sbin/nfsd/Makefile ============================================================================== --- head/usr.sbin/nfsd/Makefile Sun Aug 5 20:14:07 2018 (r337360) +++ head/usr.sbin/nfsd/Makefile Sun Aug 5 20:15:33 2018 (r337361) @@ -2,6 +2,6 @@ # $FreeBSD$ PROG= nfsd -MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 +MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 pnfsserver.4 .include From owner-svn-src-all@freebsd.org Sun Aug 5 20:20:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DB7105CD46; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 561B076258; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3357622FA0; Sun, 5 Aug 2018 20:20:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KK5eT044625; Sun, 5 Aug 2018 20:20:05 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KK5pJ044624; Sun, 5 Aug 2018 20:20:05 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052020.w75KK5pJ044624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337362 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 20:20:05 -0000 Author: rmacklem Date: Sun Aug 5 20:20:04 2018 New Revision: 337362 URL: https://svnweb.freebsd.org/changeset/base/337362 Log: Update the pnfs.4 man page to reference the pnfsserver.4 man page. This is a content change. Modified: head/usr.sbin/nfsd/pnfs.4 Modified: head/usr.sbin/nfsd/pnfs.4 ============================================================================== --- head/usr.sbin/nfsd/pnfs.4 Sun Aug 5 20:15:33 2018 (r337361) +++ head/usr.sbin/nfsd/pnfs.4 Sun Aug 5 20:20:04 2018 (r337362) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2018 +.Dd August 5, 2018 .Dt PNFS 4 .Os .Sh NAME @@ -159,13 +159,11 @@ After a disabled mirrored DS is repaired, it is possib as a mirror while the pNFS service continues to function. .Pp See -.Bd -literal -offset indent -http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt -.Ed -.sp +.Xr pnfsserver 4 for information on how to set up a FreeBSD pNFS service. .Sh SEE ALSO .Xr nfsv4 4 , +.Xr pnfsserver 4 , .Xr exports 5 , .Xr fstab 5 , .Xr rc.conf 5 , From owner-svn-src-all@freebsd.org Sun Aug 5 20:36:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B407105D3F6; Sun, 5 Aug 2018 20:36:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05F9376BE7; Sun, 5 Aug 2018 20:36:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0820232B8; Sun, 5 Aug 2018 20:36:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75KamvC054484; Sun, 5 Aug 2018 20:36:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75KamDs054483; Sun, 5 Aug 2018 20:36:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808052036.w75KamDs054483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Aug 2018 20:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337363 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 20:36:49 -0000 Author: rmacklem Date: Sun Aug 5 20:36:48 2018 New Revision: 337363 URL: https://svnweb.freebsd.org/changeset/base/337363 Log: Add a reference to pnfsserver.4 to the nfsd.8 man page. This is a content change. Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sun Aug 5 20:20:04 2018 (r337362) +++ head/usr.sbin/nfsd/nfsd.8 Sun Aug 5 20:36:48 2018 (r337363) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd July 27, 2018 +.Dd August 5, 2018 .Dt NFSD 8 .Os .Sh NAME @@ -313,6 +313,7 @@ just do a .Xr nfssvc 2 , .Xr nfsv4 4 , .Xr pnfs 4 , +.Xr pnfsserver 4 , .Xr exports 5 , .Xr stablerestart 5 , .Xr gssd 8 , From owner-svn-src-all@freebsd.org Sun Aug 5 22:24:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABA84106090D; Sun, 5 Aug 2018 22:24:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 622B17AEE7; Sun, 5 Aug 2018 22:24:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26C512445F; Sun, 5 Aug 2018 22:24:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w75MOdO0011123; Sun, 5 Aug 2018 22:24:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w75MOcw1011122; Sun, 5 Aug 2018 22:24:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201808052224.w75MOcw1011122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 5 Aug 2018 22:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337364 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 337364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 22:24:39 -0000 Author: ian Date: Sun Aug 5 22:24:38 2018 New Revision: 337364 URL: https://svnweb.freebsd.org/changeset/base/337364 Log: Document 64-bit arm in terms of arch name (aarch64) not machine (arm64). Other architectures are documented in terms of the name that is displayed by 'uname -p', aka MACHINE_ARCH and TARGET_ARCH in the build system, now aarch64 matches the rest of them. PR: 220297 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sun Aug 5 20:36:48 2018 (r337363) +++ head/share/man/man7/arch.7 Sun Aug 5 22:24:38 2018 (r337364) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2018 +.Dd August 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -90,13 +90,13 @@ architectures, the final release. .Pp .Bl -column -offset indent "Sy Architecture" "Sy Initial Release" "Sy Final Release" .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release +.It aarch64 Ta 11.0 .It alpha Ta 3.2 Ta 6.4 .It amd64 Ta 5.1 .It arm Ta 6.0 .It armeb Ta 8.0 Ta 11.x .It armv6 Ta 10.0 .It armv7 Ta 12.0 -.It arm64 Ta 11.0 .It ia64 Ta 5.0 Ta 10.x .It i386 Ta 1.0 .It mips Ta 8.0 @@ -162,7 +162,7 @@ Examples are: .It Dv powerpc64 Ta Dv powerpc .It Dv mips64* Ta Dv mips* .El -.Dv arm64 +.Dv aarch64 currently does not support execution of .Dv armv6 or @@ -191,10 +191,10 @@ require only 4-byte alignment for 64-bit integers. Machine-dependent type sizes: .Bl -column -offset indent "Sy Architecture" "Sy void *" "Sy long double" "Sy time_t" .It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t +.It aarch64 Ta 8 Ta 16 Ta 8 .It amd64 Ta 8 Ta 16 Ta 8 .It arm Ta 4 Ta 8 Ta 8 .It armv6 Ta 4 Ta 8 Ta 8 -.It arm64 Ta 8 Ta 16 Ta 8 .It i386 Ta 4 Ta 12 Ta 4 .It mips Ta 4 Ta 8 Ta 8 .It mipsel Ta 4 Ta 8 Ta 8 @@ -218,11 +218,11 @@ is 8 bytes on all supported architectures except i386. .Ss Endianness and Char Signedness .Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness" .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness +.It aarch64 Ta little Ta unsigned .It amd64 Ta little Ta signed .It arm Ta little Ta unsigned .It armv6 Ta little Ta unsigned .It armv7 Ta little Ta unsigned -.It arm64 Ta little Ta unsigned .It i386 Ta little Ta signed .It mips Ta big Ta signed .It mipsel Ta little Ta signed @@ -243,11 +243,11 @@ is 8 bytes on all supported architectures except i386. .Ss Page Size .Bl -column -offset indent "Sy Architecture" "Sy Page Sizes" .It Sy Architecture Ta Sy Page Sizes +.It aarch64 Ta 4K, 2M, 1G .It amd64 Ta 4K, 2M, 1G .It arm Ta 4K .It armv6 Ta 4K, 1M .It armv7 Ta 4K, 1M -.It arm64 Ta 4K, 2M, 1G .It i386 Ta 4K, 2M (PAE), 4M .It mips Ta 4K .It mipsel Ta 4K @@ -268,11 +268,11 @@ is 8 bytes on all supported architectures except i386. .Ss Floating Point .Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long double" .It Sy Architecture Ta Sy float, double Ta Sy long double +.It aarch64 Ta hard Ta soft, quad precision .It amd64 Ta hard Ta hard, 80 bit .It arm Ta soft Ta soft, double precision .It armv6 Ta hard(1) Ta hard, double precision .It armv7 Ta hard(1) Ta hard, double precision -.It arm64 Ta hard Ta soft, quad precision .It i386 Ta hard Ta hard, 80 bit .It mips Ta soft Ta identical to double .It mipsel Ta soft Ta identical to double @@ -320,11 +320,11 @@ is not used on Architecture-specific macros: .Bl -column -offset indent "Sy Architecture" "Sy Predefined macros" .It Sy Architecture Ta Sy Predefined macros +.It aarch64 Ta Dv __aarch64__ .It amd64 Ta Dv __amd64__, Dv __x86_64__ .It arm Ta Dv __arm__ .It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6 .It armv7 Ta Dv __arm__, Dv __ARM_ARCH >= 7 -.It arm64 Ta Dv __aarch64__ .It i386 Ta Dv __i386__ .It mips Ta Dv __mips__, Dv __MIPSEB__, Dv __mips_o32 .It mipsel Ta Dv __mips__, Dv __mips_o32 From owner-svn-src-all@freebsd.org Sun Aug 5 22:34:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF8ED1060CAA; Sun, 5 Aug 2018 22:34:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 055037B57F; Sun, 5 Aug 2018 22:34:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 4DDFC1A2061; Mon, 6 Aug 2018 08:33:58 +1000 (AEST) Date: Mon, 6 Aug 2018 08:33:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Warner Losh , "Rodney W. Grimes" , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <1533478958.9860.18.camel@freebsd.org> Message-ID: <20180806074507.E920@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6p4G4DjUgR1eRvsjZpAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2018 22:34:08 -0000 On Sun, 5 Aug 2018, Ian Lepore wrote: > On Sat, 2018-08-04 at 16:39 -0600, Warner Losh wrote: >>> [Context lost to corruption of spaces} >> >> Specifically, for compatibility, we store minutes west of UTC on >> settimeofday and we retrieve it for settimeofday. Otherwise it's 100% >> unused by anything else at all in the system. Well, technically, we use it >> for utc_offset, we don't really use that elsewhere (one can find references >> in utc_offset, but usually we set this via adjkerntz, which is actively >> used in the system). tz_minuteswest likely should just be removed, and the >> argument to settimzeofday should just be completely ignored. I already described how adjkerntz sets both tz_minuteswest and other more cryptic variables used in utc_offset(). > utc_offset is used by all RTC drivers, and by the convenience routines > that convert times to/from FAT filesystem format (which I assume are > used by FAT filesystem code, but I haven't checked that). So if the tz > info passed to settimeofday() ends up in utc_offset, how can we be sure > nobody is relying on that? I forgot about FAT times, and only remembered that utc_offset() was used for RTC drivers. I thought that utc_offset() is 0 unless something sets the timezone to nonzero or the RTC is on local time (wall_cmos_clock case). However, since the kernel needs the timezone for FAT times, it must be known even if the RTC is on UTC time. Now I don't see how FAT times can even work unless the wall_cmos_clock. They are just the UTC minus utc_offset(), where utc_offset() is (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) Here wall_cmos_clock is only for managing the RTC offset. It must be 0 unless the RTC is on local time. But then either FAT times or RTC times must be broken except in the Greenwich meridian. Otherwise, tz_minuteswest must be nonzero to ajust FAT times right, but this makes utc_offset() unusable for the RTC offset. The timezone and setting it using settimeofday() is the correct API for implementing all of this (it only has minutes resolution, but no more is needed). The correct offsets are then: rtc_offset() = wall_cmos_clock ? tz_minuteswest * 60 : 0; fat_offset() = tz_minuteswest * 60; where tz_minuteswest must include the dst offset so it needs a daemon like adjkerntz(8) to manage it even if wall_cmos_clock == 0. I think adjkerntz already does this management, and it works in the wall_cmos_clock != 0 case (except for missing locking of all 3 of the variables, and fundamental races updating them all and also adjusting the RTC on every dst change). FAT times work in this case. I think FAT times just don't work if wall_cmos_clock == 0. I think the extra variables are to try to manage this complexity, but the just get in the way. wall_cmos_clock is obviously needed. But the extra offset can't do anything good. It might have helped on non-preemptible UP systems where locking was not needed. It allowed adjusting the offset without going near settimeofday(). But now non- broken locking would need to use the same lock for settimeofday() and the machdep.adjkerntz sysctl. It is easier to just lock settimeofday(). >> So while hyper technically, one could use this, nobody does, nor has since >> between 4.3 and 4.4 when it was realized that storing the timezone in the >> kernel was a really stupid idea. That's what the language used in the man >> page that you removed was trying to say. adjkerntz(8) uses this. Storing the timezone in the kernel is an essential idea. Otherwise, every FAT time calculation would have to call userland to ask for the timezone. Similarly for RTC offsets, except those don't need to be calculated very often. adjkerntz(8) can be simplified by only using 1 offset, but that offset should be the timezone set by settimeofday() and not a sysctl with even more broken locking. My program for demonstrating overflow bugs and panics in RTC code uses this. It could use either the timezone or machdep.adjkerntz to set a bad offset, but the timezone is easier to use. Bad offsets can be as little as 1 second, to convert the Epoch time (time_t)0 to the invalid time (time_t)-1. The program uses a timezone of +-24 hours to clobber any more reasonable offset in machdep.adjkerntz. Bruce From owner-svn-src-all@freebsd.org Mon Aug 6 00:46:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C3D1064468; Mon, 6 Aug 2018 00:46:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA5B7FAB1; Mon, 6 Aug 2018 00:46:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E104E42B63E; Mon, 6 Aug 2018 10:46:42 +1000 (AEST) Date: Mon, 6 Aug 2018 10:46:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Ian Lepore , Warner Losh , "Rodney W. Grimes" , Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337334 - head/lib/libc/sys In-Reply-To: <20180806074507.E920@besplex.bde.org> Message-ID: <20180806095604.J860@besplex.bde.org> References: <201808042208.w74M8OmD057603@repo.freebsd.org> <201808042224.w74MOgLi095274@pdx.rh.CN85.dnsmgr.net> <1533478958.9860.18.camel@freebsd.org> <20180806074507.E920@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=IfFsZ5XXtjUjwcPZAScA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 00:46:56 -0000 On Mon, 6 Aug 2018, Bruce Evans wrote: > ... > I forgot about FAT times, and only remembered that utc_offset() was used > for RTC drivers. I thought that utc_offset() is 0 unless something sets > the timezone to nonzero or the RTC is on local time (wall_cmos_clock case). > However, since the kernel needs the timezone for FAT times, it must be > known even if the RTC is on UTC time. Now I don't see how FAT times can > even work unless the wall_cmos_clock. They are just the UTC minus > utc_offset(), where utc_offset() is > > (tz_minuteswest * 60 + (wall_cmos_clock ? adjkerntz : 0)) > > Here wall_cmos_clock is only for managing the RTC offset. It must be 0 > unless the RTC is on local time. But then either FAT times or RTC times > must be broken except in the Greenwich meridian. Otherwise, tz_minuteswest > must be nonzero to ajust FAT times right, but this makes utc_offset() > unusable for the RTC offset. I verified the brokenness: - adjkerntz() normally leaves tz_minuteswest as 0. I verified that it does this when there is a nonzero dst adjustment. dst adjustments are folded into machdep.adjkerntz. - when wall_cmos_clock == 0, adjkerntz(8) does little or nothing, so all adjustments are 0, so utc_offset() is 0, so FAT times are broken except in the Greenwich meridian. The broken FAT times are not completely obvious, since getting and setting them use the same wrong offset of 0, so the times appear to be correct when displayed on FreeBSD. The are only obviously wrong when displayed on another system with non-broken FAT times, perhaps by rebooting to the other system or by moving removable media to such a system. FAT times are used by other file systems. I checked this in FreeBSD-9 so as to find axed file systems. The were used by smbfs, nwfs and msdosfs. Now they are only used by msdosfs. I never liked de-deduplicating their implementation into an over-engineered version with especially excessive handling for leap years. Leap year handling is unimportant compared with offset handling. tz_minuteswest is used by compatibility code. It cannot usefully be removed from the native version, since non-native syscalls use it and non-native applications might use it. Of course, it must have a correct value to work in compatibility. Its normal value of 0 breaks compatibility code much like the bugs in utc_offset() breaks FAT time. It is used in the following compatibility code: - amd64 linux32 linux_gettimeofday(). Like native gettimeofday(). It also reconstructs the dstflag part of the timezone struct. If linux drops this, then strict compatiility requires the support to depend on the linux version. - amd64 linux32 linux_settimeofday(). Like native settimeofday(). Has invisible reference to tz_minuteswest hidden in assignment of timezones. I only grepped for tz_minuteswest and only checked this indirect reference. - freebsd32 freebsd32_gettimeofday(). Similarly, except we control it, so can avoid needing version checks by not dropping support. - dev/tws/tws_services.h. This uses utc_offset() for FreeBSD-7 and later, and its reference to tz_minuteswest is only explicit for older versions where it open-codes utc_offset() with bug for bug compatibility except for adding style bugs. - smbfs. This uses FAT times, and in nearby code it uses tzoff for the offset and has commented-out code with an open-coded fully-buggy utc_offset(). - ibcs2 xenix_ftime(). This is similar to gettimeofday(). Bruce From owner-svn-src-all@freebsd.org Mon Aug 6 01:08:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D7E51064E27; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F19D8058F; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A71425E20; Mon, 6 Aug 2018 01:08:44 +0000 (UTC) (envelope-from bwidawsk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7618hZ8092372; Mon, 6 Aug 2018 01:08:43 GMT (envelope-from bwidawsk@FreeBSD.org) Received: (from bwidawsk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7618hFx092371; Mon, 6 Aug 2018 01:08:43 GMT (envelope-from bwidawsk@FreeBSD.org) Message-Id: <201808060108.w7618hFx092371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bwidawsk set sender to bwidawsk@FreeBSD.org using -f From: Ben Widawsky Date: Mon, 6 Aug 2018 01:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337365 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: bwidawsk X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 337365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 01:08:44 -0000 Author: bwidawsk Date: Mon Aug 6 01:08:43 2018 New Revision: 337365 URL: https://svnweb.freebsd.org/changeset/base/337365 Log: git-svn-init: Clarify branch creation commands Suggested by: eadler Reviewed by: eadler Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D16593 Modified: head/tools/tools/git/git-svn-init (contents, props changed) Modified: head/tools/tools/git/git-svn-init ============================================================================== --- head/tools/tools/git/git-svn-init Sun Aug 5 22:24:38 2018 (r337364) +++ head/tools/tools/git/git-svn-init Mon Aug 6 01:08:43 2018 (r337365) @@ -119,11 +119,9 @@ git_checkout() # Arrange to have 'master' reference 'trunk' ${GIT} checkout trunk - # Delete master - ${GIT} branch -D master - - # Make master really be trunk - ${GIT} checkout -b master trunk + # Make master reference trunk + ${GIT} branch --force master trunk + ${GIT} checkout master } rebase() From owner-svn-src-all@freebsd.org Mon Aug 6 02:09:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED0491066329; Mon, 6 Aug 2018 02:09:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8587981D4A; Mon, 6 Aug 2018 02:09:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57DFC267A9; Mon, 6 Aug 2018 02:09:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7629Fwf022852; Mon, 6 Aug 2018 02:09:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7629E3M022850; Mon, 6 Aug 2018 02:09:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808060209.w7629E3M022850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Aug 2018 02:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337366 - stable/11/usr.bin/sed X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/usr.bin/sed X-SVN-Commit-Revision: 337366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 02:09:16 -0000 Author: pfg Date: Mon Aug 6 02:09:14 2018 New Revision: 337366 URL: https://svnweb.freebsd.org/changeset/base/337366 Log: MFC r336926: sed: unsign some indexes to fix sign-compare warnings. Hinted by: OpenBSD (CVS 1.32) Modified: stable/11/usr.bin/sed/extern.h stable/11/usr.bin/sed/process.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sed/extern.h ============================================================================== --- stable/11/usr.bin/sed/extern.h Mon Aug 6 01:08:43 2018 (r337365) +++ stable/11/usr.bin/sed/extern.h Mon Aug 6 02:09:14 2018 (r337366) @@ -39,7 +39,7 @@ extern struct s_appends *appends; extern regmatch_t *match; extern size_t maxnsub; extern u_long linenum; -extern int appendnum; +extern unsigned int appendnum; extern int aflag, eflag, nflag; extern const char *fname, *outfname; extern FILE *infile, *outfile; Modified: stable/11/usr.bin/sed/process.c ============================================================================== --- stable/11/usr.bin/sed/process.c Mon Aug 6 01:08:43 2018 (r337365) +++ stable/11/usr.bin/sed/process.c Mon Aug 6 02:09:14 2018 (r337366) @@ -77,8 +77,8 @@ static void regsub(SPACE *, char *, char *); static int substitute(struct s_command *); struct s_appends *appends; /* Array of pointers to strings to append. */ -static int appendx; /* Index into appends array. */ -int appendnum; /* Size of appends array. */ +static unsigned int appendx; /* Index into appends array. */ +unsigned int appendnum; /* Size of appends array. */ static int lastaddr; /* Set by applies if last address of a range. */ static int sdone; /* If any substitutes since last line input. */ @@ -382,7 +382,7 @@ substitute(struct s_command *cp) regex_t *re; regoff_t slen; int lastempty, n; - size_t le = 0; + regoff_t le = 0; char *s; s = ps; @@ -547,13 +547,13 @@ static void flush_appends(void) { FILE *f; - int count, i; + unsigned int count, idx; char buf[8 * 1024]; - for (i = 0; i < appendx; i++) - switch (appends[i].type) { + for (idx = 0; idx < appendx; idx++) + switch (appends[idx].type) { case AP_STRING: - fwrite(appends[i].s, sizeof(char), appends[i].len, + fwrite(appends[idx].s, sizeof(char), appends[idx].len, outfile); break; case AP_FILE: @@ -565,7 +565,7 @@ flush_appends(void) * would be truly bizarre, but possible. It's probably * not that big a performance win, anyhow. */ - if ((f = fopen(appends[i].s, "r")) == NULL) + if ((f = fopen(appends[idx].s, "r")) == NULL) break; while ((count = fread(buf, sizeof(char), sizeof(buf), f))) (void)fwrite(buf, sizeof(char), count, outfile); From owner-svn-src-all@freebsd.org Mon Aug 6 02:10:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 052CE10663C1; Mon, 6 Aug 2018 02:10:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE77681EDA; Mon, 6 Aug 2018 02:10:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 768EE267C6; Mon, 6 Aug 2018 02:10:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w762Arca022982; Mon, 6 Aug 2018 02:10:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w762ArjD022980; Mon, 6 Aug 2018 02:10:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808060210.w762ArjD022980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 6 Aug 2018 02:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337367 - stable/10/usr.bin/sed X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/usr.bin/sed X-SVN-Commit-Revision: 337367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 02:10:54 -0000 Author: pfg Date: Mon Aug 6 02:10:52 2018 New Revision: 337367 URL: https://svnweb.freebsd.org/changeset/base/337367 Log: MFC r336926: sed: unsign some indexes to fix sign-compare warnings. Hinted by: OpenBSD (CVS 1.32) Modified: stable/10/usr.bin/sed/extern.h stable/10/usr.bin/sed/process.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/sed/extern.h ============================================================================== --- stable/10/usr.bin/sed/extern.h Mon Aug 6 02:09:14 2018 (r337366) +++ stable/10/usr.bin/sed/extern.h Mon Aug 6 02:10:52 2018 (r337367) @@ -39,7 +39,7 @@ extern struct s_appends *appends; extern regmatch_t *match; extern size_t maxnsub; extern u_long linenum; -extern int appendnum; +extern unsigned int appendnum; extern int aflag, eflag, nflag; extern const char *fname, *outfname; extern FILE *infile, *outfile; Modified: stable/10/usr.bin/sed/process.c ============================================================================== --- stable/10/usr.bin/sed/process.c Mon Aug 6 02:09:14 2018 (r337366) +++ stable/10/usr.bin/sed/process.c Mon Aug 6 02:10:52 2018 (r337367) @@ -76,8 +76,8 @@ static void regsub(SPACE *, char *, char *); static int substitute(struct s_command *); struct s_appends *appends; /* Array of pointers to strings to append. */ -static int appendx; /* Index into appends array. */ -int appendnum; /* Size of appends array. */ +static unsigned int appendx; /* Index into appends array. */ +unsigned int appendnum; /* Size of appends array. */ static int lastaddr; /* Set by applies if last address of a range. */ static int sdone; /* If any substitutes since last line input. */ @@ -372,7 +372,7 @@ substitute(struct s_command *cp) regex_t *re; regoff_t slen; int lastempty, n; - size_t le = 0; + regoff_t le = 0; char *s; s = ps; @@ -535,13 +535,13 @@ static void flush_appends(void) { FILE *f; - int count, i; + unsigned int count, idx; char buf[8 * 1024]; - for (i = 0; i < appendx; i++) - switch (appends[i].type) { + for (idx = 0; idx < appendx; idx++) + switch (appends[idx].type) { case AP_STRING: - fwrite(appends[i].s, sizeof(char), appends[i].len, + fwrite(appends[idx].s, sizeof(char), appends[idx].len, outfile); break; case AP_FILE: @@ -553,7 +553,7 @@ flush_appends(void) * would be truly bizarre, but possible. It's probably * not that big a performance win, anyhow. */ - if ((f = fopen(appends[i].s, "r")) == NULL) + if ((f = fopen(appends[idx].s, "r")) == NULL) break; while ((count = fread(buf, sizeof(char), sizeof(buf), f))) (void)fwrite(buf, sizeof(char), count, outfile); From owner-svn-src-all@freebsd.org Mon Aug 6 03:58:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA38710683FF; Mon, 6 Aug 2018 03:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F928573A; Mon, 6 Aug 2018 03:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C17F279C7; Mon, 6 Aug 2018 03:58:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w763wvqY080334; Mon, 6 Aug 2018 03:58:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w763wu7I080333; Mon, 6 Aug 2018 03:58:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808060358.w763wu7I080333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 6 Aug 2018 03:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337370 - in stable/11: stand/man sys/dev/efidev X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: stand/man sys/dev/efidev X-SVN-Commit-Revision: 337370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 03:58:58 -0000 Author: kevans Date: Mon Aug 6 03:58:56 2018 New Revision: 337370 URL: https://svnweb.freebsd.org/changeset/base/337370 Log: MFC r336919, r336924 r336919: efirt: Add tunable to allow disabling EFI Runtime Services Leading up to enabling EFIRT in GENERIC, allow runtime services to be disabled with a new tunable: efi.rt_disabled. This makes it so that EFIRT can be disabled easily in case we run into some buggy UEFI implementation and fail to boot. r336924: Follow up to r336919 and r336921: s/efi.rt_disabled/efi.rt.disabled/ The latter matches the rest of the tree better [0]. The UPDATING entry has been updated to reflect this, and the new tunable is now documented in loader(8) [1]. Reported by: imp [0], Shawn Webb [1] Modified: stable/11/stand/man/loader.8 stable/11/sys/dev/efidev/efirt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/man/loader.8 ============================================================================== --- stable/11/stand/man/loader.8 Mon Aug 6 03:41:52 2018 (r337369) +++ stable/11/stand/man/loader.8 Mon Aug 6 03:58:56 2018 (r337370) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2015 +.Dd July 30, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -588,6 +588,10 @@ explicitly. Other variables are used to override kernel tunable parameters. The following tunables are available: .Bl -tag -width Va +.It Va efi.rt.disabled +Disable UEFI runtime services in the kernel, if applicable. +Runtime services are only available and used if the kernel is booted in a UEFI +environment. .It Va hw.physmem Limit the amount of physical memory the system will use. By default the size is in bytes, but the Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Mon Aug 6 03:41:52 2018 (r337369) +++ stable/11/sys/dev/efidev/efirt.c Mon Aug 6 03:58:56 2018 (r337370) @@ -133,7 +133,12 @@ efi_init(void) struct efi_md *map; caddr_t kmdp; size_t efisz; + int rt_disabled; + rt_disabled = 0; + TUNABLE_INT_FETCH("efi.rt.disabled", &rt_disabled); + if (rt_disabled == 1) + return (0); mtx_init(&efi_lock, "efi", NULL, MTX_DEF); if (efi_systbl_phys == 0) { @@ -217,6 +222,9 @@ static void efi_uninit(void) { + /* Most likely disabled by tunable */ + if (efi_runtime == NULL) + return; efi_destroy_1t1_map(); efi_systbl = NULL; From owner-svn-src-all@freebsd.org Mon Aug 6 05:35:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072FD106B5EB; Mon, 6 Aug 2018 05:35:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF65488CEF; Mon, 6 Aug 2018 05:35:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90738A02; Mon, 6 Aug 2018 05:35:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w765ZPI4031012; Mon, 6 Aug 2018 05:35:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w765ZOq7031008; Mon, 6 Aug 2018 05:35:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808060535.w765ZOq7031008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 05:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337371 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 05:35:26 -0000 Author: manu Date: Mon Aug 6 05:35:24 2018 New Revision: 337371 URL: https://svnweb.freebsd.org/changeset/base/337371 Log: aw_sid: Add nvmem interface Rework aw_sid so it can work with the nvmem interface. Each SoC expose a set of fuses (for now rootkey/boardid and, if available, the thermal calibration data). A fuse can be private or public, reading private fuse needs to be done via some registers instead of reading directly. Each fuse is exposed as a sysctl. For now leave the possibility for a driver to read any fuse without using the nvmem interface as the awg and emac driver use this to generate a mac address. Modified: head/sys/arm/allwinner/aw_sid.c head/sys/arm/allwinner/aw_sid.h head/sys/arm/allwinner/aw_thermal.c head/sys/arm/allwinner/if_awg.c head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_sid.c Mon Aug 6 05:35:24 2018 (r337371) @@ -50,7 +50,12 @@ __FBSDID("$FreeBSD$"); #include -/* efuse registers */ +#include "nvmem_if.h" + +/* + * Starting at least from sun8iw6 (A83T) EFUSE starts at 0x200 + * There is 3 registers in the low area to read/write protected EFUSE. + */ #define SID_PRCTL 0x40 #define SID_PRCTL_OFFSET_MASK 0xff #define SID_PRCTL_OFFSET(n) (((n) & SID_PRCTL_OFFSET_MASK) << 16) @@ -60,61 +65,157 @@ __FBSDID("$FreeBSD$"); #define SID_PRKEY 0x50 #define SID_RDKEY 0x60 -#define SID_SRAM 0x200 -/* Offsets into efuse space, for convenience */ -#define SID_THERMAL_CALIB0_OFF (0x34) -#define SID_THERMAL_CALIB1_OFF (0x38) -#define SID_THERMAL_CALIB0 (SID_SRAM + SID_THERMAL_CALIB0_OFF) -#define SID_THERMAL_CALIB1 (SID_SRAM + SID_THERMAL_CALIB1_OFF) +#define EFUSE_OFFSET 0x200 +#define EFUSE_NAME_SIZE 32 +#define EFUSE_DESC_SIZE 64 -#define ROOT_KEY_SIZE 4 +struct aw_sid_efuse { + char name[EFUSE_NAME_SIZE]; + char desc[EFUSE_DESC_SIZE]; + bus_size_t base; + bus_size_t offset; + uint32_t size; + enum aw_sid_fuse_id id; + bool public; +}; +static struct aw_sid_efuse a10_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .offset = 0x0, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, +}; + +static struct aw_sid_efuse a64_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 6, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + +static struct aw_sid_efuse a83t_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 8, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + +static struct aw_sid_efuse h3_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 2, + .id = AW_SID_FUSE_THSSENSOR, + .public = false, + }, +}; + +static struct aw_sid_efuse h5_efuses[] = { + { + .name = "rootkey", + .desc = "Root Key or ChipID", + .base = EFUSE_OFFSET, + .offset = 0x00, + .size = 16, + .id = AW_SID_FUSE_ROOTKEY, + .public = true, + }, + { + .name = "ths-calib", + .desc = "Thermal Sensor Calibration Data", + .base = EFUSE_OFFSET, + .offset = 0x34, + .size = 4, + .id = AW_SID_FUSE_THSSENSOR, + .public = true, + }, +}; + struct aw_sid_conf { - bus_size_t efuse_size; - bus_size_t rootkey_offset; - bool has_prctl; - bool has_thermal; - bool requires_prctl_read; + struct aw_sid_efuse *efuses; + size_t nfuses; }; static const struct aw_sid_conf a10_conf = { - .efuse_size = 0x10, - .rootkey_offset = 0, + .efuses = a10_efuses, + .nfuses = nitems(a10_efuses), }; static const struct aw_sid_conf a20_conf = { - .efuse_size = 0x10, - .rootkey_offset = 0, + .efuses = a10_efuses, + .nfuses = nitems(a10_efuses), }; static const struct aw_sid_conf a64_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, + .efuses = a64_efuses, + .nfuses = nitems(a64_efuses), }; static const struct aw_sid_conf a83t_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, + .efuses = a83t_efuses, + .nfuses = nitems(a83t_efuses), }; static const struct aw_sid_conf h3_conf = { - .efuse_size = 0x100, - .rootkey_offset = SID_SRAM, - .has_prctl = true, - .has_thermal = true, - .requires_prctl_read = true, + .efuses = h3_efuses, + .nfuses = nitems(h3_efuses), }; +static const struct aw_sid_conf h5_conf = { + .efuses = h5_efuses, + .nfuses = nitems(h5_efuses), +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-sid", (uintptr_t)&a10_conf}, { "allwinner,sun7i-a20-sid", (uintptr_t)&a20_conf}, { "allwinner,sun50i-a64-sid", (uintptr_t)&a64_conf}, { "allwinner,sun8i-a83t-sid", (uintptr_t)&a83t_conf}, { "allwinner,sun8i-h3-sid", (uintptr_t)&h3_conf}, + { "allwinner,sun50i-h5-sid", (uintptr_t)&h5_conf}, { NULL, 0 } }; @@ -132,47 +233,13 @@ static struct resource_spec aw_sid_spec[] = { { -1, 0 } }; -enum sid_keys { - AW_SID_ROOT_KEY, -}; - +#define RD1(sc, reg) bus_read_1((sc)->res, (reg)) #define RD4(sc, reg) bus_read_4((sc)->res, (reg)) #define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) -#define PRCTL_RD4(sc, reg, val) aw_sid_prctl_read((sc)->sid_dev, (reg), (val)) - static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS); -static int aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val); - -/* - * offset here is offset into efuse space, rather than offset into sid register - * space. This form of read is only an option for newer SoC: A83t, H3, A64 - */ static int -aw_sid_prctl_read(device_t dev, bus_size_t offset, uint32_t *val) -{ - struct aw_sid_softc *sc; - uint32_t readval; - - sc = device_get_softc(dev); - if (!sc->sid_conf->has_prctl) - return (1); - - mtx_lock(&sc->prctl_mtx); - readval = SID_PRCTL_OFFSET(offset) | SID_PRCTL_LOCK | SID_PRCTL_READ; - WR4(sc, SID_PRCTL, readval); - /* Read bit will be cleared once read has concluded */ - while (RD4(sc, SID_PRCTL) & SID_PRCTL_READ) - continue; - readval = RD4(sc, SID_RDKEY); - mtx_unlock(&sc->prctl_mtx); - *val = readval; - - return (0); -} - -static int aw_sid_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -189,7 +256,10 @@ static int aw_sid_attach(device_t dev) { struct aw_sid_softc *sc; + phandle_t node; + int i; + node = ofw_bus_get_node(dev); sc = device_get_softc(dev); sc->sid_dev = dev; @@ -202,75 +272,124 @@ aw_sid_attach(device_t dev) sc->sid_conf = (struct aw_sid_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; aw_sid_sc = sc; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "rootkey", - CTLTYPE_STRING | CTLFLAG_RD, - dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); + /* Register ourself so device can resolve who we are */ + OF_device_register_xref(OF_xref_from_node(node), dev); + for (i = 0; i < sc->sid_conf->nfuses ;i++) {\ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, sc->sid_conf->efuses[i].name, + CTLTYPE_STRING | CTLFLAG_RD, + dev, sc->sid_conf->efuses[i].id, aw_sid_sysctl, + "A", sc->sid_conf->efuses[i].desc); + } return (0); } int -aw_sid_read_tscalib(uint32_t *calib0, uint32_t *calib1) +aw_sid_get_fuse(enum aw_sid_fuse_id id, uint8_t *out, uint32_t *size) { struct aw_sid_softc *sc; + uint32_t val; + int i, j; sc = aw_sid_sc; if (sc == NULL) return (ENXIO); - if (!sc->sid_conf->has_thermal) - return (ENXIO); - if (sc->sid_conf->requires_prctl_read) { - PRCTL_RD4(sc, SID_THERMAL_CALIB0_OFF, calib0); - PRCTL_RD4(sc, SID_THERMAL_CALIB1_OFF, calib1); - } else { - *calib0 = RD4(sc, SID_THERMAL_CALIB0); - *calib1 = RD4(sc, SID_THERMAL_CALIB1); + for (i = 0; i < sc->sid_conf->nfuses; i++) + if (id == sc->sid_conf->efuses[i].id) + break; + + if (i == sc->sid_conf->nfuses) + return (ENOENT); + + if (*size != sc->sid_conf->efuses[i].size) { + *size = sc->sid_conf->efuses[i].size; + return (ENOMEM); } + if (out == NULL) + return (ENOMEM); + + if (sc->sid_conf->efuses[i].public == false) + mtx_lock(&sc->prctl_mtx); + for (j = 0; j < sc->sid_conf->efuses[i].size; j += 4) { + if (sc->sid_conf->efuses[i].public == false) { + val = SID_PRCTL_OFFSET(sc->sid_conf->efuses[i].offset + j) | + SID_PRCTL_LOCK | + SID_PRCTL_READ; + WR4(sc, SID_PRCTL, val); + /* Read bit will be cleared once read has concluded */ + while (RD4(sc, SID_PRCTL) & SID_PRCTL_READ) + continue; + val = RD4(sc, SID_RDKEY); + } else + val = RD4(sc, sc->sid_conf->efuses[i].base + + sc->sid_conf->efuses[i].offset + j); + out[j] = val & 0xFF; + if (j + 1 < *size) + out[j + 1] = (val & 0xFF00) >> 8; + if (j + 2 < *size) + out[j + 2] = (val & 0xFF0000) >> 16; + if (j + 3 < *size) + out[j + 3] = (val & 0xFF000000) >> 24; + } + if (sc->sid_conf->efuses[i].public == false) + mtx_unlock(&sc->prctl_mtx); + return (0); } -int -aw_sid_get_rootkey(u_char *out) +static int +aw_sid_read(device_t dev, uint32_t offset, uint32_t size, uint8_t *buffer) { struct aw_sid_softc *sc; + enum aw_sid_fuse_id fuse_id = 0; int i; - bus_size_t root_key_off; - u_int tmp; - sc = aw_sid_sc; - if (sc == NULL) - return (ENXIO); - root_key_off = aw_sid_sc->sid_conf->rootkey_offset; - for (i = 0; i < ROOT_KEY_SIZE ; i++) { - if (sc->sid_conf->requires_prctl_read) - PRCTL_RD4(sc, (i * 4), &tmp); - else - tmp = RD4(aw_sid_sc, root_key_off + (i * 4)); - be32enc(&out[i * 4], tmp); - } + sc = device_get_softc(dev); - return (0); + for (i = 0; i < sc->sid_conf->nfuses; i++) + if (offset == (sc->sid_conf->efuses[i].base + + sc->sid_conf->efuses[i].offset)) { + fuse_id = sc->sid_conf->efuses[i].id; + break; + } + + if (fuse_id == 0) + return (ENOENT); + + return (aw_sid_get_fuse(fuse_id, buffer, &size)); } static int aw_sid_sysctl(SYSCTL_HANDLER_ARGS) { - enum sid_keys key = arg2; - u_char rootkey[16]; - char out[33]; + struct aw_sid_softc *sc; + device_t dev = arg1; + enum aw_sid_fuse_id fuse = arg2; + uint8_t data[32]; + char out[128]; + uint32_t size; + int ret, i; - if (key != AW_SID_ROOT_KEY) - return (ENOENT); + sc = device_get_softc(dev); - if (aw_sid_get_rootkey(rootkey) != 0) + /* Get the size of the efuse data */ + size = 0; + aw_sid_get_fuse(fuse, NULL, &size); + /* We now have the real size */ + ret = aw_sid_get_fuse(fuse, data, &size); + if (ret != 0) { + device_printf(dev, "Cannot get fuse id %d: %d\n", fuse, ret); return (ENOENT); - snprintf(out, sizeof(out), - "%16D", rootkey, ""); + } + for (i = 0; i < size; i++) + snprintf(out + (i * 2), sizeof(out) - (i * 2), + "%.2x", data[i]); + return sysctl_handle_string(oidp, out, sizeof(out), req); } @@ -279,6 +398,8 @@ static device_method_t aw_sid_methods[] = { DEVMETHOD(device_probe, aw_sid_probe), DEVMETHOD(device_attach, aw_sid_attach), + /* NVMEM interface */ + DEVMETHOD(nvmem_read, aw_sid_read), DEVMETHOD_END }; Modified: head/sys/arm/allwinner/aw_sid.h ============================================================================== --- head/sys/arm/allwinner/aw_sid.h Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_sid.h Mon Aug 6 05:35:24 2018 (r337371) @@ -29,7 +29,12 @@ #ifndef __AW_SID_H__ #define __AW_SID_H__ +enum aw_sid_fuse_id { + AW_SID_FUSE_ROOTKEY = 1, + AW_SID_FUSE_THSSENSOR, +}; + int aw_sid_read_tscalib(uint32_t *, uint32_t *); -int aw_sid_get_rootkey(u_char *out); +int aw_sid_get_fuse(enum aw_sid_fuse_id id, uint8_t *out, uint32_t *size); #endif /* !__AW_SID_H__ */ Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:35:24 2018 (r337371) @@ -50,10 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "cpufreq_if.h" +#include "nvmem_if.h" #define THS_CTRL0 0x00 #define THS_CTRL1 0x04 @@ -281,23 +283,31 @@ static struct resource_spec aw_thermal_spec[] = { static int aw_thermal_init(struct aw_thermal_softc *sc) { - uint32_t calib0, calib1; + phandle_t node; + uint32_t calib[2]; int error; + node = ofw_bus_get_node(sc->dev); if (sc->conf->calib0_mask != 0 || sc->conf->calib1_mask != 0) { - /* Read calibration settings from SRAM */ - error = aw_sid_read_tscalib(&calib0, &calib1); - if (error != 0) + error = nvmem_read_cell_by_name(node, "ths_calibration", + (void *)calib, sizeof(calib)); + /* Read calibration settings from EFUSE */ + if (error != 0) { + device_printf(sc->dev, "Cannot read THS efuse\n"); return (error); + } - calib0 &= sc->conf->calib0_mask; - calib1 &= sc->conf->calib1_mask; + device_printf(sc->dev, "calib0: %x\n", calib[0]); + device_printf(sc->dev, "calib1: %x\n", calib[1]); + calib[0] &= sc->conf->calib0_mask; + calib[1] &= sc->conf->calib1_mask; + /* Write calibration settings to thermal controller */ - if (calib0 != 0) - WR4(sc, THS_CALIB0, calib0); - if (calib1 != 0) - WR4(sc, THS_CALIB1, calib1); + if (calib[0] != 0) + WR4(sc, THS_CALIB0, calib[0]); + if (calib[1] != 0) + WR4(sc, THS_CALIB1, calib[1]); } /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/if_awg.c Mon Aug 6 05:35:24 2018 (r337371) @@ -1529,15 +1529,18 @@ awg_get_eaddr(device_t dev, uint8_t *eaddr) struct awg_softc *sc; uint32_t maclo, machi, rnd; u_char rootkey[16]; + uint32_t rootkey_size; sc = device_get_softc(dev); machi = RD4(sc, EMAC_ADDR_HIGH(0)) & 0xffff; maclo = RD4(sc, EMAC_ADDR_LOW(0)); + rootkey_size = sizeof(rootkey); if (maclo == 0xffffffff && machi == 0xffff) { /* MAC address in hardware is invalid, create one */ - if (aw_sid_get_rootkey(rootkey) == 0 && + if (aw_sid_get_fuse(AW_SID_FUSE_ROOTKEY, rootkey, + &rootkey_size) == 0 && (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] | rootkey[15]) != 0) { /* MAC address is derived from the root key in SID */ Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Mon Aug 6 03:58:56 2018 (r337370) +++ head/sys/arm/allwinner/if_emac.c Mon Aug 6 05:35:24 2018 (r337371) @@ -170,6 +170,7 @@ emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr { uint32_t val0, val1, rnd; u_char rootkey[16]; + size_t rootkey_size; /* * Try to get MAC address from running hardware. @@ -193,7 +194,9 @@ emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr hwaddr[4] = (val0 >> 8) & 0xff; hwaddr[5] = (val0 >> 0) & 0xff; } else { - if (aw_sid_get_rootkey(rootkey) == 0) { + rootkey_size = sizeof(rootkey); + if (aw_sid_get_fuse(AW_SID_FUSE_ROOTKEY, rootkey, + &rootkey_size) == 0) { hwaddr[0] = 0x2; hwaddr[1] = rootkey[3]; hwaddr[2] = rootkey[12]; From owner-svn-src-all@freebsd.org Mon Aug 6 05:36:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 340CA106B762; Mon, 6 Aug 2018 05:36:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD8C888E19; Mon, 6 Aug 2018 05:36:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE391A03; Mon, 6 Aug 2018 05:36:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w765a0Tu031082; Mon, 6 Aug 2018 05:36:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w765a00s031081; Mon, 6 Aug 2018 05:36:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808060536.w765a00s031081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 05:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337372 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 337372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 05:36:01 -0000 Author: manu Date: Mon Aug 6 05:36:00 2018 New Revision: 337372 URL: https://svnweb.freebsd.org/changeset/base/337372 Log: aw_thermal: Add nvmem and H5 support Now that aw_sid expose nvmem interface, use that to read the calibration data. Add support for H5 SoC. Fix the bindings, we used to have non-upstreamed bindings. Switch to the one that have been sent upstream. They are not stable yet, so we switch from custom, wrong, bindings to correct, proposed bindings Modified: head/sys/arm/allwinner/aw_thermal.c Modified: head/sys/arm/allwinner/aw_thermal.c ============================================================================== --- head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:35:24 2018 (r337371) +++ head/sys/arm/allwinner/aw_thermal.c Mon Aug 6 05:36:00 2018 (r337372) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #define SENSOR1_EN (1 << 1) #define SENSOR0_EN (1 << 0) #define THS_INTC 0x44 +#define THS_THERMAL_PER_SHIFT 12 #define THS_INTS 0x48 #define THS2_DATA_IRQ_STS (1 << 10) #define THS1_DATA_IRQ_STS (1 << 9) @@ -92,33 +93,49 @@ __FBSDID("$FreeBSD$"); #define THS_DATA2 0x88 #define DATA_MASK 0xfff -#define A83T_ADC_ACQUIRE_TIME 0x17 -#define A83T_FILTER 0x4 -#define A83T_INTC 0x1000 +#define A83T_CLK_RATE 24000000 +#define A83T_ADC_ACQUIRE_TIME 23 /* 24Mhz/(23 + 1) = 1us */ +#define A83T_THERMAL_PER 1 /* 4096 * (1 + 1) / 24Mhz = 341 us */ +#define A83T_FILTER 0x5 /* Filter enabled, avg of 4 */ #define A83T_TEMP_BASE 2719000 #define A83T_TEMP_MUL 1000 #define A83T_TEMP_DIV 14186 -#define A83T_CLK_RATE 24000000 -#define A64_ADC_ACQUIRE_TIME 0x190 -#define A64_FILTER 0x6 -#define A64_INTC 0x18000 +#define A64_CLK_RATE 4000000 +#define A64_ADC_ACQUIRE_TIME 400 /* 4Mhz/(400 + 1) = 100 us */ +#define A64_THERMAL_PER 24 /* 4096 * (24 + 1) / 4Mhz = 25.6 ms */ +#define A64_FILTER 0x6 /* Filter enabled, avg of 8 */ #define A64_TEMP_BASE 2170000 #define A64_TEMP_MUL 1000 #define A64_TEMP_DIV 8560 -#define A64_CLK_RATE 4000000 +#define H3_CLK_RATE 4000000 #define H3_ADC_ACQUIRE_TIME 0x3f -#define H3_FILTER 0x6 -#define H3_INTC 0x191000 +#define H3_THERMAL_PER 401 +#define H3_FILTER 0x6 /* Filter enabled, avg of 8 */ #define H3_TEMP_BASE 217 #define H3_TEMP_MUL 1000 #define H3_TEMP_DIV 8253 #define H3_TEMP_MINUS 1794000 -#define H3_CLK_RATE 4000000 #define H3_INIT_ALARM 90 /* degC */ #define H3_INIT_SHUT 105 /* degC */ +#define H5_CLK_RATE 24000000 +#define H5_ADC_ACQUIRE_TIME 479 /* 24Mhz/479 = 20us */ +#define H5_THERMAL_PER 58 /* 4096 * (58 + 1) / 24Mhz = 10ms */ +#define H5_FILTER 0x6 /* Filter enabled, avg of 8 */ +#define H5_TEMP_BASE 233832448 +#define H5_TEMP_MUL 124885 +#define H5_TEMP_DIV 20 +#define H5_TEMP_BASE_CPU 271581184 +#define H5_TEMP_MUL_CPU 152253 +#define H5_TEMP_BASE_GPU 289406976 +#define H5_TEMP_MUL_GPU 166724 +#define H5_INIT_CPU_ALARM 80 /* degC */ +#define H5_INIT_CPU_SHUT 96 /* degC */ +#define H5_INIT_GPU_ALARM 84 /* degC */ +#define H5_INIT_GPU_SHUT 100 /* degC */ + #define TEMP_C_TO_K 273 #define SENSOR_ENABLE_ALL (SENSOR0_EN|SENSOR1_EN|SENSOR2_EN) #define SHUT_INT_ALL (SHUT_INT0_STS|SHUT_INT1_STS|SHUT_INT2_STS) @@ -147,9 +164,9 @@ struct aw_thermal_config { uint32_t adc_acquire_time; int adc_cali_en; uint32_t filter; - uint32_t intc; - int (*to_temp)(uint32_t); - uint32_t (*to_reg)(int); + uint32_t thermal_per; + int (*to_temp)(uint32_t, int); + uint32_t (*to_reg)(int, int); int temp_base; int temp_mul; int temp_div; @@ -158,7 +175,7 @@ struct aw_thermal_config { }; static int -a83t_to_temp(uint32_t val) +a83t_to_temp(uint32_t val, int sensor) { return ((A83T_TEMP_BASE - (val * A83T_TEMP_MUL)) / A83T_TEMP_DIV); } @@ -183,14 +200,14 @@ static const struct aw_thermal_config a83t_config = { .adc_acquire_time = A83T_ADC_ACQUIRE_TIME, .adc_cali_en = 1, .filter = A83T_FILTER, - .intc = A83T_INTC, + .thermal_per = A83T_THERMAL_PER, .to_temp = a83t_to_temp, .calib0_mask = 0xffffffff, - .calib1_mask = 0xffffffff, + .calib1_mask = 0xffff, }; static int -a64_to_temp(uint32_t val) +a64_to_temp(uint32_t val, int sensor) { return ((A64_TEMP_BASE - (val * A64_TEMP_MUL)) / A64_TEMP_DIV); } @@ -213,19 +230,22 @@ static const struct aw_thermal_config a64_config = { }, .clk_rate = A64_CLK_RATE, .adc_acquire_time = A64_ADC_ACQUIRE_TIME, + .adc_cali_en = 1, .filter = A64_FILTER, - .intc = A64_INTC, + .thermal_per = A64_THERMAL_PER, .to_temp = a64_to_temp, + .calib0_mask = 0xffffffff, + .calib1_mask = 0xffff, }; static int -h3_to_temp(uint32_t val) +h3_to_temp(uint32_t val, int sensor) { return (H3_TEMP_BASE - ((val * H3_TEMP_MUL) / H3_TEMP_DIV)); } static uint32_t -h3_to_reg(int val) +h3_to_reg(int val, int sensor) { return ((H3_TEMP_MINUS - (val * H3_TEMP_DIV)) / H3_TEMP_MUL); } @@ -242,17 +262,93 @@ static const struct aw_thermal_config h3_config = { }, .clk_rate = H3_CLK_RATE, .adc_acquire_time = H3_ADC_ACQUIRE_TIME, + .adc_cali_en = 1, .filter = H3_FILTER, - .intc = H3_INTC, + .thermal_per = H3_THERMAL_PER, .to_temp = h3_to_temp, .to_reg = h3_to_reg, - .calib0_mask = 0xfff, + .calib0_mask = 0xffff, }; +static int +h5_to_temp(uint32_t val, int sensor) +{ + int tmp; + + /* Temp is lower than 70 degrees */ + if (val > 0x500) { + tmp = H5_TEMP_BASE - (val * H5_TEMP_MUL); + tmp >>= H5_TEMP_DIV; + return (tmp); + } + + if (sensor == 0) + tmp = H5_TEMP_BASE_CPU - (val * H5_TEMP_MUL_CPU); + else if (sensor == 1) + tmp = H5_TEMP_BASE_GPU - (val * H5_TEMP_MUL_GPU); + else { + printf("Unknown sensor %d\n", sensor); + return (val); + } + + tmp >>= H5_TEMP_DIV; + return (tmp); +} + +static uint32_t +h5_to_reg(int val, int sensor) +{ + int tmp; + + if (val < 70) { + tmp = H5_TEMP_BASE - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL; + } else { + if (sensor == 0) { + tmp = H5_TEMP_BASE_CPU - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL_CPU; + } else if (sensor == 1) { + tmp = H5_TEMP_BASE_GPU - (val << H5_TEMP_DIV); + tmp /= H5_TEMP_MUL_GPU; + } else { + printf("Unknown sensor %d\n", sensor); + return (val); + } + } + + return ((uint32_t)tmp); +} + +static const struct aw_thermal_config h5_config = { + .nsensors = 2, + .sensors = { + [0] = { + .name = "cpu", + .desc = "CPU temperature", + .init_alarm = H5_INIT_CPU_ALARM, + .init_shut = H5_INIT_CPU_SHUT, + }, + [1] = { + .name = "gpu", + .desc = "GPU temperature", + .init_alarm = H5_INIT_GPU_ALARM, + .init_shut = H5_INIT_GPU_SHUT, + }, + }, + .clk_rate = H5_CLK_RATE, + .adc_acquire_time = H5_ADC_ACQUIRE_TIME, + .filter = H5_FILTER, + .thermal_per = H5_THERMAL_PER, + .to_temp = h5_to_temp, + .to_reg = h5_to_reg, + .calib0_mask = 0xffffffff, +}; + static struct ofw_compat_data compat_data[] = { - { "allwinner,sun8i-a83t-ts", (uintptr_t)&a83t_config }, - { "allwinner,sun8i-h3-ts", (uintptr_t)&h3_config }, - { "allwinner,sun50i-a64-ts", (uintptr_t)&a64_config }, + { "allwinner,sun8i-a83t-ths", (uintptr_t)&a83t_config }, + { "allwinner,sun8i-h3-ths", (uintptr_t)&h3_config }, + { "allwinner,sun50i-a64-ths", (uintptr_t)&a64_config }, + { "allwinner,sun50i-h5-ths", (uintptr_t)&h5_config }, { NULL, (uintptr_t)NULL } }; @@ -269,6 +365,9 @@ struct aw_thermal_softc { int min_freq; struct cf_level levels[MAX_CF_LEVELS]; eventhandler_tag cf_pre_tag; + + clk_t clk_apb; + clk_t clk_ths; }; static struct resource_spec aw_thermal_spec[] = { @@ -288,39 +387,41 @@ aw_thermal_init(struct aw_thermal_softc *sc) int error; node = ofw_bus_get_node(sc->dev); - if (sc->conf->calib0_mask != 0 || sc->conf->calib1_mask != 0) { - error = nvmem_read_cell_by_name(node, "ths_calibration", - (void *)calib, sizeof(calib)); - /* Read calibration settings from EFUSE */ - if (error != 0) { - device_printf(sc->dev, "Cannot read THS efuse\n"); - return (error); - } + if (nvmem_get_cell_len(node, "ths-calib") > sizeof(calib)) { + device_printf(sc->dev, "ths-calib nvmem cell is too large\n"); + return (ENXIO); + } + error = nvmem_read_cell_by_name(node, "ths-calib", + (void *)&calib, nvmem_get_cell_len(node, "ths-calib")); + /* Read calibration settings from EFUSE */ + if (error != 0) { + device_printf(sc->dev, "Cannot read THS efuse\n"); + return (error); + } - device_printf(sc->dev, "calib0: %x\n", calib[0]); - device_printf(sc->dev, "calib1: %x\n", calib[1]); + calib[0] &= sc->conf->calib0_mask; + calib[1] &= sc->conf->calib1_mask; - calib[0] &= sc->conf->calib0_mask; - calib[1] &= sc->conf->calib1_mask; + /* Write calibration settings to thermal controller */ + if (calib[0] != 0) + WR4(sc, THS_CALIB0, calib[0]); + if (calib[1] != 0) + WR4(sc, THS_CALIB1, calib[1]); - /* Write calibration settings to thermal controller */ - if (calib[0] != 0) - WR4(sc, THS_CALIB0, calib[0]); - if (calib[1] != 0) - WR4(sc, THS_CALIB1, calib[1]); - } - /* Configure ADC acquire time (CLK_IN/(N+1)) and enable sensors */ WR4(sc, THS_CTRL1, ADC_CALI_EN); WR4(sc, THS_CTRL0, sc->conf->adc_acquire_time); WR4(sc, THS_CTRL2, sc->conf->adc_acquire_time << SENSOR_ACQ1_SHIFT); + /* Set thermal period */ + WR4(sc, THS_INTC, sc->conf->thermal_per << THS_THERMAL_PER_SHIFT); + /* Enable average filter */ WR4(sc, THS_FILTER, sc->conf->filter); /* Enable interrupts */ WR4(sc, THS_INTS, RD4(sc, THS_INTS)); - WR4(sc, THS_INTC, sc->conf->intc | SHUT_INT_ALL | ALARM_INT_ALL); + WR4(sc, THS_INTC, RD4(sc, THS_INTC) | SHUT_INT_ALL | ALARM_INT_ALL); /* Enable sensors */ WR4(sc, THS_CTRL2, RD4(sc, THS_CTRL2) | SENSOR_ENABLE_ALL); @@ -335,7 +436,7 @@ aw_thermal_gettemp(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_DATA0 + (sensor * 4)); - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static int @@ -346,7 +447,7 @@ aw_thermal_getshut(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4)); val = (val >> SHUT_T_HOT_SHIFT) & SHUT_T_HOT_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static void @@ -356,7 +457,7 @@ aw_thermal_setshut(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4)); val &= ~(SHUT_T_HOT_MASK << SHUT_T_HOT_SHIFT); - val |= (sc->conf->to_reg(temp) << SHUT_T_HOT_SHIFT); + val |= (sc->conf->to_reg(temp, sensor) << SHUT_T_HOT_SHIFT); WR4(sc, THS_SHUTDOWN0_CTRL + (sensor * 4), val); } @@ -368,7 +469,7 @@ aw_thermal_gethyst(struct aw_thermal_softc *sc, int se val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val = (val >> ALARM_T_HYST_SHIFT) & ALARM_T_HYST_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static int @@ -379,7 +480,7 @@ aw_thermal_getalarm(struct aw_thermal_softc *sc, int s val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val = (val >> ALARM_T_HOT_SHIFT) & ALARM_T_HOT_MASK; - return (sc->conf->to_temp(val)); + return (sc->conf->to_temp(val, sensor)); } static void @@ -389,7 +490,7 @@ aw_thermal_setalarm(struct aw_thermal_softc *sc, int s val = RD4(sc, THS_ALARM0_CTRL + (sensor * 4)); val &= ~(ALARM_T_HOT_MASK << ALARM_T_HOT_SHIFT); - val |= (sc->conf->to_reg(temp) << ALARM_T_HOT_SHIFT); + val |= (sc->conf->to_reg(temp, sensor) << ALARM_T_HOT_SHIFT); WR4(sc, THS_ALARM0_CTRL + (sensor * 4), val); } @@ -506,13 +607,12 @@ static int aw_thermal_attach(device_t dev) { struct aw_thermal_softc *sc; - clk_t clk_ahb, clk_ths; hwreset_t rst; int i, error; void *ih; sc = device_get_softc(dev); - clk_ahb = clk_ths = NULL; + sc->dev = dev; rst = NULL; ih = NULL; @@ -524,25 +624,27 @@ aw_thermal_attach(device_t dev) return (ENXIO); } - if (clk_get_by_ofw_name(dev, 0, "ahb", &clk_ahb) == 0) { - error = clk_enable(clk_ahb); + if (clk_get_by_ofw_name(dev, 0, "apb", &sc->clk_apb) == 0) { + error = clk_enable(sc->clk_apb); if (error != 0) { - device_printf(dev, "cannot enable ahb clock\n"); + device_printf(dev, "cannot enable apb clock\n"); goto fail; } } - if (clk_get_by_ofw_name(dev, 0, "ths", &clk_ths) == 0) { - error = clk_set_freq(clk_ths, sc->conf->clk_rate, 0); + + if (clk_get_by_ofw_name(dev, 0, "ths", &sc->clk_ths) == 0) { + error = clk_set_freq(sc->clk_ths, sc->conf->clk_rate, 0); if (error != 0) { device_printf(dev, "cannot set ths clock rate\n"); goto fail; } - error = clk_enable(clk_ths); + error = clk_enable(sc->clk_ths); if (error != 0) { device_printf(dev, "cannot enable ths clock\n"); goto fail; } } + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { error = hwreset_deassert(rst); if (error != 0) { @@ -581,7 +683,8 @@ aw_thermal_attach(device_t dev) if (bootverbose) for (i = 0; i < sc->conf->nsensors; i++) { device_printf(dev, - "#%d: alarm %dC hyst %dC shut %dC\n", i, + "%s: alarm %dC hyst %dC shut %dC\n", + sc->conf->sensors[i].name, aw_thermal_getalarm(sc, i), aw_thermal_gethyst(sc, i), aw_thermal_getshut(sc, i)); @@ -597,10 +700,10 @@ fail: bus_teardown_intr(dev, sc->res[1], ih); if (rst != NULL) hwreset_release(rst); - if (clk_ahb != NULL) - clk_release(clk_ahb); - if (clk_ths != NULL) - clk_release(clk_ths); + if (sc->clk_apb != NULL) + clk_release(sc->clk_apb); + if (sc->clk_ths != NULL) + clk_release(sc->clk_ths); bus_release_resources(dev, aw_thermal_spec, sc->res); return (ENXIO); From owner-svn-src-all@freebsd.org Mon Aug 6 08:35:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A8F104F6EA; Mon, 6 Aug 2018 08:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4C88ED63; Mon, 6 Aug 2018 08:35:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCF426E7; Mon, 6 Aug 2018 08:35:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w768ZGHW023057; Mon, 6 Aug 2018 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w768ZGIH023056; Mon, 6 Aug 2018 08:35:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808060835.w768ZGIH023056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 08:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337373 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 337373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 08:35:17 -0000 Author: hselasky Date: Mon Aug 6 08:35:16 2018 New Revision: 337373 URL: https://svnweb.freebsd.org/changeset/base/337373 Log: Define __poll_t type in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Mon Aug 6 05:36:00 2018 (r337372) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Mon Aug 6 08:35:16 2018 (r337373) @@ -59,6 +59,7 @@ typedef uint64_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; +typedef unsigned __poll_t; typedef u64 phys_addr_t; From owner-svn-src-all@freebsd.org Mon Aug 6 08:40:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64E84104F951; Mon, 6 Aug 2018 08:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17E018EFFB; Mon, 6 Aug 2018 08:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED04026EC; Mon, 6 Aug 2018 08:40:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w768e2vq023308; Mon, 6 Aug 2018 08:40:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w768e2gl023307; Mon, 6 Aug 2018 08:40:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808060840.w768e2gl023307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 08:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 337374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 08:40:03 -0000 Author: hselasky Date: Mon Aug 6 08:40:02 2018 New Revision: 337374 URL: https://svnweb.freebsd.org/changeset/base/337374 Log: Implement atomic_long_cmpxchg() function in the LinuxKPI. Submitted by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 08:35:16 2018 (r337373) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 08:40:02 2018 (r337374) @@ -81,6 +81,21 @@ atomic_long_xchg(atomic_long_t *v, long val) return atomic_swap_long(&v->counter, val); } +static inline long +atomic_long_cmpxchg(atomic_long_t *v, long old, long new) +{ + long ret = old; + + for (;;) { + if (atomic_cmpset_long(&v->counter, old, new)) + break; + ret = READ_ONCE(v->counter); + if (ret != old) + break; + } + return (ret); +} + static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { From owner-svn-src-all@freebsd.org Mon Aug 6 09:22:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0C11050C0A; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 432277042C; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2586C2F3F; Mon, 6 Aug 2018 09:22:08 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w769M8PY047845; Mon, 6 Aug 2018 09:22:08 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w769M8Bv047844; Mon, 6 Aug 2018 09:22:08 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201808060922.w769M8Bv047844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 6 Aug 2018 09:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337375 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 337375 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 09:22:08 -0000 Author: rrs Date: Mon Aug 6 09:22:07 2018 New Revision: 337375 URL: https://svnweb.freebsd.org/changeset/base/337375 Log: This fixes a bug in Rack where we were not properly using the correct value for Delayed Ack. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D16579 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Mon Aug 6 08:40:02 2018 (r337374) +++ head/sys/netinet/tcp_stacks/rack.c Mon Aug 6 09:22:07 2018 (r337375) @@ -2275,7 +2275,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc } hpts_timeout = rack_timer_start(tp, rack, cts); if (tp->t_flags & TF_DELACK) { - delayed_ack = tcp_delacktime; + delayed_ack = TICKS_2_MSEC(tcp_delacktime); rack->r_ctl.rc_hpts_flags |= PACE_TMR_DELACK; } if (delayed_ack && ((hpts_timeout == 0) || From owner-svn-src-all@freebsd.org Mon Aug 6 09:33:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50FAC10510D9; Mon, 6 Aug 2018 09:33:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2FD870AB4; Mon, 6 Aug 2018 09:33:33 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id 27-v6so8426628qkv.0; Mon, 06 Aug 2018 02:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yWdsdcZxATzt2n0aqv6kQyY01hfXHhmqOK7mmyk363A=; b=j4Q0KOM7sLep42Gc4IVCCwTPU1t9JuAySrjb1+qveGBZnHeeSZoKbbZe3/nn5/UiUF sayeZYqOlza59lrfDE11M1+vUowtdJo/Z4GRifJWwgibHg2YzKV4LWMr+LWIi7dU97z6 dsSZbPfPd0t0dnf/ifxO5XH65hgTOrjDt81i0fRREavt4VVSrrfPrzuaCmq0rqpKUsfo 6Uxw7F3YrtG9nQ2J4SuIT90d8csvX0K80MEWvebcINyalgk9Ak64NG2Hwntwxe6dbVeI SQgZRUNYYgJyQ66zcXgLO/9WNKMjMnNJjqULBlbFTeH8j0qM/4hMw0ZZHunVESmzER13 /zGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yWdsdcZxATzt2n0aqv6kQyY01hfXHhmqOK7mmyk363A=; b=t9+PUhyNuLkZx0LRs7XNLih6o64Glf7SPzVuP8TD/T5tPNQDMLc9xZY217iRIDV14c 5l90R+frhznYMLl2vIWfI5QAQSyF6Y+octIDW8F27OAKaC3DTr+fM6Mgl9W3sZ1ZT/ql h7szAsYX2/QfzIDcfN49+qVCgynmoNIR7KMH/EOxmHf3btDVP7i7zqUqRtrM7d/yZ+jm eLuG4pWRTRlULdSPEWV2BgQppg+LxC4+oFIJmldBbxNoREZ8EEiSMfghsN8Fkeq0MEvY MYOJgT4qRtbPPttTEmOuW9/AUr60ZLCm8bqbHIv7nVRnehcSACue9JsMgXjxWYLD6OoJ tKuQ== X-Gm-Message-State: AOUpUlGiKtQp6hlWv6FB+49ABZgzP8L2JRGm465Wa0PM/i+TCUUCmdfS iKHTSIS7/uaxXsZk9oW+DWUhu8NvK/pmz2V8pSmIOWs6 X-Google-Smtp-Source: AAOMgpecVHigZwB6ee+NTz12sk0IeujedE3DNvGFWgtsF/M2cBBv5nzTXjAKHXw+utqrg3YiFlgIJps3B0sNl3NLXO8= X-Received: by 2002:a37:3c84:: with SMTP id j126-v6mr12724077qka.73.1533548013472; Mon, 06 Aug 2018 02:33:33 -0700 (PDT) MIME-Version: 1.0 References: <201808060840.w768e2gl023307@repo.freebsd.org> In-Reply-To: <201808060840.w768e2gl023307@repo.freebsd.org> From: Mateusz Guzik Date: Mon, 6 Aug 2018 11:33:05 +0200 Message-ID: Subject: Re: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 09:33:34 -0000 On Mon, Aug 6, 2018 at 10:40 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Aug 6 08:40:02 2018 > New Revision: 337374 > URL: https://svnweb.freebsd.org/changeset/base/337374 > > Log: > Implement atomic_long_cmpxchg() function in the LinuxKPI. > > Submitted by: Johannes Lundberg > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/asm/atomic-long.h > > Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h > > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 > 08:35:16 2018 (r337373) > +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon Aug 6 > 08:40:02 2018 (r337374) > @@ -81,6 +81,21 @@ atomic_long_xchg(atomic_long_t *v, long val) > return atomic_swap_long(&v->counter, val); > } > > +static inline long > +atomic_long_cmpxchg(atomic_long_t *v, long old, long new) > +{ > + long ret = old; > + > + for (;;) { > + if (atomic_cmpset_long(&v->counter, old, new)) > + break; > + ret = READ_ONCE(v->counter); > + if (ret != old) > + break; > + } > + return (ret); > +} This code is seriously inferior to atomic_fcmpset_long, which happens to return the found value just like the linux atomic_long_cmpxchg would. The atomic_cmpset_* primitives should not be used if the target value is to be inspected. + > static inline int > atomic_long_add_unless(atomic_long_t *v, long a, long u) > { > > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Mon Aug 6 09:44:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31BEA1051A3A; Mon, 6 Aug 2018 09:44:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::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 BFC267148A; Mon, 6 Aug 2018 09:44:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 47DEB2601B1; Mon, 6 Aug 2018 11:44:53 +0200 (CEST) Subject: Re: svn commit: r337374 - head/sys/compat/linuxkpi/common/include/asm To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808060840.w768e2gl023307@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <2cbeb61b-6d24-84ed-e9d4-5d91a79cbf05@selasky.org> Date: Mon, 6 Aug 2018 11:44:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 09:44:55 -0000 On 08/06/18 11:33, Mateusz Guzik wrote: > This code is seriously inferior to atomic_fcmpset_long, which happens to > return the found value just like the linux atomic_long_cmpxchg would. > > The atomic_cmpset_* primitives should not be used if the target value is to > be inspected. Hi, The LinuxKPI has already has few places of atomic_cmpset_* currently. Can I assume that atomic_fcmpset_* is available for all platforms where atomic_cmpset_* is available? --HPS From owner-svn-src-all@freebsd.org Mon Aug 6 10:48:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2371A10530C0; Mon, 6 Aug 2018 10:48:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCF9472BD2; Mon, 6 Aug 2018 10:48:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A036409F; Mon, 6 Aug 2018 10:48:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76AmLsn093119; Mon, 6 Aug 2018 10:48:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76AmLoY093117; Mon, 6 Aug 2018 10:48:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808061048.w76AmLoY093117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Aug 2018 10:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337376 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 337376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 10:48:22 -0000 Author: hselasky Date: Mon Aug 6 10:48:20 2018 New Revision: 337376 URL: https://svnweb.freebsd.org/changeset/base/337376 Log: Implement current_work() function in the LinuxKPI. Tested by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/workqueue.h head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Mon Aug 6 10:48:20 2018 (r337376) @@ -60,6 +60,7 @@ #define TASK_COMM_LEN (MAXCOMLEN + 1) +struct work_struct; struct task_struct { struct thread *task_thread; struct mm_struct *mm; @@ -78,6 +79,7 @@ struct task_struct { TAILQ_ENTRY(task_struct) rcu_entry; int rcu_recurse; int bsd_interrupt_value; + struct work_struct *work; /* current work struct, if set */ }; #define current ({ \ Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h Mon Aug 6 10:48:20 2018 (r337376) @@ -209,6 +209,9 @@ do { \ #define destroy_workqueue(wq) \ linux_destroy_workqueue(wq) +#define current_work() \ + linux_current_work() + /* prototypes */ extern struct workqueue_struct *system_wq; @@ -232,5 +235,6 @@ extern bool linux_flush_work(struct work_struct *); extern bool linux_flush_delayed_work(struct delayed_work *); extern bool linux_work_pending(struct work_struct *); extern bool linux_work_busy(struct work_struct *); +extern struct work_struct *linux_current_work(void); #endif /* _LINUX_WORKQUEUE_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Mon Aug 6 09:22:07 2018 (r337375) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Mon Aug 6 10:48:20 2018 (r337376) @@ -220,8 +220,9 @@ linux_work_fn(void *context, int pending) struct work_struct *work; struct workqueue_struct *wq; struct work_exec exec; + struct task_struct *task; - linux_set_current(curthread); + task = current; /* setup local variables */ work = context; @@ -240,9 +241,15 @@ linux_work_fn(void *context, int pending) case WORK_ST_CANCEL: WQ_EXEC_UNLOCK(wq); + /* set current work structure */ + task->work = work; + /* call work function */ work->func(work); + /* set current work structure */ + task->work = NULL; + WQ_EXEC_LOCK(wq); /* check if unblocked */ if (exec.target != work) { @@ -577,6 +584,12 @@ linux_init_delayed_work(struct delayed_work *dwork, wo mtx_init(&dwork->timer.mtx, spin_lock_name("lkpi-dwork"), NULL, MTX_DEF | MTX_NOWITNESS); callout_init_mtx(&dwork->timer.callout, &dwork->timer.mtx, 0); +} + +struct work_struct * +linux_current_work(void) +{ + return (current->work); } static void From owner-svn-src-all@freebsd.org Mon Aug 6 11:38:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2FC1054875; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D47874909; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03DA048DF; Mon, 6 Aug 2018 11:38:56 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76BctRD024774; Mon, 6 Aug 2018 11:38:55 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Bctal024773; Mon, 6 Aug 2018 11:38:55 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808061138.w76Bctal024773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 6 Aug 2018 11:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337377 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 337377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 11:38:56 -0000 Author: 0mp (ports committer) Date: Mon Aug 6 11:38:55 2018 New Revision: 337377 URL: https://svnweb.freebsd.org/changeset/base/337377 Log: Fix synopsis of the -t option. While here: - Remove deprecated ".Tn" macros. - Improve formatting and fix typos in the description of the -t option. Reviewed by: bcr Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D16541 Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Mon Aug 6 10:48:20 2018 (r337376) +++ head/sbin/mount/mount.8 Mon Aug 6 11:38:55 2018 (r337377) @@ -39,14 +39,14 @@ .Op Fl adflpruvw .Op Fl F Ar fstab .Op Fl o Ar options -.Op Fl t Cm ufs | Ar external_type +.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... .Nm .Op Fl dfpruvw .Ar special | node .Nm .Op Fl dfpruvw .Op Fl o Ar options -.Op Fl t Cm ufs | Ar external_type +.Op Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... .Ar special node .Sh DESCRIPTION The @@ -139,9 +139,7 @@ This flag is mutually exclusive with .Cm nfsv4acls flag. .It Cm async -All -.Tn I/O -to the file system should be done asynchronously. +All I/O to the file system should be done asynchronously. This is a .Em dangerous flag to set, since it does not guarantee that the file system structure @@ -345,9 +343,7 @@ See .Xr chmod 2 for more information. .It Cm sync -All -.Tn I/O -to the file system should be done synchronously. +All I/O to the file system should be done synchronously. .It Cm update The same as .Fl u ; @@ -415,7 +411,7 @@ The same as the argument to the .Fl o option. -.It Fl t Cm ufs | Ar external_type +.It Fl t Oo Cm no Oc Ns Cm Ar type Ns Op Cm , Ns Ar type ... The argument following the .Fl t is used to indicate the file system type. @@ -429,7 +425,7 @@ to indicate that the actions should only be taken on file systems of the specified type. More than one type may be specified in a comma separated list. The list of file system types can be prefixed with -.Dq Li no +.Cm no to specify the file system types for which action should .Em not be taken. @@ -440,10 +436,7 @@ command: mount -a -t nonfs,nullfs .Ed .Pp -mounts all file systems except those of type -.Tn NFS -and -.Tn NULLFS . +mounts all file systems except those of type NFS and NULLFS. .Pp The default behavior of .Nm @@ -464,16 +457,18 @@ However, for the following file system types: .Cm smbfs , .Cm udf , and -.Cm unionfs . +.Cm unionfs .Nm will not call .Xr nmount 2 directly and will instead attempt to execute a program in -.Pa /sbin/mount_ Ns Sy XXX +.Pa /sbin/mount_ Ns Ar type where -.Sy XXX +.Ar type is replaced by the file system type name. -For example, nfs file systems are mounted by the program +For example, +.Cm nfs +file systems are mounted by the program .Pa /sbin/mount_nfs . .Pp Most file systems will be dynamically loaded by the kernel From owner-svn-src-all@freebsd.org Mon Aug 6 11:45:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD411054ACE; Mon, 6 Aug 2018 11:45:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1644074D4F; Mon, 6 Aug 2018 11:45:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB6DE4A85; Mon, 6 Aug 2018 11:45:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76BjSS7030433; Mon, 6 Aug 2018 11:45:28 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76BjSBA030432; Mon, 6 Aug 2018 11:45:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201808061145.w76BjSBA030432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 6 Aug 2018 11:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337378 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 337378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 11:45:29 -0000 Author: 0mp (ports committer) Date: Mon Aug 6 11:45:28 2018 New Revision: 337378 URL: https://svnweb.freebsd.org/changeset/base/337378 Log: Fix "mandoc -Tlint" warnings. Reviewed by: bcr Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D15580 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Mon Aug 6 11:38:55 2018 (r337377) +++ head/share/man/man8/rc.subr.8 Mon Aug 6 11:45:28 2018 (r337378) @@ -419,7 +419,7 @@ and errors about usage of services that are not enable .Xr rc.conf 5 . This prefix also sets .Va rc_quiet Ns = Ns Li YES . -.Em Please, note: +.Em Please, note\&: .Va rc_quiet is not intended to completely mask all debug and warning messages, but only certain small classes of them. @@ -506,7 +506,7 @@ This is done after invoking the commands from so that the missing modules are not loaded in vain if the preliminary commands indicate a error condition. A word in the list can have an optional -.Dq Li : Ns Ar modname +.Dq Li \&: Ns Ar modname or .Dq Li ~ Ns Ar pattern suffix. From owner-svn-src-all@freebsd.org Mon Aug 6 14:40:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F909105A8F9; Mon, 6 Aug 2018 14:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24D587A90B; Mon, 6 Aug 2018 14:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073D665D3; Mon, 6 Aug 2018 14:40:46 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76EejKB017651; Mon, 6 Aug 2018 14:40:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Eejfq017650; Mon, 6 Aug 2018 14:40:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201808061440.w76Eejfq017650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 6 Aug 2018 14:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337379 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 337379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 14:40:46 -0000 Author: andrew Date: Mon Aug 6 14:40:45 2018 New Revision: 337379 URL: https://svnweb.freebsd.org/changeset/base/337379 Log: Default to armv5te in LINT on arm. This should fix building LINT there. Modified: head/sys/arm/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Mon Aug 6 11:45:28 2018 (r337378) +++ head/sys/arm/conf/NOTES Mon Aug 6 14:40:45 2018 (r337379) @@ -12,6 +12,7 @@ files "../mv/orion/files.ts7800" options PHYSADDR=0x00000000 +makeoptions CONF_CFLAGS+="-march=armv5te" makeoptions LDFLAGS="-zmuldefs" makeoptions KERNPHYSADDR=0x00000000 From owner-svn-src-all@freebsd.org Mon Aug 6 15:55:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C5BD105CE0F; Mon, 6 Aug 2018 15:55:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0338A7D2B9; Mon, 6 Aug 2018 15:55:59 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D992772A0; Mon, 6 Aug 2018 15:55:58 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Ftw2J057830; Mon, 6 Aug 2018 15:55:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Ftw8G057829; Mon, 6 Aug 2018 15:55:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808061555.w76Ftw8G057829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 6 Aug 2018 15:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337381 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libpthread X-SVN-Commit-Revision: 337381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 15:55:59 -0000 Author: br Date: Mon Aug 6 15:55:58 2018 New Revision: 337381 URL: https://svnweb.freebsd.org/changeset/base/337381 Log: Increase timeout for timedmutex_test:mutex2, timedmutex_test:mutex3 tests. Default value is 300. It takes ~310s to complete each of these tests in QEMU/RISC-V. Sponsored by: DARPA, AFRL Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_mutex.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Mon Aug 6 15:21:46 2018 (r337380) +++ head/contrib/netbsd-tests/lib/libpthread/t_mutex.c Mon Aug 6 15:55:58 2018 (r337381) @@ -153,6 +153,12 @@ ATF_TC_HEAD(mutex2, tc) atf_tc_set_md_var(tc, "timeout", "40"); #endif #endif + +#ifdef __FreeBSD__ +#if defined(__riscv) + atf_tc_set_md_var(tc, "timeout", "600"); +#endif +#endif } ATF_TC_BODY(mutex2, tc) { @@ -228,6 +234,12 @@ ATF_TC_HEAD(mutex3, tc) #ifdef __NetBSD__ #if defined(__powerpc__) atf_tc_set_md_var(tc, "timeout", "40"); +#endif +#endif + +#ifdef __FreeBSD__ +#if defined(__riscv) + atf_tc_set_md_var(tc, "timeout", "600"); #endif #endif } From owner-svn-src-all@freebsd.org Mon Aug 6 16:17:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9E0105D6CF; Mon, 6 Aug 2018 16:17:33 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 04F4F7DD50; Mon, 6 Aug 2018 16:17:32 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from dhcp-10-248-121-111.eduroam.wireless.private.cam.ac.uk (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id A16514E711; Mon, 6 Aug 2018 16:16:54 +0000 (UTC) From: Andrew Turner Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: svn commit: r337379 - head/sys/arm/conf Date: Mon, 6 Aug 2018 17:16:53 +0100 References: <201808061440.w76Eejfq017650@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201808061440.w76Eejfq017650@repo.freebsd.org> Message-Id: <7438753E-4833-46E4-8D5F-44FB536CE72C@freebsd.org> X-Mailer: Apple Mail (2.3445.8.2) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 16:17:33 -0000 > On 6 Aug 2018, at 15:40, Andrew Turner wrote: > > Author: andrew > Date: Mon Aug 6 14:40:45 2018 > New Revision: 337379 > URL: https://svnweb.freebsd.org/changeset/base/337379 > > Log: > Default to armv5te in LINT on arm. This should fix building LINT there. Reported by: jhb Andrew From owner-svn-src-all@freebsd.org Mon Aug 6 16:22:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19EA105D9FC; Mon, 6 Aug 2018 16:22:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1EA07E06B; Mon, 6 Aug 2018 16:22:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79BAB7763; Mon, 6 Aug 2018 16:22:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76GM2xi069974; Mon, 6 Aug 2018 16:22:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76GM1pY069971; Mon, 6 Aug 2018 16:22:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808061622.w76GM1pY069971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 6 Aug 2018 16:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337382 - in head: etc/mtree sbin/dhclient sbin/init/rc.d X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: etc/mtree sbin/dhclient sbin/init/rc.d X-SVN-Commit-Revision: 337382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 16:22:03 -0000 Author: markj Date: Mon Aug 6 16:22:01 2018 New Revision: 337382 URL: https://svnweb.freebsd.org/changeset/base/337382 Log: dhclient: Don't chroot if we are in capability mode. The main dhclient process is Capsicumized but also chroots to restrict filesystem access. With r322369, pidfile(3) maintains a directory descriptor for the pidfile, which can cause the chroot to fail in certain cases. To minimize the problem, only chroot if we fail to enter capability mode, and store dhclient pidfiles in a subdirectory of /var/run, thus restricting access via pidfile(3)'s directory descriptor. PR: 223327 Reviewed by: cem, oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16584 Modified: head/etc/mtree/BSD.var.dist head/sbin/dhclient/dhclient.8 head/sbin/dhclient/dhclient.c head/sbin/init/rc.d/dhclient Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Mon Aug 6 15:55:58 2018 (r337381) +++ head/etc/mtree/BSD.var.dist Mon Aug 6 16:22:01 2018 (r337382) @@ -74,6 +74,8 @@ preserve .. run + dhclient + .. ppp gname=network mode=0770 .. wpa_supplicant Modified: head/sbin/dhclient/dhclient.8 ============================================================================== --- head/sbin/dhclient/dhclient.8 Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/dhclient/dhclient.8 Mon Aug 6 16:22:01 2018 (r337382) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 13, 2011 +.Dd August 4, 2018 .Dt DHCLIENT 8 .Os .Sh NAME @@ -87,7 +87,7 @@ for the leases file. .It Fl p Ar file Specify an alternate location for the PID file. The default is -.Pa /var/run/dhclient. Ns Ar interface Ns Pa .pid . +.Pa /var/run/dhclient/dhclient. Ns Ar interface Ns Pa .pid . .It Fl q Forces .Nm @@ -194,3 +194,16 @@ and .Pp The current implementation was reworked by .An Henning Brauer Aq Mt henning@openbsd.org . +.Sh BUGS +The +.Nm +utility uses +.Xr capsicum 4 +to sandbox the main process. +If the requisite kernel support is not available, the main process will +attempt to run in a +.Xr chroot 2 +sandbox instead. +This will fail if the process is jailed or the +.Va kern.chroot_allow_open_directories +sysctl is set to 0. Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/dhclient/dhclient.c Mon Aug 6 16:22:01 2018 (r337382) @@ -371,6 +371,7 @@ init_casper(void) int main(int argc, char *argv[]) { + u_int capmode; int ch, fd, quiet = 0, i = 0; int pipe_fd[2]; int immediate_daemon = 0; @@ -419,7 +420,7 @@ main(int argc, char *argv[]) if (path_dhclient_pidfile == NULL) { asprintf(&path_dhclient_pidfile, - "%sdhclient.%s.pid", _PATH_VARRUN, *argv); + "%s/dhclient/dhclient.%s.pid", _PATH_VARRUN, *argv); if (path_dhclient_pidfile == NULL) error("asprintf"); } @@ -528,11 +529,6 @@ main(int argc, char *argv[]) if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS) error("can't limit route socket: %m"); - if (chroot(_PATH_VAREMPTY) == -1) - error("chroot"); - if (chdir("/") == -1) - error("chdir(\"/\")"); - if (setgroups(1, &pw->pw_gid) || setegid(pw->pw_gid) || setgid(pw->pw_gid) || seteuid(pw->pw_uid) || setuid(pw->pw_uid)) @@ -545,6 +541,19 @@ main(int argc, char *argv[]) if (caph_enter_casper() < 0) error("can't enter capability mode: %m"); + /* + * If we are not in capability mode (i.e., because Capsicum or + * libcasper is disabled), try to restrict filesystem access. This + * will fail if kern.chroot_allow_open_directories is 0 or the process + * is jailed. + */ + if (cap_getmode(&capmode) < 0 || capmode == 0) { + if (chroot(_PATH_VAREMPTY) == -1) + error("chroot"); + if (chdir("/") == -1) + error("chdir(\"/\")"); + } + if (immediate_daemon) go_daemon(); @@ -2449,13 +2458,8 @@ go_daemon(void) cap_rights_init(&rights); - if (pidfile != NULL) { + if (pidfile != NULL) pidfile_write(pidfile); - if (cap_rights_limit(pidfile_fileno(pidfile), &rights) < 0 && - errno != ENOSYS) { - error("can't limit pidfile descriptor: %m"); - } - } if (nullfd != -1) { close(nullfd); Modified: head/sbin/init/rc.d/dhclient ============================================================================== --- head/sbin/init/rc.d/dhclient Mon Aug 6 15:55:58 2018 (r337381) +++ head/sbin/init/rc.d/dhclient Mon Aug 6 16:22:01 2018 (r337382) @@ -14,7 +14,7 @@ ifn="$2" name="dhclient" desc="Dynamic Host Configuration Protocol (DHCP) client" rcvar= -pidfile="/var/run/${name}.${ifn}.pid" +pidfile="/var/run/dhclient/${name}.${ifn}.pid" start_precmd="dhclient_prestart" stop_precmd="dhclient_pre_check" From owner-svn-src-all@freebsd.org Mon Aug 6 17:21:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2351F105EF9C; Mon, 6 Aug 2018 17:21:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CADEF80261; Mon, 6 Aug 2018 17:21:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABF857FBA; Mon, 6 Aug 2018 17:21:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76HLKuP001425; Mon, 6 Aug 2018 17:21:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76HLK1C001395; Mon, 6 Aug 2018 17:21:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201808061721.w76HLK1C001395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 6 Aug 2018 17:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337383 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:21:21 -0000 Author: manu Date: Mon Aug 6 17:21:20 2018 New Revision: 337383 URL: https://svnweb.freebsd.org/changeset/base/337383 Log: release: arm: Copy the dtb to the fat partition When booting via EFI on arm we have no way to know the dtb file to load and we always use the one provided from the bootloader. This works in most case but : U-Boot have some really old DTB for some boards, the sync from Linux isn't done automatically for all boards Some boards (like TI BeagleBone series) use one u-boot for all the model and it doesn't embed the DTBs Some boards (like IMX6 based ones), don't embed the DTB We want u-boot to load and patch the DTB with the mac address or the display node enabled or not. Reviewed by: gjb, imp Differential Revision: https://reviews.freebsd.org/D16596 Modified: head/release/tools/arm.subr Modified: head/release/tools/arm.subr ============================================================================== --- head/release/tools/arm.subr Mon Aug 6 16:22:01 2018 (r337382) +++ head/release/tools/arm.subr Mon Aug 6 17:21:20 2018 (r337383) @@ -201,6 +201,8 @@ arm_install_boot() { chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader/loader.efi \ ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET}) + chroot ${CHROOTDIR} cp -R ${UFSMOUNT}/boot/dtb ${FATMOUNT} + chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} From owner-svn-src-all@freebsd.org Mon Aug 6 17:36:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6332105F714; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE2F80CF3; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78D96102BD; Mon, 6 Aug 2018 17:36:58 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Haw7t009584; Mon, 6 Aug 2018 17:36:58 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Hawt5009582; Mon, 6 Aug 2018 17:36:58 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061736.w76Hawt5009582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337384 - in head: share/man/man4 sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:36:59 -0000 Author: jtl Date: Mon Aug 6 17:36:57 2018 New Revision: 337384 URL: https://svnweb.freebsd.org/changeset/base/337384 Log: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Reviewed by: jhb Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp_reass.c Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Aug 6 17:21:20 2018 (r337383) +++ head/share/man/man4/tcp.4 Mon Aug 6 17:36:57 2018 (r337384) @@ -445,6 +445,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Mon Aug 6 17:21:20 2018 (r337383) +++ head/sys/netinet/tcp_reass.c Mon Aug 6 17:36:57 2018 (r337384) @@ -91,6 +91,11 @@ SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegme &tcp_reass_zone, "Global number of TCP Segments currently in Reassembly Queue"); +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -170,6 +175,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -180,7 +189,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { From owner-svn-src-all@freebsd.org Mon Aug 6 17:41:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C24A1105F948; Mon, 6 Aug 2018 17:41:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 775238116A; Mon, 6 Aug 2018 17:41:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5975C10414; Mon, 6 Aug 2018 17:41:54 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Hfs6F013564; Mon, 6 Aug 2018 17:41:54 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Hfs19013563; Mon, 6 Aug 2018 17:41:54 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061741.w76Hfs19013563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337385 - in stable/11: share/man/man4 sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:41:55 -0000 Author: jtl Date: Mon Aug 6 17:41:53 2018 New Revision: 337385 URL: https://svnweb.freebsd.org/changeset/base/337385 Log: MFC r337384: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Reviewed by: jhb Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: stable/11/share/man/man4/tcp.4 stable/11/sys/netinet/tcp_reass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/tcp.4 ============================================================================== --- stable/11/share/man/man4/tcp.4 Mon Aug 6 17:36:57 2018 (r337384) +++ stable/11/share/man/man4/tcp.4 Mon Aug 6 17:41:53 2018 (r337385) @@ -445,6 +445,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: stable/11/sys/netinet/tcp_reass.c ============================================================================== --- stable/11/sys/netinet/tcp_reass.c Mon Aug 6 17:36:57 2018 (r337384) +++ stable/11/sys/netinet/tcp_reass.c Mon Aug 6 17:41:53 2018 (r337385) @@ -89,6 +89,11 @@ SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegme &tcp_reass_zone, "Global number of TCP Segments currently in Reassembly Queue"); +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -168,6 +173,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -178,7 +187,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { From owner-svn-src-all@freebsd.org Mon Aug 6 17:46:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3367105FBDA; Mon, 6 Aug 2018 17:46:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78889813EE; Mon, 6 Aug 2018 17:46:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5942B10451; Mon, 6 Aug 2018 17:46:29 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76HkTID014527; Mon, 6 Aug 2018 17:46:29 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76HkSna014525; Mon, 6 Aug 2018 17:46:28 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061746.w76HkSna014525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337386 - in stable/10: share/man/man4 sys/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in stable/10: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:46:30 -0000 Author: jtl Date: Mon Aug 6 17:46:28 2018 New Revision: 337386 URL: https://svnweb.freebsd.org/changeset/base/337386 Log: MFC r337384: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Approved by: so Security: FreeBSD-SA-18:08.tcp Sponsored by: CVE-2018-6922 Modified: stable/10/share/man/man4/tcp.4 stable/10/sys/netinet/tcp_reass.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tcp.4 ============================================================================== --- stable/10/share/man/man4/tcp.4 Mon Aug 6 17:41:53 2018 (r337385) +++ stable/10/share/man/man4/tcp.4 Mon Aug 6 17:46:28 2018 (r337386) @@ -436,6 +436,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: stable/10/sys/netinet/tcp_reass.c ============================================================================== --- stable/10/sys/netinet/tcp_reass.c Mon Aug 6 17:41:53 2018 (r337385) +++ stable/10/sys/netinet/tcp_reass.c Mon Aug 6 17:46:28 2018 (r337386) @@ -96,6 +96,11 @@ SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, overflows, static uma_zone_t tcp_reass_zone; +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -184,6 +189,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -194,7 +203,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); From owner-svn-src-all@freebsd.org Mon Aug 6 17:47:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 225EA105FCC5; Mon, 6 Aug 2018 17:47:49 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C69AE81560; Mon, 6 Aug 2018 17:47:48 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A65AF10453; Mon, 6 Aug 2018 17:47:48 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76HlmbY014629; Mon, 6 Aug 2018 17:47:48 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Hlmgt014628; Mon, 6 Aug 2018 17:47:48 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061747.w76Hlmgt014628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337387 - in releng/11.2: share/man/man4 sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in releng/11.2: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:47:49 -0000 Author: jtl Date: Mon Aug 6 17:47:47 2018 New Revision: 337387 URL: https://svnweb.freebsd.org/changeset/base/337387 Log: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: releng/11.2/share/man/man4/tcp.4 releng/11.2/sys/netinet/tcp_reass.c Modified: releng/11.2/share/man/man4/tcp.4 ============================================================================== --- releng/11.2/share/man/man4/tcp.4 Mon Aug 6 17:46:28 2018 (r337386) +++ releng/11.2/share/man/man4/tcp.4 Mon Aug 6 17:47:47 2018 (r337387) @@ -445,6 +445,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: releng/11.2/sys/netinet/tcp_reass.c ============================================================================== --- releng/11.2/sys/netinet/tcp_reass.c Mon Aug 6 17:46:28 2018 (r337386) +++ releng/11.2/sys/netinet/tcp_reass.c Mon Aug 6 17:47:47 2018 (r337387) @@ -89,6 +89,11 @@ SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegme &tcp_reass_zone, "Global number of TCP Segments currently in Reassembly Queue"); +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -168,6 +173,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -178,7 +187,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { From owner-svn-src-all@freebsd.org Mon Aug 6 17:48:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C67105FD5F; Mon, 6 Aug 2018 17:48:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88A18816B0; Mon, 6 Aug 2018 17:48:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69B9610454; Mon, 6 Aug 2018 17:48:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76HmlxG014711; Mon, 6 Aug 2018 17:48:47 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Hmlj7014710; Mon, 6 Aug 2018 17:48:47 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061748.w76Hmlj7014710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337388 - in releng/11.1: share/man/man4 sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in releng/11.1: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:48:48 -0000 Author: jtl Date: Mon Aug 6 17:48:46 2018 New Revision: 337388 URL: https://svnweb.freebsd.org/changeset/base/337388 Log: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: releng/11.1/share/man/man4/tcp.4 releng/11.1/sys/netinet/tcp_reass.c Modified: releng/11.1/share/man/man4/tcp.4 ============================================================================== --- releng/11.1/share/man/man4/tcp.4 Mon Aug 6 17:47:47 2018 (r337387) +++ releng/11.1/share/man/man4/tcp.4 Mon Aug 6 17:48:46 2018 (r337388) @@ -445,6 +445,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: releng/11.1/sys/netinet/tcp_reass.c ============================================================================== --- releng/11.1/sys/netinet/tcp_reass.c Mon Aug 6 17:47:47 2018 (r337387) +++ releng/11.1/sys/netinet/tcp_reass.c Mon Aug 6 17:48:46 2018 (r337388) @@ -89,6 +89,11 @@ SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegme &tcp_reass_zone, "Global number of TCP Segments currently in Reassembly Queue"); +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -168,6 +173,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -178,7 +187,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { TCPSTAT_INC(tcps_rcvreassfull); *tlenp = 0; if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { From owner-svn-src-all@freebsd.org Mon Aug 6 17:50:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F66105FEBE; Mon, 6 Aug 2018 17:50:41 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 235C18190C; Mon, 6 Aug 2018 17:50:41 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05E0F10462; Mon, 6 Aug 2018 17:50:41 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Hoe8a014874; Mon, 6 Aug 2018 17:50:40 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76HoeEr014872; Mon, 6 Aug 2018 17:50:40 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061750.w76HoeEr014872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 17:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337389 - in releng/10.4: share/man/man4 sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in releng/10.4: share/man/man4 sys/netinet X-SVN-Commit-Revision: 337389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 17:50:41 -0000 Author: jtl Date: Mon Aug 6 17:50:40 2018 New Revision: 337389 URL: https://svnweb.freebsd.org/changeset/base/337389 Log: Address concerns about CPU usage while doing TCP reassembly. Currently, the per-queue limit is a function of the receive buffer size and the MSS. In certain cases (such as connections with large receive buffers), the per-queue segment limit can be quite large. Because we process segments as a linked list, large queues may not perform acceptably. The better long-term solution is to make the queue more efficient. But, in the short-term, we can provide a way for a system administrator to set the maximum queue size. We set the default queue limit to 100. This is an effort to balance performance with a sane resource limit. Depending on their environment, goals, etc., an administrator may choose to modify this limit in either direction. Approved by: so Security: FreeBSD-SA-18:08.tcp Security: CVE-2018-6922 Modified: releng/10.4/share/man/man4/tcp.4 releng/10.4/sys/netinet/tcp_reass.c Modified: releng/10.4/share/man/man4/tcp.4 ============================================================================== --- releng/10.4/share/man/man4/tcp.4 Mon Aug 6 17:48:46 2018 (r337388) +++ releng/10.4/share/man/man4/tcp.4 Mon Aug 6 17:50:40 2018 (r337389) @@ -436,6 +436,20 @@ no reseeding will occur. Reseeding should not be necessary, and will break .Dv TIME_WAIT recycling for a few minutes. +.It Va reass.cursegments +The current total number of segments present in all reassembly queues. +.It Va reass.maxsegments +The maximum limit on the total number of segments across all reassembly +queues. +The limit can be adjusted as a tunable. +.It Va reass.maxqueuelen +The maximum number of segments allowed in each reassembly queue. +By default, the system chooses a limit based on each TCP connection's +receive buffer size and maximum segment size (MSS). +The actual limit applied to a session's reassembly queue will be the lower of +the system-calculated automatic limit and the user-specified +.Va reass.maxqueuelen +limit. .It Va rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . Modified: releng/10.4/sys/netinet/tcp_reass.c ============================================================================== --- releng/10.4/sys/netinet/tcp_reass.c Mon Aug 6 17:48:46 2018 (r337388) +++ releng/10.4/sys/netinet/tcp_reass.c Mon Aug 6 17:50:40 2018 (r337389) @@ -96,6 +96,11 @@ SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, overflows, static uma_zone_t tcp_reass_zone; +static u_int tcp_reass_maxqueuelen = 100; +SYSCTL_UINT(_net_inet_tcp_reass, OID_AUTO, maxqueuelen, CTLFLAG_RWTUN, + &tcp_reass_maxqueuelen, 0, + "Maximum number of TCP Segments per Reassembly Queue"); + /* Initialize TCP reassembly queue */ static void tcp_reass_zone_change(void *tag) @@ -184,6 +189,10 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * socket receive buffer determines our advertised window and grows * automatically when socket buffer autotuning is enabled. Use it as the * basis for our queue limit. + * + * However, allow the user to specify a ceiling for the number of + * segments in each queue. + * * Always let the missing segment through which caused this queue. * NB: Access to the socket buffer is left intentionally unlocked as we * can tolerate stale information here. @@ -194,7 +203,8 @@ tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tl * is understood. */ if ((th->th_seq != tp->rcv_nxt || !TCPS_HAVEESTABLISHED(tp->t_state)) && - tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { + tp->t_segqlen >= min((so->so_rcv.sb_hiwat / tp->t_maxseg) + 1, + tcp_reass_maxqueuelen)) { tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); From owner-svn-src-all@freebsd.org Mon Aug 6 18:16:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCF41060E3E; Mon, 6 Aug 2018 18:16:00 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C26A982C8F; Mon, 6 Aug 2018 18:15:59 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id EB3B825D3A0E; Mon, 6 Aug 2018 18:15:51 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 0F0A1D1F947; Mon, 6 Aug 2018 18:15:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 6AsbP9pLYR3s; Mon, 6 Aug 2018 18:15:49 +0000 (UTC) Received: from [192.168.124.1] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D19EDD1F917; Mon, 6 Aug 2018 18:15:48 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337384 - in head: share/man/man4 sys/netinet Date: Mon, 06 Aug 2018 18:15:48 +0000 X-Mailer: MailMate (2.0BETAr6116) Message-ID: <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> In-Reply-To: <201808061736.w76Hawt5009582@repo.freebsd.org> References: <201808061736.w76Hawt5009582@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 18:16:00 -0000 On 6 Aug 2018, at 17:36, Jonathan T. Looney wrote: > Author: jtl > Date: Mon Aug 6 17:36:57 2018 > New Revision: 337384 > URL: https://svnweb.freebsd.org/changeset/base/337384 > > Log: > Address concerns about CPU usage while doing TCP reassembly. … > > Reviewed by: jhb > Approved by: so > Security: FreeBSD-SA-18:08.tcp > Security: CVE-2018-6922 > > Modified: > head/share/man/man4/tcp.4 > head/sys/netinet/tcp_reass.c > > Modified: head/share/man/man4/tcp.4 > ============================================================================== > --- head/share/man/man4/tcp.4 Mon Aug 6 17:21:20 2018 (r337383) > +++ head/share/man/man4/tcp.4 Mon Aug 6 17:36:57 2018 (r337384) > @@ -445,6 +445,20 @@ no reseeding will occur. > Reseeding should not be necessary, and will break > .Dv TIME_WAIT > recycling for a few minutes. > +.It Va reass.cursegments Would you mind bumping .Dd as well please? Thanks, /bz From owner-svn-src-all@freebsd.org Mon Aug 6 18:42:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98B181061999; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C2D783CC7; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E39F10DF2; Mon, 6 Aug 2018 18:42:38 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76IgcNq045343; Mon, 6 Aug 2018 18:42:38 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Igc7B045342; Mon, 6 Aug 2018 18:42:38 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061842.w76Igc7B045342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 18:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337390 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 18:42:38 -0000 Author: jtl Date: Mon Aug 6 18:42:37 2018 New Revision: 337390 URL: https://svnweb.freebsd.org/changeset/base/337390 Log: Bump date after r337384. Reported by: bz Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Aug 6 17:50:40 2018 (r337389) +++ head/share/man/man4/tcp.4 Mon Aug 6 18:42:37 2018 (r337390) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 9, 2018 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Mon Aug 6 18:46:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A101061AB1; Mon, 6 Aug 2018 18:46:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37CDE83EF0; Mon, 6 Aug 2018 18:46:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1854E10E15; Mon, 6 Aug 2018 18:46:10 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Ik9Nf045569; Mon, 6 Aug 2018 18:46:09 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Ik9Ip045568; Mon, 6 Aug 2018 18:46:09 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061846.w76Ik9Ip045568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 18:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337391 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 337391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 18:46:10 -0000 Author: jtl Date: Mon Aug 6 18:46:09 2018 New Revision: 337391 URL: https://svnweb.freebsd.org/changeset/base/337391 Log: MFC r337390: Bump date after r337384. Modified: stable/11/share/man/man4/tcp.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/tcp.4 ============================================================================== --- stable/11/share/man/man4/tcp.4 Mon Aug 6 18:42:37 2018 (r337390) +++ stable/11/share/man/man4/tcp.4 Mon Aug 6 18:46:09 2018 (r337391) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 6, 2017 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Mon Aug 6 18:47:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66521061B19; Mon, 6 Aug 2018 18:47:03 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BCE184047; Mon, 6 Aug 2018 18:47:03 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E41710E1E; Mon, 6 Aug 2018 18:47:03 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Il39D045663; Mon, 6 Aug 2018 18:47:03 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Il3Yd045662; Mon, 6 Aug 2018 18:47:03 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201808061847.w76Il3Yd045662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 18:47:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337392 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 337392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 18:47:04 -0000 Author: jtl Date: Mon Aug 6 18:47:03 2018 New Revision: 337392 URL: https://svnweb.freebsd.org/changeset/base/337392 Log: MFC r337390: Bump date after r337384. Modified: stable/10/share/man/man4/tcp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/tcp.4 ============================================================================== --- stable/10/share/man/man4/tcp.4 Mon Aug 6 18:46:09 2018 (r337391) +++ stable/10/share/man/man4/tcp.4 Mon Aug 6 18:47:03 2018 (r337392) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 13, 2014 +.Dd August 6, 2018 .Dt TCP 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Mon Aug 6 18:48:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70A81061BAB; Mon, 6 Aug 2018 18:48:11 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23B8B8419F; Mon, 6 Aug 2018 18:48:11 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-ed1-f42.google.com with SMTP id f23-v6so5642454edr.11; Mon, 06 Aug 2018 11:48:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9g7gSz6iMVGEn+dNkNW9SVXETryFQ6G2gxJuN71zIQE=; b=jS40T4UZ6UOFVSJzfUVobrgLxp3JnDkG+u4skIKsUrnvh1q1Obdn+a8X42OryrCue7 tB3R8lgh2oMZsnl3aYhsVtzmzf15rurlUWBbUpsh5o+aNZsJ/y9Wl+VE0++Cs3qyNrXp 5ruoVqPionAAIWdf4D0Wxc8HoWrGpYn/5YjRq53phF4RaF5dtyQZ4HOhgO3EHrr8VSYp ztcWzbZoPbesRNdOfNbSqHjOXKOKpKHDjBpcFIot31yRTkVsv6VAaf9p9KvXDB+X8cgX M20GX9ZdSi2ti5EHpXrVhgc5h1Kw6R0ObH/yluWRXnM477AhaKgo/DlIwxPlMgX1Vhex KCIw== X-Gm-Message-State: AOUpUlEzUGex2F9ogxGTED7dq59+aMo5zsm+h/RoVvAhmti9q9J2zQuD THrAaVHKcJu+uJKS9RhC+VNjPjxOYI4= X-Google-Smtp-Source: AAOMgpczy7nAj0h9iQ7LD+Yt2T0hYAlHByZBrwNifiRaoDWoJVRPhujCcce/XjeLPDeYWgYYKSYfBg== X-Received: by 2002:a50:c201:: with SMTP id n1-v6mr19345584edf.11.1533581284548; Mon, 06 Aug 2018 11:48:04 -0700 (PDT) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com. [74.125.82.51]) by smtp.gmail.com with ESMTPSA id t44-v6sm7335903edb.79.2018.08.06.11.48.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 11:48:04 -0700 (PDT) Received: by mail-wm0-f51.google.com with SMTP id y9-v6so15454540wma.5; Mon, 06 Aug 2018 11:48:03 -0700 (PDT) X-Received: by 2002:a1c:1182:: with SMTP id 124-v6mr12665924wmr.75.1533581283797; Mon, 06 Aug 2018 11:48:03 -0700 (PDT) MIME-Version: 1.0 References: <201808061736.w76Hawt5009582@repo.freebsd.org> <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> In-Reply-To: <5A14A68E-CF0D-45DB-82DD-0AD32B388152@lists.zabbadoz.net> From: "Jonathan T. Looney" Date: Mon, 6 Aug 2018 14:47:52 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337384 - in head: share/man/man4 sys/netinet To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 18:48:11 -0000 On Mon, Aug 6, 2018 at 2:16 PM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > > On 6 Aug 2018, at 17:36, Jonathan T. Looney wrote: > > > Author: jtl > > Date: Mon Aug 6 17:36:57 2018 > > New Revision: 337384 > > URL: https://svnweb.freebsd.org/changeset/base/337384 > > > > Log: > > Address concerns about CPU usage while doing TCP reassembly. > =E2=80=A6 > > > > Reviewed by: jhb > > Approved by: so > > Security: FreeBSD-SA-18:08.tcp > > Security: CVE-2018-6922 > > > > Modified: > > head/share/man/man4/tcp.4 > > head/sys/netinet/tcp_reass.c > > > Would you mind bumping .Dd as well please? Done for head and the stable branches. I'll ask so@ about the releng branches. Jonathan From owner-svn-src-all@freebsd.org Mon Aug 6 19:09:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDEC7106244E; Mon, 6 Aug 2018 19:09:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733EB84ED9; Mon, 6 Aug 2018 19:09:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 500FE11188; Mon, 6 Aug 2018 19:09:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76J9u4B055838; Mon, 6 Aug 2018 19:09:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76J9udg055837; Mon, 6 Aug 2018 19:09:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808061909.w76J9udg055837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 19:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337393 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 337393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 19:09:56 -0000 Author: np Date: Mon Aug 6 19:09:55 2018 New Revision: 337393 URL: https://svnweb.freebsd.org/changeset/base/337393 Log: Fix typo in cxgbe/t4_tom. Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 18:47:03 2018 (r337392) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 19:09:55 2018 (r337393) @@ -198,7 +198,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par #ifdef RATELIMIT /* - * Input is Bytes/second (so_max_pacing-rate), chip counts in Kilobits/second. + * Input is Bytes/second (so_max_pacing_rate), chip counts in Kilobits/second. */ static int update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) From owner-svn-src-all@freebsd.org Mon Aug 6 19:21:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670D610628D3; Mon, 6 Aug 2018 19:21:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8D185779; Mon, 6 Aug 2018 19:21:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D4C11380; Mon, 6 Aug 2018 19:21:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76JLWcL062851; Mon, 6 Aug 2018 19:21:32 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76JLW44062850; Mon, 6 Aug 2018 19:21:32 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808061921.w76JLW44062850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 6 Aug 2018 19:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337394 - head/release X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 337394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 19:21:33 -0000 Author: cperciva Date: Mon Aug 6 19:21:32 2018 New Revision: 337394 URL: https://svnweb.freebsd.org/changeset/base/337394 Log: Add EC2PUBLICSNAP option to EC2 builds; this passes a (recently added) flag to bsdec2-image-upload instructing it to mark the snapshot of its root disk as public (which is independent from marking the created AMIs as public). Requested by: Amazon Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Mon Aug 6 19:09:55 2018 (r337393) +++ head/release/Makefile.ec2 Mon Aug 6 19:21:32 2018 (r337394) @@ -35,6 +35,9 @@ AMINAMESUFFIX!= date +-%Y-%m-%d .if defined(EC2PUBLIC) && !empty(EC2PUBLIC) PUBLISH= --public .endif +.if defined(EC2PUBLICSNAP) && !empty(EC2PUBLICSNAP) +PUBLISH= --publicsnap +.endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} @@ -79,7 +82,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @echo "--------------------------------------------------------------" @false .endif - /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov --ena \ + /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ From owner-svn-src-all@freebsd.org Mon Aug 6 20:39:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 488131064A77; Mon, 6 Aug 2018 20:39:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF07989E3A; Mon, 6 Aug 2018 20:39:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCBE81201E; Mon, 6 Aug 2018 20:39:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76KdS77005975; Mon, 6 Aug 2018 20:39:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76KdR2h005970; Mon, 6 Aug 2018 20:39:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808062039.w76KdR2h005970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 6 Aug 2018 20:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r337395 - in releng: 10.4 10.4/sys/conf 11.1 11.1/sys/conf 11.2 11.2/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in releng: 10.4 10.4/sys/conf 11.1 11.1/sys/conf 11.2 11.2/sys/conf X-SVN-Commit-Revision: 337395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 20:39:29 -0000 Author: delphij Date: Mon Aug 6 20:39:27 2018 New Revision: 337395 URL: https://svnweb.freebsd.org/changeset/base/337395 Log: Bump patch level and document them. Approved by: so Modified: releng/10.4/UPDATING releng/10.4/sys/conf/newvers.sh releng/11.1/UPDATING releng/11.1/sys/conf/newvers.sh releng/11.2/UPDATING releng/11.2/sys/conf/newvers.sh Modified: releng/10.4/UPDATING ============================================================================== --- releng/10.4/UPDATING Mon Aug 6 19:21:32 2018 (r337394) +++ releng/10.4/UPDATING Mon Aug 6 20:39:27 2018 (r337395) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG to b stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20180806 p10 FreeBSD-SA-18:08.tcp + + Fix resource exhaustion in TCP reassembly. + 20180508 p9 FreeBSD-SA-18:06.debugreg FreeBSD-EN-18:05.mem FreeBSD-EN-18:06.tzdata Modified: releng/10.4/sys/conf/newvers.sh ============================================================================== --- releng/10.4/sys/conf/newvers.sh Mon Aug 6 19:21:32 2018 (r337394) +++ releng/10.4/sys/conf/newvers.sh Mon Aug 6 20:39:27 2018 (r337395) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="10.4" -BRANCH="RELEASE-p9" +BRANCH="RELEASE-p10" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.1/UPDATING ============================================================================== --- releng/11.1/UPDATING Mon Aug 6 19:21:32 2018 (r337394) +++ releng/11.1/UPDATING Mon Aug 6 20:39:27 2018 (r337395) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180806 p12 FreeBSD-SA-18:08.tcp + + Fix resource exhaustion in TCP reassembly. + 20180621 p11 FreeBSD-SA-18:07.lazyfpu FreeBSD-EN-18:07.pmap Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Mon Aug 6 19:21:32 2018 (r337394) +++ releng/11.1/sys/conf/newvers.sh Mon Aug 6 20:39:27 2018 (r337395) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RELEASE-p11" +BRANCH="RELEASE-p12" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.2/UPDATING ============================================================================== --- releng/11.2/UPDATING Mon Aug 6 19:21:32 2018 (r337394) +++ releng/11.2/UPDATING Mon Aug 6 20:39:27 2018 (r337395) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20180806 p1 FreeBSD-SA-18:08.tcp + + Fix resource exhaustion in TCP reassembly. + 20180627: 11.2-RELEASE. Modified: releng/11.2/sys/conf/newvers.sh ============================================================================== --- releng/11.2/sys/conf/newvers.sh Mon Aug 6 19:21:32 2018 (r337394) +++ releng/11.2/sys/conf/newvers.sh Mon Aug 6 20:39:27 2018 (r337395) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Mon Aug 6 21:09:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA338106641F; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FDCB8BBFB; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6043A12501; Mon, 6 Aug 2018 21:09:13 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76L9DWN021625; Mon, 6 Aug 2018 21:09:13 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76L9B9h021616; Mon, 6 Aug 2018 21:09:11 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808062109.w76L9B9h021616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 6 Aug 2018 21:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337396 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 337396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 21:09:14 -0000 Author: mckusick Date: Mon Aug 6 21:09:11 2018 New Revision: 337396 URL: https://svnweb.freebsd.org/changeset/base/337396 Log: Put in place the framework for consolodating contiguous blocks into a smaller number of larger TRIM requests. The hope had been to have the full TRIM consolodation in place for 12.0, but the algorithms are still under development and need further testing. With this framework in place it will be possible to easily add TRIM consolodation once the optimal strategy has been found. The only functional change with this patch is the elimination of TRIM requests for blocks that are freed before they have been likely to have been written. Reviewed by: kib Discussed with: Warner Losh and Chuck Silvers Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Aug 6 21:09:11 2018 (r337396) @@ -110,8 +110,6 @@ static ufs2_daddr_t static void ffs_blkfree_cg(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, struct workhead *); -static void ffs_blkfree_trim_completed(struct buf *); -static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -395,8 +393,23 @@ retry: if (bno > 0) { bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, bprev, (long)osize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) @@ -521,7 +534,7 @@ ffs_reallocblks_ufs1(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs1_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -730,14 +743,29 @@ ffs_reallocblks_ufs1(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -771,7 +799,7 @@ ffs_reallocblks_ufs2(ap) struct fs *fs; struct inode *ip; struct vnode *vp; - struct buf *sbp, *ebp; + struct buf *sbp, *ebp, *bp; ufs2_daddr_t *bap, *sbap, *ebap; struct cluster_save *buflist; struct ufsmount *ump; @@ -978,14 +1006,29 @@ ffs_reallocblks_ufs2(ap) printf("\n\tnew:"); #endif for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { + bp = buflist->bs_children[i]; if (!DOINGSOFTDEP(vp)) + /* + * The usual case is that a set of N-contiguous blocks + * that was just allocated has been replaced with a + * set of N+1-contiguous blocks. If they are marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the blocks were written + * earlier, but very uncommon. If the blocks have never + * been written, there is no need to send a BIO_DELETE + * for them when they are freed. The gain from avoiding + * the TRIMs for the common case of unwritten blocks + * far exceeds the cost of the write amplification for + * the uncommon case of failing to send a TRIM for the + * blocks that had been written. + */ ffs_blkfree(ump, fs, ump->um_devvp, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, vp->v_type, NULL); - buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); + dbtofsb(fs, bp->b_blkno), + fs->fs_bsize, ip->i_number, vp->v_type, NULL, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); + bp->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS - if (!ffs_checkblk(ip, - dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) + if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif #ifdef DEBUG @@ -1823,8 +1866,7 @@ gotit: /* XXX Fixme. */ UFS_UNLOCK(ump); if (DOINGSOFTDEP(ITOV(ip))) - softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, - size, 0); + softdep_setup_blkmapdep(bp, UFSTOVFS(ump), blkno, size, 0); UFS_LOCK(ump); return (blkno); } @@ -2254,6 +2296,17 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) bdwrite(bp); } +/* + * Structures and routines associated with trim management. + */ +MALLOC_DEFINE(M_TRIM, "ufs_trim", "UFS trim structures"); + +#define TRIMLIST_HASH(ump, inum) \ + (&(ump)->um_trimhash[(inum) & (ump)->um_trimlisthashsize]) + +static void ffs_blkfree_trim_completed(struct buf *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); + struct ffs_blkfree_trim_params { struct task task; struct ufsmount *ump; @@ -2277,7 +2330,7 @@ ffs_blkfree_trim_task(ctx, pending) tp->inum, tp->pdephd); vn_finished_secondary_write(UFSTOVFS(tp->ump)); atomic_add_int(&tp->ump->um_trim_inflight, -1); - free(tp, M_TEMP); + free(tp, M_TRIM); } static void @@ -2287,13 +2340,13 @@ ffs_blkfree_trim_completed(bp) struct ffs_blkfree_trim_params *tp; tp = bp->b_fsprivate1; - free(bp, M_TEMP); + free(bp, M_TRIM); TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); taskqueue_enqueue(tp->ump->um_trim_tq, &tp->task); } void -ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) +ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd, trimtype) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; @@ -2302,6 +2355,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de ino_t inum; enum vtype vtype; struct workhead *dephd; + int trimtype; { struct mount *mp; struct buf *bp; @@ -2319,10 +2373,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de return; } /* - * Nothing to delay if TRIM is disabled, or the operation is - * performed on the snapshot. + * Nothing to delay if TRIM is not required for this block or TRIM + * is disabled or the operation is performed on a snapshot. */ - if (((ump->um_flags) & UM_CANDELETE) == 0 || devvp->v_type == VREG) { + if (trimtype == NOTRIM || ((ump->um_flags & UM_CANDELETE) == 0) || + devvp->v_type == VREG) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; } @@ -2334,7 +2389,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de * and write some new data into it. */ atomic_add_int(&ump->um_trim_inflight, 1); - tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TRIM, M_WAITOK); tp->ump = ump; tp->devvp = devvp; tp->bno = bno; @@ -2347,7 +2402,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, de } else tp->pdephd = NULL; - bp = malloc(sizeof(*bp), M_TEMP, M_WAITOK | M_ZERO); + bp = malloc(sizeof(*bp), M_TRIM, M_WAITOK | M_ZERO); bp->b_iocmd = BIO_DELETE; bp->b_iooffset = dbtob(fsbtodb(fs, bno)); bp->b_iodone = ffs_blkfree_trim_completed; @@ -2824,7 +2879,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) long blkcnt, blksize; struct file *fp, *vfp; cap_rights_t rights; - int filetype, error; + int filetype, trimtype, error; static struct fileops *origops, bufferedops; if (req->newlen > sizeof cmd) @@ -2956,14 +3011,17 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) blkno = cmd.value; blkcnt = cmd.size; blksize = fs->fs_frag - (blkno % fs->fs_frag); + trimtype = (blksize < blkcnt) ? STARTFREE : SINGLETON; while (blkcnt > 0) { if (blksize > blkcnt) blksize = blkcnt; ffs_blkfree(ump, fs, ump->um_devvp, blkno, - blksize * fs->fs_fsize, UFS_ROOTINO, VDIR, NULL); + blksize * fs->fs_fsize, UFS_ROOTINO, + VDIR, NULL, trimtype); blkno += blksize; blkcnt -= blksize; blksize = fs->fs_frag; + trimtype = (blksize < blkcnt) ? CONTINUEFREE : ENDFREE; } break; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_balloc.c Mon Aug 6 21:09:11 2018 (r337396) @@ -553,7 +553,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON); } return (error); } @@ -1147,7 +1147,7 @@ fail: lbns_remfree++; #endif ffs_blkfree(ump, fs, ump->um_devvp, *blkp, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, SINGLETON); } return (error); } Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_extern.h Mon Aug 6 21:09:11 2018 (r337396) @@ -63,7 +63,7 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_starto struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, - ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); + ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *, int); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -111,10 +111,27 @@ vfs_vget_t ffs_vget; int ffs_vgetf(struct mount *, ino_t, int, struct vnode **, int); void process_deferred_inactive(struct mount *mp); +/* + * Flags to ffs_vgetf + */ #define FFSV_FORCEINSMQ 0x0001 +/* + * Flags to ffs_reload + */ #define FFSR_FORCE 0x0001 #define FFSR_UNSUSPEND 0x0002 + +/* + * Trim type to ffs_blkfree - used to help with BIO_DELETE (trim) requests + */ +#define NOTRIM 1 /* never written, so don't call trim for it */ +#define SINGLETON 2 /* only block being freed, so trim it now */ +#define STARTFREE 3 /* beginning to free for this inum */ +#define CONTINUEFREE 4 /* additional block free for this inum */ +#define ENDFREE 5 /* last block to free for this inum */ + +#define MAXTRIMIO 1024 /* maximum expected outstanding trim requests */ extern struct vop_vector ffs_vnodeops1; extern struct vop_vector ffs_fifoops1; Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_inode.c Mon Aug 6 21:09:11 2018 (r337396) @@ -195,7 +195,7 @@ ffs_truncate(vp, length, flags, cred) struct ufsmount *ump; int softdeptrunc, journaltrunc; int needextclean, extblocks; - int offset, size, level, nblocks; + int trimtype, firstfree, offset, size, level, nblocks; int i, error, allerror, indiroff, waitforupdate; off_t osize; @@ -275,7 +275,7 @@ ffs_truncate(vp, length, flags, cred) continue; ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], sblksize(fs, osize, i), ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } } } @@ -523,7 +523,7 @@ ffs_truncate(vp, length, flags, cred) DIP_SET(ip, i_ib[level], 0); ffs_blkfree(ump, fs, ump->um_devvp, bn, fs->fs_bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); blocksreleased += nblocks; } } @@ -534,6 +534,7 @@ ffs_truncate(vp, length, flags, cred) /* * All whole direct blocks or frags. */ + firstfree = 1; for (i = UFS_NDADDR - 1; i > lastblock; i--) { long bsize; @@ -542,8 +543,23 @@ ffs_truncate(vp, length, flags, cred) continue; DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); + if (firstfree) { + if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i - 1 == lastblock || DIP(ip, i_db[i - 1]) == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, - vp->v_type, NULL); + vp->v_type, NULL, trimtype); blocksreleased += btodb(bsize); } if (lastblock < 0) @@ -575,7 +591,8 @@ ffs_truncate(vp, length, flags, cred) */ bn += numfrags(fs, newspace); ffs_blkfree(ump, fs, ump->um_devvp, bn, - oldspace - newspace, ip->i_number, vp->v_type, NULL); + oldspace - newspace, ip->i_number, vp->v_type, + NULL, SINGLETON); blocksreleased += btodb(oldspace - newspace); } } @@ -636,7 +653,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) struct fs *fs; struct vnode *vp; caddr_t copy = NULL; - int i, nblocks, error = 0, allerror = 0; + int i, trimtype, nblocks, firstfree, error = 0, allerror = 0; ufs2_daddr_t nb, nlbn, last; ufs2_daddr_t blkcount, factor, blocksreleased = 0; ufs1_daddr_t *bap1 = NULL; @@ -719,6 +736,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) /* * Recursively free totally unused blocks. */ + firstfree = 1; for (i = NINDIR(fs) - 1, nlbn = lbn + 1 - i * factor; i > last; i--, nlbn += factor) { nb = BAP(ip, i); @@ -730,8 +748,23 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, level, countp) allerror = error; blocksreleased += blkcount; } + if (firstfree) { + if (i - 1 == last || BAP(ip, i - 1) == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i - 1 == last || BAP(ip, i - 1) == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ITOUMP(ip), fs, ITODEVVP(ip), nb, fs->fs_bsize, - ip->i_number, vp->v_type, NULL); + ip->i_number, vp->v_type, NULL, trimtype); blocksreleased += nblocks; } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_snapshot.c Mon Aug 6 21:09:11 2018 (r337396) @@ -583,7 +583,7 @@ loop: if (len != 0 && len < fs->fs_bsize) { ffs_blkfree(ump, copy_fs, vp, DIP(xp, i_db[loc]), len, xp->i_number, - xvp->v_type, NULL); + xvp->v_type, NULL, SINGLETON); blkno = DIP(xp, i_db[loc]); DIP_SET(xp, i_db[loc], 0); } @@ -1265,7 +1265,7 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } return (0); } @@ -1549,7 +1549,7 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expung if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); ffs_blkfree(ITOUMP(ip), fs, vp, blkno, fs->fs_bsize, inum, - vp->v_type, NULL); + vp->v_type, NULL, SINGLETON); } return (0); } Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Aug 6 21:09:11 2018 (r337396) @@ -869,7 +869,7 @@ static void cancel_allocdirect(struct allocdirectlst * struct allocdirect *, struct freeblks *); static int check_inode_unwritten(struct inodedep *); static int free_inodedep(struct inodedep *); -static void freework_freeblock(struct freework *); +static void freework_freeblock(struct freework *, int); static void freework_enqueue(struct freework *); static int handle_workitem_freeblocks(struct freeblks *, int); static int handle_complete_freeblocks(struct freeblks *, int); @@ -884,7 +884,7 @@ static struct allocindir *newallocindir(struct inode * ufs2_daddr_t, ufs_lbn_t); static void handle_workitem_freefrag(struct freefrag *); static struct freefrag *newfreefrag(struct inode *, ufs2_daddr_t, long, - ufs_lbn_t); + ufs_lbn_t, int); static void allocdirect_merge(struct allocdirectlst *, struct allocdirect *, struct allocdirect *); static struct freefrag *allocindir_merge(struct allocindir *, @@ -5289,7 +5289,22 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, KASSERT(MOUNTEDSOFTDEP(mp) != 0, ("softdep_setup_allocdirect called on non-softdep filesystem")); if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); else freefrag = NULL; @@ -5566,11 +5581,12 @@ newjfreefrag(freefrag, ip, blkno, size, lbn) * Allocate a new freefrag structure. */ static struct freefrag * -newfreefrag(ip, blkno, size, lbn) +newfreefrag(ip, blkno, size, lbn, trimtype) struct inode *ip; ufs2_daddr_t blkno; long size; ufs_lbn_t lbn; + int trimtype; { struct freefrag *freefrag; struct ufsmount *ump; @@ -5591,6 +5607,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_vtype = ITOV(ip)->v_type; freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; + freefrag->ff_trimtype = trimtype; if (MOUNTEDSUJ(UFSTOVFS(ump))) { freefrag->ff_jdep = (struct worklist *) @@ -5636,7 +5653,8 @@ handle_workitem_freefrag(freefrag) } FREE_LOCK(ump); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, - freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); + freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd, + freefrag->ff_trimtype); ACQUIRE_LOCK(ump); WORKITEM_FREE(freefrag, D_FREEFRAG); FREE_LOCK(ump); @@ -5676,7 +5694,22 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, ne lbn = bp->b_lblkno; if (oldblkno && oldblkno != newblkno) - freefrag = newfreefrag(ip, oldblkno, oldsize, lbn); + /* + * The usual case is that a smaller fragment that + * was just allocated has been replaced with a bigger + * fragment or a full-size block. If it is marked as + * B_DELWRI, the current contents have not been written + * to disk. It is possible that the block was written + * earlier, but very uncommon. If the block has never + * been written, there is no need to send a BIO_DELETE + * for it when it is freed. The gain from avoiding the + * TRIMs for the common case of unwritten blocks far + * exceeds the cost of the write amplification for the + * uncommon case of failing to send a TRIM for a block + * that had been written. + */ + freefrag = newfreefrag(ip, oldblkno, oldsize, lbn, + (bp->b_flags & B_DELWRI) != 0 ? NOTRIM : SINGLETON); else freefrag = NULL; @@ -5789,7 +5822,8 @@ newallocindir(ip, ptrno, newblkno, oldblkno, lbn) struct jnewblk *jnewblk; if (oldblkno) - freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn); + freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn, + SINGLETON); else freefrag = NULL; ACQUIRE_LOCK(ITOUMP(ip)); @@ -7724,8 +7758,9 @@ free_inodedep(inodedep) * in memory immediately. */ static void -freework_freeblock(freework) +freework_freeblock(freework, trimtype) struct freework *freework; + int trimtype; { struct freeblks *freeblks; struct jnewblk *jnewblk; @@ -7779,10 +7814,10 @@ freework_freeblock(freework) FREE_LOCK(ump); freeblks_free(ump, freeblks, btodb(bsize)); CTR4(KTR_SUJ, - "freework_freeblock: ino %d blkno %jd lbn %jd size %ld", + "freework_freeblock: ino %jd blkno %jd lbn %jd size %d", freeblks->fb_inum, freework->fw_blkno, freework->fw_lbn, bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, - freeblks->fb_inum, freeblks->fb_vtype, &wkhd); + freeblks->fb_inum, freeblks->fb_vtype, &wkhd, trimtype); ACQUIRE_LOCK(ump); /* * The jnewblk will be discarded and the bits in the map never @@ -7835,7 +7870,7 @@ handle_workitem_indirblk(freework) return; } if (freework->fw_off == NINDIR(fs)) { - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON); return; } freework->fw_state |= INPROGRESS; @@ -7889,16 +7924,19 @@ handle_workitem_freeblocks(freeblks, flags) struct freeblks *freeblks; int flags; { - struct freework *freework; + struct freework *freework, *prevfreework; struct newblk *newblk; struct allocindir *aip; struct ufsmount *ump; struct worklist *wk; + int trimtype; KASSERT(LIST_EMPTY(&freeblks->fb_jblkdephd), ("handle_workitem_freeblocks: Journal entries not written.")); ump = VFSTOUFS(freeblks->fb_list.wk_mp); ACQUIRE_LOCK(ump); + prevfreework = NULL; + trimtype = 0; while ((wk = LIST_FIRST(&freeblks->fb_freeworkhd)) != NULL) { WORKLIST_REMOVE(wk); switch (wk->wk_type) { @@ -7932,16 +7970,26 @@ handle_workitem_freeblocks(freeblks, flags) case D_FREEWORK: freework = WK_FREEWORK(wk); - if (freework->fw_lbn <= -UFS_NDADDR) + if (freework->fw_lbn <= -UFS_NDADDR) { handle_workitem_indirblk(freework); - else - freework_freeblock(freework); + continue; + } else if (prevfreework == NULL) { + trimtype = SINGLETON; + } else if (trimtype == SINGLETON) { + freework_freeblock(prevfreework, STARTFREE); + trimtype = ENDFREE; + } else { + freework_freeblock(prevfreework, CONTINUEFREE); + } + prevfreework = freework; continue; default: panic("handle_workitem_freeblocks: Unknown type %s", TYPENAME(wk->wk_type)); } } + if (prevfreework != NULL) + freework_freeblock(prevfreework, trimtype); if (freeblks->fb_ref != 0) { freeblks->fb_state &= ~INPROGRESS; wake_worklist(&freeblks->fb_list); @@ -8080,13 +8128,8 @@ indir_trunc(freework, dbn, lbn) ufs1_daddr_t *bap1; ufs2_daddr_t nb, nnb, *bap2; ufs_lbn_t lbnadd, nlbn; - int i, nblocks, ufs1fmt; - int freedblocks; - int goingaway; - int freedeps; - int needj; - int level; - int cnt; + int nblocks, ufs1fmt, firstfree, trimtype, freedblocks; + int goingaway, freedeps, needj, level, cnt, i; freeblks = freework->fw_freeblks; ump = VFSTOUFS(freeblks->fb_list.wk_mp); @@ -8180,6 +8223,7 @@ indir_trunc(freework, dbn, lbn) * arranges for the current level to be freed when subordinates * are free when journaling. */ + firstfree = 1; for (i = freework->fw_off; i < NINDIR(fs); i++, nb = nnb) { if (i != NINDIR(fs) - 1) { if (ufs1fmt) @@ -8215,11 +8259,26 @@ indir_trunc(freework, dbn, lbn) freedeps++; } CTR3(KTR_SUJ, - "indir_trunc: ino %d blkno %jd size %ld", + "indir_trunc: ino %jd blkno %jd size %d", freeblks->fb_inum, nb, fs->fs_bsize); + if (firstfree) { + if (i == NINDIR(fs) - 1 || nnb == 0) { + trimtype = SINGLETON; + } else { + trimtype = STARTFREE; + firstfree = 0; + } + } else { + if (i == NINDIR(fs) - 1 || nnb == 0) { + trimtype = ENDFREE; + firstfree = 1; + } else { + trimtype = CONTINUEFREE; + } + } ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, fs->fs_bsize, freeblks->fb_inum, - freeblks->fb_vtype, &wkhd); + freeblks->fb_vtype, &wkhd, trimtype); } } if (goingaway) { @@ -8244,7 +8303,7 @@ indir_trunc(freework, dbn, lbn) if (level == 0) freeblks->fb_cgwait += freedeps; if (freework->fw_ref == 0) - freework_freeblock(freework); + freework_freeblock(freework, SINGLETON); FREE_LOCK(ump); return; } @@ -8253,10 +8312,10 @@ indir_trunc(freework, dbn, lbn) */ dbn = dbtofsb(fs, dbn); CTR3(KTR_SUJ, - "indir_trunc 2: ino %d blkno %jd size %ld", + "indir_trunc 2: ino %jd blkno %jd size %d", freeblks->fb_inum, dbn, fs->fs_bsize); ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_inum, freeblks->fb_vtype, NULL); + freeblks->fb_inum, freeblks->fb_vtype, NULL, SINGLETON); /* Non SUJ softdep does single-threaded truncations. */ if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Aug 6 21:09:11 2018 (r337396) @@ -978,6 +978,8 @@ ffs_mountfs(devvp, mp, td) taskqueue_thread_enqueue, &ump->um_trim_tq); taskqueue_start_threads(&ump->um_trim_tq, 1, PVFS, "%s trim", mp->mnt_stat.f_mntonname); + ump->um_trimhash = hashinit(MAXTRIMIO, M_TRIM, + &ump->um_trimlisthashsize); } } @@ -1256,6 +1258,7 @@ ffs_unmount(mp, mntflags) pause("ufsutr", hz); taskqueue_drain_all(ump->um_trim_tq); taskqueue_free(ump->um_trim_tq); + free (ump->um_trimhash, M_TRIM); } g_topology_lock(); if (ump->um_fsckpid > 0) { Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ffs/softdep.h Mon Aug 6 21:09:11 2018 (r337396) @@ -557,6 +557,7 @@ struct freefrag { long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ enum vtype ff_vtype; /* owning inode's file type */ + int ff_trimtype; /* trim status when deleted */ }; /* Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Mon Aug 6 20:39:27 2018 (r337395) +++ head/sys/ufs/ufs/ufsmount.h Mon Aug 6 21:09:11 2018 (r337396) @@ -47,6 +47,7 @@ struct ufs_args { #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_UFSMNT); +MALLOC_DECLARE(M_TRIM); #endif struct buf; @@ -63,6 +64,7 @@ struct inodedep; TAILQ_HEAD(inodedeplst, inodedep); LIST_HEAD(bmsafemaphd, bmsafemap); +LIST_HEAD(trimlist_hashhead, ffs_blkfree_trim_params); /* * This structure describes the UFS specific mount structure data. @@ -101,6 +103,8 @@ struct ufsmount { u_int um_flags; /* (i) filesystem flags */ u_int um_trim_inflight; /* (a) outstanding trim count */ struct taskqueue *um_trim_tq; /* (c) trim request queue */ + struct trimlist_hashhead *um_trimhash; /* (i) trimlist hash table */ + u_long um_trimlisthashsize; /* (i) trim hash table size-1 */ /* (c) - below function ptrs */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); From owner-svn-src-all@freebsd.org Mon Aug 6 21:54:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817C2106732A; Mon, 6 Aug 2018 21:54:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357078D76B; Mon, 6 Aug 2018 21:54:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F318112CF9; Mon, 6 Aug 2018 21:54:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76LspU8046851; Mon, 6 Aug 2018 21:54:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76LspwN046850; Mon, 6 Aug 2018 21:54:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808062154.w76LspwN046850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 21:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337397 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 21:54:52 -0000 Author: np Date: Mon Aug 6 21:54:51 2018 New Revision: 337397 URL: https://svnweb.freebsd.org/changeset/base/337397 Log: cxgbe(4): Break up sysctl_bitfield into 8 bit and 16 bit variants. Have them display the current value of the bitfield rather than the fixed value that was provided when the sysctl node was created. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:09:11 2018 (r337396) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:54:51 2018 (r337397) @@ -547,7 +547,8 @@ static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); -static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); @@ -5454,8 +5455,8 @@ t4_sysctls(struct adapter *sc) sc->params.nports, "# of ports"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, - sysctl_bitfield, "A", "available doorbells"); + CTLTYPE_STRING | CTLFLAG_RD, doorbells, (uintptr_t)&sc->doorbells, + sysctl_bitfield_8b, "A", "available doorbells"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, sc->params.vpd.cclk, "core clock frequency (in KHz)"); @@ -5526,8 +5527,8 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ - CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text " capabilities") + CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], (uintptr_t)&sc->name, \ + sysctl_bitfield_16b, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -6215,7 +6216,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) } static int -sysctl_bitfield(SYSCTL_HANDLER_ARGS) +sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS) { int rc; struct sbuf *sb; @@ -6228,7 +6229,28 @@ sysctl_bitfield(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "%b", (int)arg2, (char *)arg1); + sbuf_printf(sb, "%b", *(uint8_t *)(uintptr_t)arg2, (char *)arg1); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + +static int +sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS) +{ + int rc; + struct sbuf *sb; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "%b", *(uint16_t *)(uintptr_t)arg2, (char *)arg1); rc = sbuf_finish(sb); sbuf_delete(sb); From owner-svn-src-all@freebsd.org Mon Aug 6 23:21:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 470501069357; Mon, 6 Aug 2018 23:21:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDA70704AC; Mon, 6 Aug 2018 23:21:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEABE139EA; Mon, 6 Aug 2018 23:21:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76NLEPF092045; Mon, 6 Aug 2018 23:21:14 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76NLDO6092038; Mon, 6 Aug 2018 23:21:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808062321.w76NLDO6092038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 6 Aug 2018 23:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337398 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 337398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 23:21:15 -0000 Author: np Date: Mon Aug 6 23:21:13 2018 New Revision: 337398 URL: https://svnweb.freebsd.org/changeset/base/337398 Log: cxgbe(4): Allow user-configured and driver-configured traffic classes to be used simultaneously. Move sysctl_tc and sysctl_tc_params to t4_sched.c while here. MFC after: 3 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/adapter.h Mon Aug 6 23:21:13 2018 (r337398) @@ -235,13 +235,15 @@ struct tx_ch_rl_params { }; enum { - TX_CLRL_REFRESH = (1 << 0), /* Need to update hardware state. */ - TX_CLRL_ERROR = (1 << 1), /* Error, hardware state unknown. */ + CLRL_USER = (1 << 0), /* allocated manually. */ + CLRL_SYNC = (1 << 1), /* sync hw update in progress. */ + CLRL_ASYNC = (1 << 2), /* async hw update requested. */ + CLRL_ERR = (1 << 3), /* last hw setup ended in error. */ }; struct tx_cl_rl_params { int refcount; - u_int flags; + uint8_t flags; enum fw_sched_params_rate ratemode; /* %port REL or ABS value */ enum fw_sched_params_unit rateunit; /* kbps or pps (when ABS) */ enum fw_sched_params_mode mode; /* aggr or per-flow */ @@ -1237,7 +1239,9 @@ int t4_init_tx_sched(struct adapter *); int t4_free_tx_sched(struct adapter *); void t4_update_tx_sched(struct adapter *); int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); -void t4_release_cl_rl_kbps(struct adapter *, int, int); +void t4_release_cl_rl(struct adapter *, int, int); +int sysctl_tc(SYSCTL_HANDLER_ARGS); +int sysctl_tc_params(SYSCTL_HANDLER_ARGS); #ifdef RATELIMIT void t4_init_etid_table(struct adapter *); void t4_free_etid_table(struct adapter *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 6 23:21:13 2018 (r337398) @@ -589,7 +589,6 @@ static int sysctl_tp_la(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); -static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); @@ -5963,6 +5962,7 @@ cxgbe_sysctls(struct port_info *pi) struct adapter *sc = pi->adapter; int i; char name[16]; + static char *tc_flags = {"\20\1USER\2SYNC\3ASYNC\4ERR"}; ctx = device_get_sysctl_ctx(pi->dev); @@ -6015,8 +6015,9 @@ cxgbe_sysctls(struct port_info *pi) children2 = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD, NULL, "traffic class")); - SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "flags", CTLFLAG_RD, - &tc->flags, 0, "flags"); + SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "flags", + CTLTYPE_STRING | CTLFLAG_RD, tc_flags, (uintptr_t)&tc->flags, + sysctl_bitfield_8b, "A", "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", @@ -8607,83 +8608,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) } } rc = sbuf_finish(sb); - sbuf_delete(sb); - - return (rc); -} - -static int -sysctl_tc_params(SYSCTL_HANDLER_ARGS) -{ - struct adapter *sc = arg1; - struct tx_cl_rl_params tc; - struct sbuf *sb; - int i, rc, port_id, mbps, gbps; - - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); - if (sb == NULL) - return (ENOMEM); - - port_id = arg2 >> 16; - MPASS(port_id < sc->params.nports); - MPASS(sc->port[port_id] != NULL); - i = arg2 & 0xffff; - MPASS(i < sc->chip_params->nsched_cls); - - mtx_lock(&sc->tc_lock); - tc = sc->port[port_id]->sched_params->cl_rl[i]; - mtx_unlock(&sc->tc_lock); - - switch (tc.rateunit) { - case SCHED_CLASS_RATEUNIT_BITS: - switch (tc.ratemode) { - case SCHED_CLASS_RATEMODE_REL: - /* XXX: top speed or actual link speed? */ - gbps = port_top_speed(sc->port[port_id]); - sbuf_printf(sb, "%u%% of %uGbps", tc.maxrate, gbps); - break; - case SCHED_CLASS_RATEMODE_ABS: - mbps = tc.maxrate / 1000; - gbps = tc.maxrate / 1000000; - if (tc.maxrate == gbps * 1000000) - sbuf_printf(sb, "%uGbps", gbps); - else if (tc.maxrate == mbps * 1000) - sbuf_printf(sb, "%uMbps", mbps); - else - sbuf_printf(sb, "%uKbps", tc.maxrate); - break; - default: - rc = ENXIO; - goto done; - } - break; - case SCHED_CLASS_RATEUNIT_PKTS: - sbuf_printf(sb, "%upps", tc.maxrate); - break; - default: - rc = ENXIO; - goto done; - } - - switch (tc.mode) { - case SCHED_CLASS_MODE_CLASS: - sbuf_printf(sb, " aggregate"); - break; - case SCHED_CLASS_MODE_FLOW: - sbuf_printf(sb, " per-flow"); - break; - default: - rc = ENXIO; - goto done; - } - -done: - if (rc == 0) - rc = sbuf_finish(sb); sbuf_delete(sb); return (rc); Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_sched.c Mon Aug 6 23:21:13 2018 (r337398) @@ -75,7 +75,7 @@ set_sched_class_params(struct adapter *sc, struct t4_s { int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode; struct port_info *pi; - struct tx_cl_rl_params *tc; + struct tx_cl_rl_params *tc, old; bool check_pktsize = false; if (p->level == SCHED_CLASS_LEVEL_CL_RL) @@ -179,43 +179,62 @@ set_sched_class_params(struct adapter *sc, struct t4_s return (ERANGE); } - rc = begin_synchronized_op(sc, NULL, - sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); - if (rc) - return (rc); if (p->level == SCHED_CLASS_LEVEL_CL_RL) { tc = &pi->sched_params->cl_rl[p->cl]; - if (tc->refcount > 0) { + mtx_lock(&sc->tc_lock); + if (tc->refcount > 0 || tc->flags & (CLRL_SYNC | CLRL_ASYNC)) rc = EBUSY; - goto done; - } else { + else { + tc->flags |= CLRL_SYNC | CLRL_USER; tc->ratemode = fw_ratemode; tc->rateunit = fw_rateunit; tc->mode = fw_mode; tc->maxrate = p->maxrate; tc->pktsize = p->pktsize; + rc = 0; + old= *tc; } + mtx_unlock(&sc->tc_lock); + if (rc != 0) + return (rc); } + + rc = begin_synchronized_op(sc, NULL, + sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); + if (rc != 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + *tc = old; + mtx_unlock(&sc->tc_lock); + } + return (rc); + } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, p->weight, p->pktsize, sleep_ok); - if (p->level == SCHED_CLASS_LEVEL_CL_RL && rc != 0) { - /* - * Unknown state at this point, see parameters in tc for what - * was attempted. - */ - tc->flags |= TX_CLRL_ERROR; - } -done: end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + MPASS(tc->flags & CLRL_SYNC); + MPASS(tc->flags & CLRL_USER); + MPASS(tc->refcount == 0); + + tc->flags &= ~CLRL_SYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; + mtx_unlock(&sc->tc_lock); + } + return (rc); } static void update_tx_sched(void *context, int pending) { - int i, j, mode, rateunit, ratemode, maxrate, pktsize, rc; + int i, j, rc; struct port_info *pi; struct tx_cl_rl_params *tc; struct adapter *sc = context; @@ -227,14 +246,8 @@ update_tx_sched(void *context, int pending) tc = &pi->sched_params->cl_rl[0]; for (j = 0; j < n; j++, tc++) { MPASS(mtx_owned(&sc->tc_lock)); - if ((tc->flags & TX_CLRL_REFRESH) == 0) + if ((tc->flags & CLRL_ASYNC) == 0) continue; - - mode = tc->mode; - rateunit = tc->rateunit; - ratemode = tc->ratemode; - maxrate = tc->maxrate; - pktsize = tc->pktsize; mtx_unlock(&sc->tc_lock); if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, @@ -242,21 +255,19 @@ update_tx_sched(void *context, int pending) mtx_lock(&sc->tc_lock); continue; } - rc = t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, - FW_SCHED_PARAMS_LEVEL_CL_RL, mode, rateunit, - ratemode, pi->tx_chan, j, 0, maxrate, 0, pktsize, - 1); + rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, + FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, + tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, + tc->pktsize, 1); end_synchronized_op(sc, 0); mtx_lock(&sc->tc_lock); - if (rc != 0) { - tc->flags |= TX_CLRL_ERROR; - } else if (tc->mode == mode && - tc->rateunit == rateunit && - tc->maxrate == maxrate && - tc->pktsize == tc->pktsize) { - tc->flags &= ~(TX_CLRL_REFRESH | TX_CLRL_ERROR); - } + MPASS(tc->flags & CLRL_ASYNC); + tc->flags &= ~CLRL_ASYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; } } mtx_unlock(&sc->tc_lock); @@ -278,74 +289,135 @@ t4_set_sched_class(struct adapter *sc, struct t4_sched return (EINVAL); } -int -t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +static int +bind_txq_to_traffic_class(struct adapter *sc, struct sge_txq *txq, int idx) { - struct port_info *pi = NULL; - struct vi_info *vi; - struct sge_txq *txq; - uint32_t fw_mnem, fw_queue, fw_class; - int i, rc; + struct tx_cl_rl_params *tc0, *tc; + int rc, old_idx; + uint32_t fw_mnem, fw_class; - rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsq"); - if (rc) - return (rc); + if (!(txq->eq.flags & EQ_ALLOCATED)) + return (EAGAIN); - if (p->port >= sc->params.nports) { - rc = EINVAL; + mtx_lock(&sc->tc_lock); + if (txq->tc_idx == -2) { + rc = EBUSY; /* Another bind/unbind in progress already. */ goto done; } - - /* XXX: Only supported for the main VI. */ - pi = sc->port[p->port]; - vi = &pi->vi[0]; - if (!(vi->flags & VI_INIT_DONE)) { - /* tx queues not set up yet */ - rc = EAGAIN; + if (idx == txq->tc_idx) { + rc = 0; /* No change, nothing to do. */ goto done; } - if (!in_range(p->queue, 0, vi->ntxq - 1) || - !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) { - rc = EINVAL; - goto done; + tc0 = &sc->port[txq->eq.tx_chan]->sched_params->cl_rl[0]; + if (idx != -1) { + /* + * Bind to a different class at index idx. + */ + tc = &tc0[idx]; + if (tc->flags & CLRL_ERR) { + rc = ENXIO; + goto done; + } else { + /* + * Ok to proceed. Place a reference on the new class + * while still holding on to the reference on the + * previous class, if any. + */ + tc->refcount++; + } } + /* Mark as busy before letting go of the lock. */ + old_idx = txq->tc_idx; + txq->tc_idx = -2; + mtx_unlock(&sc->tc_lock); - /* - * Create a template for the FW_PARAMS_CMD mnemonic and value (TX - * Scheduling Class in this case). - */ + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4btxq"); + if (rc != 0) + return (rc); fw_mnem = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH)); - fw_class = p->cl < 0 ? 0xffffffff : p->cl; + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | + V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); + fw_class = idx < 0 ? 0xffffffff : idx; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_mnem, &fw_class); + end_synchronized_op(sc, 0); - /* - * If op.queue is non-negative, then we're only changing the scheduling - * on a single specified TX queue. - */ - if (p->queue >= 0) { - txq = &sc->sge.txq[vi->first_txq + p->queue]; - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - goto done; + mtx_lock(&sc->tc_lock); + MPASS(txq->tc_idx == -2); + if (rc == 0) { + /* + * Unbind, bind, or bind to a different class succeeded. Remove + * the reference on the old traffic class, if any. + */ + if (old_idx != -1) { + tc = &tc0[old_idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = idx; + } else { + /* + * Unbind, bind, or bind to a different class failed. Remove + * the anticipatory reference on the new traffic class, if any. + */ + if (idx != -1) { + tc = &tc0[idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = old_idx; } +done: + MPASS(txq->tc_idx >= -1 && txq->tc_idx < sc->chip_params->nsched_cls); + mtx_unlock(&sc->tc_lock); + return (rc); +} +int +t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +{ + struct port_info *pi = NULL; + struct vi_info *vi; + struct sge_txq *txq; + int i, rc; + + if (p->port >= sc->params.nports) + return (EINVAL); + /* - * Change the scheduling on all the TX queues for the - * interface. + * XXX: cxgbetool allows the user to specify the physical port only. So + * we always operate on the main VI. */ - for_each_txq(vi, i, txq) { - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - if (rc) - goto done; + pi = sc->port[p->port]; + vi = &pi->vi[0]; + + /* Checking VI_INIT_DONE outside a synch-op is a harmless race here. */ + if (!(vi->flags & VI_INIT_DONE)) + return (EAGAIN); + + if (!in_range(p->queue, 0, vi->ntxq - 1) || + !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + if (p->queue < 0) { + /* + * Change the scheduling on all the TX queues for the + * interface. + */ + for_each_txq(vi, i, txq) { + rc = bind_txq_to_traffic_class(sc, txq, p->cl); + if (rc != 0) + break; + } + } else { + /* + * If op.queue is non-negative, then we're only changing the + * scheduling on a single specified TX queue. + */ + txq = &sc->sge.txq[vi->first_txq + p->queue]; + rc = bind_txq_to_traffic_class(sc, txq, p->cl); } - rc = 0; -done: - end_synchronized_op(sc, 0); return (rc); } @@ -372,10 +444,8 @@ t4_init_tx_sched(struct adapter *sc) tc->maxrate = 1000 * 1000; /* 1 Gbps. Arbitrary */ if (t4_sched_params_cl_rl_kbps(sc, pi->tx_chan, j, - tc->mode, tc->maxrate, tc->pktsize, 1) == 0) - tc->flags = 0; - else - tc->flags = TX_CLRL_ERROR; + tc->mode, tc->maxrate, tc->pktsize, 1) != 0) + tc->flags = CLRL_ERR; } } @@ -412,49 +482,61 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, int *tc_idx) { int rc = 0, fa = -1, i; + bool update; struct tx_cl_rl_params *tc; + struct port_info *pi; MPASS(port_id >= 0 && port_id < sc->params.nports); - tc = &sc->port[port_id]->sched_params->cl_rl[0]; + pi = sc->port[port_id]; + tc = &pi->sched_params->cl_rl[0]; + update = false; mtx_lock(&sc->tc_lock); for (i = 0; i < sc->chip_params->nsched_cls; i++, tc++) { - if (fa < 0 && tc->refcount == 0) - fa = i; + if (fa < 0 && tc->refcount == 0 && !(tc->flags & CLRL_USER)) + fa = i; /* first available */ if (tc->ratemode == FW_SCHED_PARAMS_RATE_ABS && tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE && tc->mode == FW_SCHED_PARAMS_MODE_FLOW && - tc->maxrate == maxrate) { + tc->maxrate == maxrate && + tc->pktsize == pi->vi[0].ifp->if_mtu) { tc->refcount++; *tc_idx = i; + if ((tc->flags & (CLRL_ERR | CLRL_ASYNC | CLRL_SYNC)) == + CLRL_ERR) { + update = true; + } goto done; } } /* Not found */ MPASS(i == sc->chip_params->nsched_cls); if (fa != -1) { - tc = &sc->port[port_id]->sched_params->cl_rl[fa]; - tc->flags = TX_CLRL_REFRESH; + tc = &pi->sched_params->cl_rl[fa]; tc->refcount = 1; tc->ratemode = FW_SCHED_PARAMS_RATE_ABS; tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; tc->mode = FW_SCHED_PARAMS_MODE_FLOW; tc->maxrate = maxrate; - tc->pktsize = ETHERMTU; /* XXX */ + tc->pktsize = pi->vi[0].ifp->if_mtu; *tc_idx = fa; - t4_update_tx_sched(sc); + update = true; } else { *tc_idx = -1; rc = ENOSPC; } done: mtx_unlock(&sc->tc_lock); + if (update) { + tc->flags |= CLRL_ASYNC; + t4_update_tx_sched(sc); + } return (rc); } void -t4_release_cl_rl_kbps(struct adapter *sc, int port_id, int tc_idx) +t4_release_cl_rl(struct adapter *sc, int port_id, int tc_idx) { struct tx_cl_rl_params *tc; @@ -464,13 +546,114 @@ t4_release_cl_rl_kbps(struct adapter *sc, int port_id, mtx_lock(&sc->tc_lock); tc = &sc->port[port_id]->sched_params->cl_rl[tc_idx]; MPASS(tc->refcount > 0); - MPASS(tc->ratemode == FW_SCHED_PARAMS_RATE_ABS); - MPASS(tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE); - MPASS(tc->mode == FW_SCHED_PARAMS_MODE_FLOW); tc->refcount--; mtx_unlock(&sc->tc_lock); } +int +sysctl_tc(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct port_info *pi; + struct adapter *sc; + struct sge_txq *txq; + int qidx = arg2, rc, tc_idx; + + MPASS(qidx >= 0 && qidx < vi->ntxq); + pi = vi->pi; + sc = pi->adapter; + txq = &sc->sge.txq[vi->first_txq + qidx]; + + tc_idx = txq->tc_idx; + rc = sysctl_handle_int(oidp, &tc_idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (sc->flags & IS_VF) + return (EPERM); + if (!in_range(tc_idx, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + return (bind_txq_to_traffic_class(sc, txq, tc_idx)); +} + +int +sysctl_tc_params(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct tx_cl_rl_params tc; + struct sbuf *sb; + int i, rc, port_id, mbps, gbps; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + port_id = arg2 >> 16; + MPASS(port_id < sc->params.nports); + MPASS(sc->port[port_id] != NULL); + i = arg2 & 0xffff; + MPASS(i < sc->chip_params->nsched_cls); + + mtx_lock(&sc->tc_lock); + tc = sc->port[port_id]->sched_params->cl_rl[i]; + mtx_unlock(&sc->tc_lock); + + switch (tc.rateunit) { + case SCHED_CLASS_RATEUNIT_BITS: + switch (tc.ratemode) { + case SCHED_CLASS_RATEMODE_REL: + /* XXX: top speed or actual link speed? */ + gbps = port_top_speed(sc->port[port_id]); + sbuf_printf(sb, "%u%% of %uGbps", tc.maxrate, gbps); + break; + case SCHED_CLASS_RATEMODE_ABS: + mbps = tc.maxrate / 1000; + gbps = tc.maxrate / 1000000; + if (tc.maxrate == gbps * 1000000) + sbuf_printf(sb, "%uGbps", gbps); + else if (tc.maxrate == mbps * 1000) + sbuf_printf(sb, "%uMbps", mbps); + else + sbuf_printf(sb, "%uKbps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + break; + case SCHED_CLASS_RATEUNIT_PKTS: + sbuf_printf(sb, "%upps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + + switch (tc.mode) { + case SCHED_CLASS_MODE_CLASS: + sbuf_printf(sb, " aggregate"); + break; + case SCHED_CLASS_MODE_FLOW: + sbuf_printf(sb, " per-flow"); + break; + default: + rc = ENXIO; + goto done; + } + +done: + if (rc == 0) + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + #ifdef RATELIMIT void t4_init_etid_table(struct adapter *sc) @@ -578,7 +761,7 @@ cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_ta cst = malloc(sizeof(*cst), M_CXGBE, M_ZERO | M_NOWAIT); if (cst == NULL) { failed: - t4_release_cl_rl_kbps(sc, pi->port_id, schedcl); + t4_release_cl_rl(sc, pi->port_id, schedcl); return (ENOMEM); } @@ -634,7 +817,7 @@ cxgbe_snd_tag_modify(struct m_snd_tag *mst, if (rc != 0) return (rc); MPASS(schedcl >= 0 && schedcl < sc->chip_params->nsched_cls); - t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + t4_release_cl_rl(sc, cst->port_id, cst->schedcl); cst->schedcl = schedcl; cst->max_rate = params->rate_limit.max_rate; mtx_unlock(&cst->lock); @@ -675,7 +858,7 @@ cxgbe_snd_tag_free_locked(struct cxgbe_snd_tag *cst) if (cst->etid >= 0) free_etid(sc, cst->etid); if (cst->schedcl != -1) - t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + t4_release_cl_rl(sc, cst->port_id, cst->schedcl); mtx_unlock(&cst->lock); mtx_destroy(&cst->lock); free(cst, M_CXGBE); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 6 23:21:13 2018 (r337398) @@ -296,7 +296,6 @@ static void drain_wrq_wr_list(struct adapter *, struct static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); -static int sysctl_tc(SYSCTL_HANDLER_ARGS); #ifdef RATELIMIT static inline u_int txpkt_eo_len16(u_int, u_int, u_int); static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, @@ -5365,91 +5364,6 @@ sysctl_bufsizes(SYSCTL_HANDLER_ARGS) sbuf_finish(&sb); rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); sbuf_delete(&sb); - return (rc); -} - -static int -sysctl_tc(SYSCTL_HANDLER_ARGS) -{ - struct vi_info *vi = arg1; - struct port_info *pi; - struct adapter *sc; - struct sge_txq *txq; - struct tx_cl_rl_params *tc; - int qidx = arg2, rc, tc_idx; - uint32_t fw_queue, fw_class; - - MPASS(qidx >= 0 && qidx < vi->ntxq); - pi = vi->pi; - sc = pi->adapter; - txq = &sc->sge.txq[vi->first_txq + qidx]; - - tc_idx = txq->tc_idx; - rc = sysctl_handle_int(oidp, &tc_idx, 0, req); - if (rc != 0 || req->newptr == NULL) - return (rc); - - if (sc->flags & IS_VF) - return (EPERM); - - /* Note that -1 is legitimate input (it means unbind). */ - if (tc_idx < -1 || tc_idx >= sc->chip_params->nsched_cls) - return (EINVAL); - - mtx_lock(&sc->tc_lock); - if (tc_idx == txq->tc_idx) { - rc = 0; /* No change, nothing to do. */ - goto done; - } - - fw_queue = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | - V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id); - - if (tc_idx == -1) - fw_class = 0xffffffff; /* Unbind. */ - else { - /* - * Bind to a different class. - */ - tc = &pi->sched_params->cl_rl[tc_idx]; - if (tc->flags & TX_CLRL_ERROR) { - /* Previous attempt to set the cl-rl params failed. */ - rc = EIO; - goto done; - } else { - /* - * Ok to proceed. Place a reference on the new class - * while still holding on to the reference on the - * previous class, if any. - */ - fw_class = tc_idx; - tc->refcount++; - } - } - mtx_unlock(&sc->tc_lock); - - rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4stc"); - if (rc) - return (rc); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, &fw_class); - end_synchronized_op(sc, 0); - - mtx_lock(&sc->tc_lock); - if (rc == 0) { - if (txq->tc_idx != -1) { - tc = &pi->sched_params->cl_rl[txq->tc_idx]; - MPASS(tc->refcount > 0); - tc->refcount--; - } - txq->tc_idx = tc_idx; - } else if (tc_idx != -1) { - tc = &pi->sched_params->cl_rl[tc_idx]; - MPASS(tc->refcount > 0); - tc->refcount--; - } -done: - mtx_unlock(&sc->tc_lock); return (rc); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Aug 6 23:21:13 2018 (r337398) @@ -231,7 +231,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || (wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq)) == NULL) { if (tc_idx >= 0) - t4_release_cl_rl_kbps(sc, port_id, tc_idx); + t4_release_cl_rl(sc, port_id, tc_idx); return (ENOMEM); } @@ -259,7 +259,7 @@ update_tx_rate_limit(struct adapter *sc, struct toepcb } if (toep->tc_idx >= 0) - t4_release_cl_rl_kbps(sc, port_id, toep->tc_idx); + t4_release_cl_rl(sc, port_id, toep->tc_idx); toep->tc_idx = tc_idx; return (0); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Mon Aug 6 21:54:51 2018 (r337397) +++ head/sys/dev/cxgbe/tom/t4_tom.c Mon Aug 6 23:21:13 2018 (r337398) @@ -317,10 +317,9 @@ release_offload_resources(struct toepcb *toep) if (toep->ce) release_lip(td, toep->ce); -#ifdef RATELIMIT if (toep->tc_idx != -1) - t4_release_cl_rl_kbps(sc, toep->vi->pi->port_id, toep->tc_idx); -#endif + t4_release_cl_rl(sc, toep->vi->pi->port_id, toep->tc_idx); + mtx_lock(&td->toep_list_lock); TAILQ_REMOVE(&td->toep_list, toep, link); mtx_unlock(&td->toep_list_lock); From owner-svn-src-all@freebsd.org Mon Aug 6 23:51:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2ACF106A089; Mon, 6 Aug 2018 23:51:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A76971A45; Mon, 6 Aug 2018 23:51:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B9A513EBC; Mon, 6 Aug 2018 23:51:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w76Np9ru003898; Mon, 6 Aug 2018 23:51:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w76Np90e003896; Mon, 6 Aug 2018 23:51:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808062351.w76Np90e003896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 6 Aug 2018 23:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337399 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 337399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2018 23:51:10 -0000 Author: jhb Date: Mon Aug 6 23:51:08 2018 New Revision: 337399 URL: https://svnweb.freebsd.org/changeset/base/337399 Log: Make the system C11 atomics headers fully compatible with external GCC. The and headers already included support for C11 atomics via intrinsincs in modern versions of GCC, but these versions tried to "hide" atomic variables inside a wrapper structure. This wrapper is not compatible with GCC's internal header, so that if GCC's was used together with , use of C11 atomics would fail to compile. Fix this by not hiding atomic variables in a structure for modern versions of GCC. The headers already avoid using a wrapper structure on clang. Note that this wrapper was only used if C11 was not enabled (e.g. via -std=c99), so this also fixes compile failures if a modern version of GCC was used with -std=c11 but with FreeBSD's instead of GCC's and this change fixes that case as well. Reported by: Mark Millard Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D16585 Modified: head/sys/sys/cdefs.h head/sys/sys/stdatomic.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Aug 6 23:21:13 2018 (r337398) +++ head/sys/sys/cdefs.h Mon Aug 6 23:51:08 2018 (r337399) @@ -268,7 +268,7 @@ #endif #if !defined(__cplusplus) && !__has_extension(c_atomic) && \ - !__has_extension(cxx_atomic) + !__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 7) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Mon Aug 6 23:21:13 2018 (r337398) +++ head/sys/sys/stdatomic.h Mon Aug 6 23:51:08 2018 (r337399) @@ -171,12 +171,9 @@ atomic_signal_fence(memory_order __order __unused) /* Atomics in kernelspace are always lock-free. */ #define atomic_is_lock_free(obj) \ ((void)(obj), (_Bool)1) -#elif defined(__CLANG_ATOMICS) +#elif defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ __atomic_is_lock_free(sizeof(*(obj)), obj) -#elif defined(__GNUC_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) #else #define atomic_is_lock_free(obj) \ ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) @@ -260,28 +257,28 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; #elif defined(__GNUC_ATOMICS) #define atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ + __atomic_compare_exchange_n(object, expected, \ desired, 0, success, failure) #define atomic_compare_exchange_weak_explicit(object, expected, \ desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ + __atomic_compare_exchange_n(object, expected, \ desired, 1, success, failure) #define atomic_exchange_explicit(object, desired, order) \ - __atomic_exchange_n(&(object)->__val, desired, order) + __atomic_exchange_n(object, desired, order) #define atomic_fetch_add_explicit(object, operand, order) \ - __atomic_fetch_add(&(object)->__val, operand, order) + __atomic_fetch_add(object, operand, order) #define atomic_fetch_and_explicit(object, operand, order) \ - __atomic_fetch_and(&(object)->__val, operand, order) + __atomic_fetch_and(object, operand, order) #define atomic_fetch_or_explicit(object, operand, order) \ - __atomic_fetch_or(&(object)->__val, operand, order) + __atomic_fetch_or(object, operand, order) #define atomic_fetch_sub_explicit(object, operand, order) \ - __atomic_fetch_sub(&(object)->__val, operand, order) + __atomic_fetch_sub(object, operand, order) #define atomic_fetch_xor_explicit(object, operand, order) \ - __atomic_fetch_xor(&(object)->__val, operand, order) + __atomic_fetch_xor(object, operand, order) #define atomic_load_explicit(object, order) \ - __atomic_load_n(&(object)->__val, order) + __atomic_load_n(object, order) #define atomic_store_explicit(object, desired, order) \ - __atomic_store_n(&(object)->__val, desired, order) + __atomic_store_n(object, desired, order) #else #define __atomic_apply_stride(object, operand) \ (((__typeof__((object)->__val))0) + (operand)) From owner-svn-src-all@freebsd.org Tue Aug 7 00:10:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1FEA106AC37; Tue, 7 Aug 2018 00:10:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89A4272473; Tue, 7 Aug 2018 00:10:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ADF6142F0; Tue, 7 Aug 2018 00:10:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w770AwKA013930; Tue, 7 Aug 2018 00:10:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w770AwNA013929; Tue, 7 Aug 2018 00:10:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808070010.w770AwNA013929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Aug 2018 00:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337400 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 337400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 00:10:59 -0000 Author: jhb Date: Tue Aug 7 00:10:58 2018 New Revision: 337400 URL: https://svnweb.freebsd.org/changeset/base/337400 Log: Remove spurious ABI tags from kdump output. The abidump routine output an ABI tag when -A was specified for records that were not displayed due to type or pid filtering. To fix, split the code to lookup the ABI from the code to display the ABI, move the code to display the ABI into dumpheader(), and move dumpheader() later in the main loop as a simplification. Previously dumpheader() was called under a condition that repeated conditions made later in the main loop. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D16608 Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Mon Aug 6 23:51:08 2018 (r337399) +++ head/usr.bin/kdump/kdump.c Tue Aug 7 00:10:58 2018 (r337400) @@ -94,10 +94,10 @@ __FBSDID("$FreeBSD$"); #include #endif -u_int abidump(struct ktr_header *); int fetchprocinfo(struct ktr_header *, u_int *); +u_int findabi(struct ktr_header *); int fread_tail(void *, int, int); -void dumpheader(struct ktr_header *); +void dumpheader(struct ktr_header *, u_int); void ktrsyscall(struct ktr_syscall *, u_int); void ktrsysret(struct ktr_sysret *, u_int); void ktrnamei(char *, int); @@ -466,10 +466,6 @@ main(int argc, char *argv[]) drop_logged = 1; } } - if (trpoints & (1< size) { @@ -482,12 +478,13 @@ main(int argc, char *argv[]) errx(1, "data too short"); if (fetchprocinfo(&ktr_header, (u_int *)m) != 0) continue; - sv_flags = abidump(&ktr_header); if (pid && ktr_header.ktr_pid != pid && ktr_header.ktr_tid != pid) continue; if ((trpoints & (1<pid == kth->ktr_pid) { - flags = pi->sv_flags; - break; + return (pi->sv_flags); } } - - if (abiflag == 0) - return (flags); - - switch (flags & SV_ABI_MASK) { - case SV_ABI_LINUX: - abi = "L"; - break; - case SV_ABI_FREEBSD: - abi = "F"; - break; - case SV_ABI_CLOUDABI: - abi = "C"; - break; - default: - abi = "U"; - break; - } - - if (flags & SV_LP64) - arch = "64"; - else if (flags & SV_ILP32) - arch = "32"; - else - arch = "00"; - - printf("%s%s ", abi, arch); - - return (flags); + return (0); } void -dumpheader(struct ktr_header *kth) +dumpheader(struct ktr_header *kth, u_int sv_flags) { static char unknown[64]; static struct timeval prevtime, prevtime_e; struct timeval temp; + const char *abi; + const char *arch; const char *type; const char *sign; @@ -670,10 +637,6 @@ dumpheader(struct ktr_header *kth) case KTR_SYSCTL: type = "SCTL"; break; - case KTR_PROCCTOR: - /* FALLTHROUGH */ - case KTR_PROCDTOR: - return; case KTR_CAPFAIL: type = "CAP "; break; @@ -731,6 +694,31 @@ dumpheader(struct ktr_header *kth) } } printf("%s ", type); + if (abiflag != 0) { + switch (sv_flags & SV_ABI_MASK) { + case SV_ABI_LINUX: + abi = "L"; + break; + case SV_ABI_FREEBSD: + abi = "F"; + break; + case SV_ABI_CLOUDABI: + abi = "C"; + break; + default: + abi = "U"; + break; + } + + if ((sv_flags & SV_LP64) != 0) + arch = "64"; + else if ((sv_flags & SV_ILP32) != 0) + arch = "32"; + else + arch = "00"; + + printf("%s%s ", abi, arch); + } } #include From owner-svn-src-all@freebsd.org Tue Aug 7 00:51:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46ADB106BB76; Tue, 7 Aug 2018 00:51:50 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE713736A1; Tue, 7 Aug 2018 00:51:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D121E148AA; Tue, 7 Aug 2018 00:51:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w770pnTh036269; Tue, 7 Aug 2018 00:51:49 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w770pn13036259; Tue, 7 Aug 2018 00:51:49 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808070051.w770pn13036259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 7 Aug 2018 00:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337401 - head/release X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 337401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 00:51:50 -0000 Author: cperciva Date: Tue Aug 7 00:51:49 2018 New Revision: 337401 URL: https://svnweb.freebsd.org/changeset/base/337401 Log: Fix copy-and-paste error in previous commit. Modified: head/release/Makefile.ec2 Modified: head/release/Makefile.ec2 ============================================================================== --- head/release/Makefile.ec2 Tue Aug 7 00:10:58 2018 (r337400) +++ head/release/Makefile.ec2 Tue Aug 7 00:51:49 2018 (r337401) @@ -36,7 +36,7 @@ AMINAMESUFFIX!= date +-%Y-%m-%d PUBLISH= --public .endif .if defined(EC2PUBLICSNAP) && !empty(EC2PUBLICSNAP) -PUBLISH= --publicsnap +PUBLICSNAP= --publicsnap .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} From owner-svn-src-all@freebsd.org Tue Aug 7 07:13:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C046104F98D; Tue, 7 Aug 2018 07:13:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C240380D56; Tue, 7 Aug 2018 07:12:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DB1C1894A; Tue, 7 Aug 2018 07:12:59 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w777CxWN036105; Tue, 7 Aug 2018 07:12:59 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w777Cxb3036104; Tue, 7 Aug 2018 07:12:59 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808070712.w777Cxb3036104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 7 Aug 2018 07:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337410 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 07:13:00 -0000 Author: cy Date: Tue Aug 7 07:12:59 2018 New Revision: 337410 URL: https://svnweb.freebsd.org/changeset/base/337410 Log: Remove redundant and incorrect default definition of AF_INET6. AF_INET6 is defined in sys/socket.h where it's defined as 28. A bit of trivia: On NetBSD AF_INET6 is defined as 24. On Solaris it is defined as 26. This is probably why Darren defaulted to 26, because ipfilter was originally written for SunOS 4 and Solaris many moons ago. MFC after: 2 weeks Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 7 03:39:29 2018 (r337409) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Tue Aug 7 07:12:59 2018 (r337410) @@ -1463,10 +1463,6 @@ typedef struct tcpiphdr tcpiphdr_t; # define DPRINT(x) #endif -#ifndef AF_INET6 -# define AF_INET6 26 -#endif - #ifdef DTRACE_PROBE # ifdef _KERNEL # define DT(_n) DTRACE_PROBE(_n) From owner-svn-src-all@freebsd.org Tue Aug 7 08:33:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB751052530; Tue, 7 Aug 2018 08:33:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8370839D4; Tue, 7 Aug 2018 08:33:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A929A196A9; Tue, 7 Aug 2018 08:33:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w778Xepr077456; Tue, 7 Aug 2018 08:33:40 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w778Xe2o077455; Tue, 7 Aug 2018 08:33:40 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808070833.w778Xe2o077455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Tue, 7 Aug 2018 08:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337411 - head/sys/dev/vt/hw/vga X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 337411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 08:33:41 -0000 Author: cperciva Date: Tue Aug 7 08:33:40 2018 New Revision: 337411 URL: https://svnweb.freebsd.org/changeset/base/337411 Log: Replace a pair of 8-bit writes to VGA memory with a single 16-bit write. The VGA "text mode" buffer has a pair of bytes for each character: One byte for the character symbol, and an "attribute" byte encoding the foreground and background colours. When updating the screen, we were writing these two bytes separately. On some virtualized systems, every write results in a glyph being redrawn into a (graphical) virtual screen; writing these two bytes separately results in twice as much work being done to draw characters, whereas if we perform a single 16-bit write instead, the character only needs to be redrawn once. On an EC2 c5.4xlarge instance, this change cuts 1.30s from the kernel boot, speeding it up from 8.90s to 7.60s. MFC after: 1 week Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Tue Aug 7 07:12:59 2018 (r337410) +++ head/sys/dev/vt/hw/vga/vt_vga.c Tue Aug 7 08:33:40 2018 (r337411) @@ -68,6 +68,8 @@ struct vga_softc { bus_space_read_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs) #define MEM_WRITE1(sc, ofs, val) \ bus_space_write_1(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val) +#define MEM_WRITE2(sc, ofs, val) \ + bus_space_write_2(sc->vga_fb_tag, sc->vga_fb_handle, ofs, val) #define REG_READ1(sc, reg) \ bus_space_read_1(sc->vga_reg_tag, sc->vga_reg_handle, reg) #define REG_WRITE1(sc, reg, val) \ @@ -894,10 +896,8 @@ vga_bitblt_text_txtmode(struct vt_device *vd, const st cons_to_vga_colors[bg] << 4 | cons_to_vga_colors[fg]; - MEM_WRITE1(sc, (row * 80 + col) * 2 + 0, - ch); - MEM_WRITE1(sc, (row * 80 + col) * 2 + 1, - attr); + MEM_WRITE2(sc, (row * 80 + col) * 2 + 0, + ch + ((uint16_t)(attr) << 8)); } } } From owner-svn-src-all@freebsd.org Tue Aug 7 10:48:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E6051057634; Tue, 7 Aug 2018 10:48:37 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1D7889198; Tue, 7 Aug 2018 10:48:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B08481AC52; Tue, 7 Aug 2018 10:48:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Amaat044468; Tue, 7 Aug 2018 10:48:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Amajw044467; Tue, 7 Aug 2018 10:48:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808071048.w77Amajw044467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 Aug 2018 10:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337412 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 10:48:37 -0000 Author: tsoome Date: Tue Aug 7 10:48:36 2018 New Revision: 337412 URL: https://svnweb.freebsd.org/changeset/base/337412 Log: libsa: dos_checksum() should take unsigned chars Fix pointers to integers with different sign issue. Modified: head/stand/libsa/dosfs.c Modified: head/stand/libsa/dosfs.c ============================================================================== --- head/stand/libsa/dosfs.c Tue Aug 7 08:33:40 2018 (r337411) +++ head/stand/libsa/dosfs.c Tue Aug 7 10:48:36 2018 (r337412) @@ -403,7 +403,7 @@ dos_stat(struct open_file *fd, struct stat *sb) } static int -dos_checksum(char *name, char *ext) +dos_checksum(unsigned char *name, unsigned char *ext) { int x, i; char buf[11]; From owner-svn-src-all@freebsd.org Tue Aug 7 10:53:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916BF105798C; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 443B989C67; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 254EF1ADE7; Tue, 7 Aug 2018 10:53:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Arqqb049683; Tue, 7 Aug 2018 10:53:52 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Arqjk049682; Tue, 7 Aug 2018 10:53:52 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201808071053.w77Arqjk049682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 7 Aug 2018 10:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337413 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 10:53:52 -0000 Author: tsoome Date: Tue Aug 7 10:53:51 2018 New Revision: 337413 URL: https://svnweb.freebsd.org/changeset/base/337413 Log: libsa: gzipfs.c converts pointers to integer types with different sign Signed versus unsigned char. Modified: head/stand/libsa/gzipfs.c Modified: head/stand/libsa/gzipfs.c ============================================================================== --- head/stand/libsa/gzipfs.c Tue Aug 7 10:48:36 2018 (r337412) +++ head/stand/libsa/gzipfs.c Tue Aug 7 10:53:51 2018 (r337413) @@ -40,7 +40,7 @@ struct z_file int zf_rawfd; off_t zf_dataoffset; z_stream zf_zstream; - char zf_buf[Z_BUFSIZE]; + unsigned char zf_buf[Z_BUFSIZE]; int zf_endseen; }; From owner-svn-src-all@freebsd.org Tue Aug 7 13:50:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0715B105F279; Tue, 7 Aug 2018 13:50:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC1D8FE14; Tue, 7 Aug 2018 13:50:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ECD31C9BC; Tue, 7 Aug 2018 13:50:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77DoLYF037793; Tue, 7 Aug 2018 13:50:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77DoLhP037792; Tue, 7 Aug 2018 13:50:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071350.w77DoLhP037792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 13:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337415 - head/sbin/dhclient X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/dhclient X-SVN-Commit-Revision: 337415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 13:50:22 -0000 Author: markj Date: Tue Aug 7 13:50:21 2018 New Revision: 337415 URL: https://svnweb.freebsd.org/changeset/base/337415 Log: dhclient: Enter capability mode before dropping privileges. This is needed to be able to chroot in the fallback case where Capsicum is not available. Reported by: Daniel Braniss X-MFC with: r337382 Sponsored by: The FreeBSD Foundation Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Tue Aug 7 13:46:06 2018 (r337414) +++ head/sbin/dhclient/dhclient.c Tue Aug 7 13:50:21 2018 (r337415) @@ -529,23 +529,21 @@ main(int argc, char *argv[]) if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS) error("can't limit route socket: %m"); - if (setgroups(1, &pw->pw_gid) || - setegid(pw->pw_gid) || setgid(pw->pw_gid) || - seteuid(pw->pw_uid) || setuid(pw->pw_uid)) - error("can't drop privileges: %m"); - endpwent(); setproctitle("%s", ifi->name); + /* setgroups(2) is not permitted in capability mode. */ + if (setgroups(1, &pw->pw_gid) != 0) + error("can't restrict groups: %m"); + if (caph_enter_casper() < 0) error("can't enter capability mode: %m"); /* - * If we are not in capability mode (i.e., because Capsicum or - * libcasper is disabled), try to restrict filesystem access. This - * will fail if kern.chroot_allow_open_directories is 0 or the process - * is jailed. + * If we are not in capability mode (i.e., Capsicum or libcasper is + * disabled), try to restrict filesystem access. This will fail if + * kern.chroot_allow_open_directories is 0 or the process is jailed. */ if (cap_getmode(&capmode) < 0 || capmode == 0) { if (chroot(_PATH_VAREMPTY) == -1) @@ -553,6 +551,10 @@ main(int argc, char *argv[]) if (chdir("/") == -1) error("chdir(\"/\")"); } + + if (setegid(pw->pw_gid) || setgid(pw->pw_gid) || + seteuid(pw->pw_uid) || setuid(pw->pw_uid)) + error("can't drop privileges: %m"); if (immediate_daemon) go_daemon(); From owner-svn-src-all@freebsd.org Tue Aug 7 14:09:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C8F2105FA45; Tue, 7 Aug 2018 14:09:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50A7570C48; Tue, 7 Aug 2018 14:09:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DE981CCFA; Tue, 7 Aug 2018 14:09:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77E9UOF049624; Tue, 7 Aug 2018 14:09:30 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77E9U2X049623; Tue, 7 Aug 2018 14:09:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071409.w77E9U2X049623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 14:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337417 - stable/11/usr.sbin/newsyslog X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.sbin/newsyslog X-SVN-Commit-Revision: 337417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 14:09:30 -0000 Author: markj Date: Tue Aug 7 14:09:29 2018 New Revision: 337417 URL: https://svnweb.freebsd.org/changeset/base/337417 Log: MFC r337323: Fix a flag collision introduced in r327451. PR: 230350 Modified: stable/11/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/11/usr.sbin/newsyslog/newsyslog.c Tue Aug 7 14:02:41 2018 (r337416) +++ stable/11/usr.sbin/newsyslog/newsyslog.c Tue Aug 7 14:09:29 2018 (r337417) @@ -128,8 +128,7 @@ __FBSDID("$FreeBSD$"); #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ #define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #define CE_PLAIN0 0x0800 /* Do not compress zero'th history file */ - -#define CE_RFC5424 0x0800 /* Use RFC5424 format rotation message */ +#define CE_RFC5424 0x1000 /* Use RFC5424 format rotation message */ #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ From owner-svn-src-all@freebsd.org Tue Aug 7 14:39:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C0910604F7; Tue, 7 Aug 2018 14:39:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25C1D71F27; Tue, 7 Aug 2018 14:39:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 037B81D1F4; Tue, 7 Aug 2018 14:39:02 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Ed1kG064845; Tue, 7 Aug 2018 14:39:01 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Ed0Q3064840; Tue, 7 Aug 2018 14:39:00 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201808071439.w77Ed0Q3064840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Tue, 7 Aug 2018 14:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337418 - in stable/11: lib/libc/sys sys/kern tests/sys/kqueue/libkqueue X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in stable/11: lib/libc/sys sys/kern tests/sys/kqueue/libkqueue X-SVN-Commit-Revision: 337418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 14:39:02 -0000 Author: dab Date: Tue Aug 7 14:39:00 2018 New Revision: 337418 URL: https://svnweb.freebsd.org/changeset/base/337418 Log: MFC r336761 & r336781: Allow a EVFILT_TIMER kevent to be updated. If a timer is updated (re-added) with a different time period (specified in the .data field of the kevent), the new time period has no effect; the timer will not expire until the original time has elapsed. This violates the documented behavior as the kqueue(2) man page says (in part) "Re-adding an existing event will modify the parameters of the original event, and not result in a duplicate entry." This modification, adapted from a patch submitted by cem@ to PR214987, fixes the kqueue system to allow updating a timer entry. The kevent timer behavior is changed to: * When a timer is re-added, update the timer parameters to and re-start the timer using the new parameters. * Allow updating both active and already expired timers. * When the timer has already expired, dequeue any undelivered events and clear the count of expirations. All of these changes address the original PR and also bring the FreeBSD and macOS kevent timer behaviors into agreement. A few other changes were made along the way: * Update the kqueue(2) man page to reflect the new timer behavior. * Fix man page style issues in kqueue(2) diagnosed by igor. * Update the timer libkqueue system test to test for the updated timer behavior. * Fix the (test) libkqueue common.h file so that it includes config.h which defines various HAVE_* feature defines, before the #if tests for such variables in common.h. This enables the use of the actual err(3) family of functions. * Fix the usages of the err(3) functions in the tests for incorrect type of variables. Those were formerly undiagnosed due to the disablement of the err(3) functions (see previous bullet point). PR: 214987 Relnotes: yes Sponsored by: Dell EMC Modified: stable/11/lib/libc/sys/kqueue.2 stable/11/sys/kern/kern_event.c stable/11/tests/sys/kqueue/libkqueue/common.h stable/11/tests/sys/kqueue/libkqueue/main.c stable/11/tests/sys/kqueue/libkqueue/timer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/kqueue.2 ============================================================================== --- stable/11/lib/libc/sys/kqueue.2 Tue Aug 7 14:09:29 2018 (r337417) +++ stable/11/lib/libc/sys/kqueue.2 Tue Aug 7 14:39:00 2018 (r337418) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2017 +.Dd July 27, 2018 .Dt KQUEUE 2 .Os .Sh NAME @@ -339,8 +339,8 @@ Events for this filter are not registered with .Fn kevent directly but are registered via the .Va aio_sigevent -member of an asychronous I/O request when it is scheduled via an asychronous I/O -system call such as +member of an asynchronous I/O request when it is scheduled via an +asynchronous I/O system call such as .Fn aio_read . The filter returns under the same conditions as .Fn aio_error . @@ -485,7 +485,7 @@ been marked as .Dv SIG_IGN , except for the .Dv SIGCHLD -signal, which, if ignored, won't be recorded by the filter. +signal, which, if ignored, will not be recorded by the filter. Event notification happens after normal signal delivery processing. .Va data @@ -530,6 +530,13 @@ On return, .Va fflags contains the events which triggered the filter. .Pp +If an existing timer is re-added, the existing timer will be +effectively canceled (throwing away any undelivered record of previous +timer expiration) and re-started using the new parameters contained in +.Va data +and +.Va fflags . +.Pp There is a system wide limit on the number of timers which is controlled by the .Va kern.kq_calloutmax @@ -576,9 +583,9 @@ contains the users defined flags in the lower 24 bits. .Sh CANCELLATION BEHAVIOUR If .Fa nevents -is non-zero, i.e. the function is potentially blocking, the call +is non-zero, i.e., the function is potentially blocking, the call is a cancellation point. -Otherwise, i.e. if +Otherwise, i.e., if .Fa nevents is zero, the call is not cancellable. Cancellation can only occur before any changes are made to the kqueue, Modified: stable/11/sys/kern/kern_event.c ============================================================================== --- stable/11/sys/kern/kern_event.c Tue Aug 7 14:09:29 2018 (r337417) +++ stable/11/sys/kern/kern_event.c Tue Aug 7 14:39:00 2018 (r337418) @@ -151,6 +151,10 @@ static int filt_fileattach(struct knote *kn); static void filt_timerexpire(void *knx); static int filt_timerattach(struct knote *kn); static void filt_timerdetach(struct knote *kn); +static void filt_timerstart(struct knote *kn, sbintime_t to); +static void filt_timertouch(struct knote *kn, struct kevent *kev, + u_long type); +static int filt_timervalidate(struct knote *kn, sbintime_t *to); static int filt_timer(struct knote *kn, long hint); static int filt_userattach(struct knote *kn); static void filt_userdetach(struct knote *kn); @@ -179,6 +183,7 @@ static struct filterops timer_filtops = { .f_attach = filt_timerattach, .f_detach = filt_timerdetach, .f_event = filt_timer, + .f_touch = filt_timertouch, }; static struct filterops user_filtops = { .f_attach = filt_userattach, @@ -661,24 +666,38 @@ filt_timerexpire(void *knx) * data contains amount of time to sleep */ static int -filt_timerattach(struct knote *kn) +filt_timervalidate(struct knote *kn, sbintime_t *to) { - struct kq_timer_cb_data *kc; - sbintime_t to; - unsigned int ncallouts; if (kn->kn_sdata < 0) return (EINVAL); if (kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; - /* Only precision unit are supported in flags so far */ + /* + * The only fflags values supported are the timer unit + * (precision) and the absolute time indicator. + */ if ((kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) != 0) return (EINVAL); - to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); - if (to < 0) + *to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); + if (*to < 0) return (EINVAL); + return (0); +} +static int +filt_timerattach(struct knote *kn) +{ + struct kq_timer_cb_data *kc; + sbintime_t to; + unsigned int ncallouts; + int error; + + error = filt_timervalidate(kn, &to); + if (error != 0) + return (error); + do { ncallouts = kq_ncallouts; if (ncallouts >= kq_calloutmax) @@ -689,12 +708,21 @@ filt_timerattach(struct knote *kn) kn->kn_status &= ~KN_DETACHED; /* knlist_add clears it */ kn->kn_ptr.p_v = kc = malloc(sizeof(*kc), M_KQUEUE, M_WAITOK); callout_init(&kc->c, 1); + filt_timerstart(kn, to); + + return (0); +} + +static void +filt_timerstart(struct knote *kn, sbintime_t to) +{ + struct kq_timer_cb_data *kc; + + kc = kn->kn_ptr.p_v; kc->next = to + sbinuptime(); kc->to = to; callout_reset_sbt_on(&kc->c, kc->next, 0, filt_timerexpire, kn, PCPU_GET(cpuid), C_ABSOLUTE); - - return (0); } static void @@ -709,6 +737,73 @@ filt_timerdetach(struct knote *kn) old = atomic_fetchadd_int(&kq_ncallouts, -1); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ +} + +static void +filt_timertouch(struct knote *kn, struct kevent *kev, u_long type) +{ + struct kq_timer_cb_data *kc; + struct kqueue *kq; + sbintime_t to; + int error; + + switch (type) { + case EVENT_REGISTER: + /* Handle re-added timers that update data/fflags */ + if (kev->flags & EV_ADD) { + kc = kn->kn_ptr.p_v; + + /* Drain any existing callout. */ + callout_drain(&kc->c); + + /* Throw away any existing undelivered record + * of the timer expiration. This is done under + * the presumption that if a process is + * re-adding this timer with new parameters, + * it is no longer interested in what may have + * happened under the old parameters. If it is + * interested, it can wait for the expiration, + * delete the old timer definition, and then + * add the new one. + * + * This has to be done while the kq is locked: + * - if enqueued, dequeue + * - make it no longer active + * - clear the count of expiration events + */ + kq = kn->kn_kq; + KQ_LOCK(kq); + if (kn->kn_status & KN_QUEUED) + knote_dequeue(kn); + + kn->kn_status &= ~KN_ACTIVE; + kn->kn_data = 0; + KQ_UNLOCK(kq); + + /* Reschedule timer based on new data/fflags */ + kn->kn_sfflags = kev->fflags; + kn->kn_sdata = kev->data; + error = filt_timervalidate(kn, &to); + if (error != 0) { + kn->kn_flags |= EV_ERROR; + kn->kn_data = error; + } else + filt_timerstart(kn, to); + } + break; + + case EVENT_PROCESS: + *kev = kn->kn_kevent; + if (kn->kn_flags & EV_CLEAR) { + kn->kn_data = 0; + kn->kn_fflags = 0; + } + break; + + default: + panic("filt_timertouch() - invalid type (%ld)", type); + break; + } } static int Modified: stable/11/tests/sys/kqueue/libkqueue/common.h ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/common.h Tue Aug 7 14:09:29 2018 (r337417) +++ stable/11/tests/sys/kqueue/libkqueue/common.h Tue Aug 7 14:39:00 2018 (r337418) @@ -19,6 +19,7 @@ #ifndef _COMMON_H #define _COMMON_H +#include "config.h" /* Needed for HAVE_* defines */ #if HAVE_ERR_H # include @@ -39,8 +40,6 @@ #include -#include "config.h" - extern char *cur_test_id; int vnode_fd; @@ -72,6 +71,7 @@ kevent_add(int kqfd, struct kevent *kev, /* Checks if any events are pending, which is an error. */ extern void test_no_kevents(void); +extern void test_no_kevents_quietly(void); extern void test_begin(const char *); extern void success(void); Modified: stable/11/tests/sys/kqueue/libkqueue/main.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/main.c Tue Aug 7 14:09:29 2018 (r337417) +++ stable/11/tests/sys/kqueue/libkqueue/main.c Tue Aug 7 14:39:00 2018 (r337418) @@ -52,6 +52,25 @@ test_no_kevents(void) } } +/* Checks if any events are pending, which is an error. Do not print + * out anything unless events are found. +*/ +void +test_no_kevents_quietly(void) +{ + int nfds; + struct timespec timeo; + struct kevent kev; + + memset(&timeo, 0, sizeof(timeo)); + nfds = kevent(kqfd, NULL, 0, &kev, 1, &timeo); + if (nfds != 0) { + puts("\nUnexpected event:"); + puts(kevent_to_str(&kev)); + errx(1, "%d event(s) pending, but none expected:", nfds); + } +} + /* Retrieve a single kevent */ struct kevent * kevent_get(int kqfd) Modified: stable/11/tests/sys/kqueue/libkqueue/timer.c ============================================================================== --- stable/11/tests/sys/kqueue/libkqueue/timer.c Tue Aug 7 14:09:29 2018 (r337417) +++ stable/11/tests/sys/kqueue/libkqueue/timer.c Tue Aug 7 14:39:00 2018 (r337418) @@ -17,10 +17,61 @@ */ #include "common.h" +#include +#define MILLION 1000000 +#define THOUSAND 1000 +#define SEC_TO_MS(t) ((t) * THOUSAND) /* Convert seconds to milliseconds. */ +#define SEC_TO_US(t) ((t) * MILLION) /* Convert seconds to microseconds. */ +#define MS_TO_US(t) ((t) * THOUSAND) /* Convert milliseconds to microseconds. */ +#define US_TO_NS(t) ((t) * THOUSAND) /* Convert microseconds to nanoseconds. */ + int kqfd; +/* Get the current time with microsecond precision. Used for + * sub-second timing to make some timer tests run faster. + */ +static long +now(void) +{ + + struct timeval tv; + + gettimeofday(&tv, NULL); + return SEC_TO_US(tv.tv_sec) + tv.tv_usec; +} + +/* Sleep for a given number of milliseconds. The timeout is assumed to + * be less than 1 second. + */ void +mssleep(int t) +{ + + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(MS_TO_US(t)), + }; + + nanosleep(&stime, NULL); +} + +/* Sleep for a given number of microseconds. The timeout is assumed to + * be less than 1 second. + */ +void +ussleep(int t) +{ + + struct timespec stime = { + .tv_sec = 0, + .tv_nsec = US_TO_NS(t), + }; + + nanosleep(&stime, NULL); +} + +void test_kevent_timer_add(void) { const char *test_id = "kevent(EVFILT_TIMER, EV_ADD)"; @@ -164,15 +215,282 @@ disable_and_enable(void) success(); } +static void +test_update(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (UPDATE), EV_ADD | EV_ONESHOT)"; + struct kevent kev; + long elapsed; + long start; + + test_begin(test_id); + + test_no_kevents(); + + /* First set the timer to 1 second */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, SEC_TO_US(1), (void *)1); + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Now reduce the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), (void *)2); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + elapsed = now() - start; + + /* Check that the timer expired after at least 1 ms, but less than + * 1 second. This check is to make sure that the original 1 second + * timeout was not used. + */ + printf("timer expired after %ld us\n", elapsed); + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); + if (elapsed > SEC_TO_US(1)) + errx(1, "late timer expiration: %ld us", elapsed); + + success(); +} + +static void +test_update_equal(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (UPDATE=), EV_ADD | EV_ONESHOT)"; + struct kevent kev; + long elapsed; + long start; + + test_begin(test_id); + + test_no_kevents(); + + /* First set the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Sleep for a significant fraction of the timeout. */ + ussleep(600); + + /* Now re-add the timer with the same parameters */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + elapsed = now() - start; + + /* Check that the timer expired after at least 1 ms. This check is + * to make sure that the timer re-started and that the event is + * not from the original add of the timer. + */ + printf("timer expired after %ld us\n", elapsed); + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); + + success(); +} + +static void +test_update_expired(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (UPDATE EXP), EV_ADD | EV_ONESHOT)"; + struct kevent kev; + long elapsed; + long start; + + test_begin(test_id); + + test_no_kevents(); + + /* Set the timer to 1ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Wait for 2 ms to give the timer plenty of time to expire. */ + mssleep(2); + + /* Now re-add the timer */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + elapsed = now() - start; + + /* Check that the timer expired after at least 1 ms. This check + * is to make sure that the timer re-started and that the event is + * not from the original add (and expiration) of the timer. + */ + printf("timer expired after %ld us\n", elapsed); + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); + + /* Make sure the re-added timer does not fire. In other words, + * test that the event received above was the only event from the + * add and re-add of the timer. + */ + mssleep(2); + test_no_kevents(); + + success(); +} + +static void +test_update_periodic(void) +{ + const char *test_id = "kevent(EVFILT_TIMER (UPDATE), periodic)"; + struct kevent kev; + long elapsed; + long start; + long stop; + + test_begin(test_id); + + test_no_kevents(); + + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD | EV_CLEAR; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Check if the event occurs again */ + sleep(1); + kevent_cmp(&kev, kevent_get(kqfd)); + + /* Re-add with new timeout. */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD, 0, SEC_TO_MS(2), NULL); + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Retrieve the event */ + kev.flags = EV_ADD | EV_CLEAR; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + + stop = now(); + elapsed = stop - start; + + /* Check that the timer expired after at least 2 ms. + */ + printf("timer expired after %ld us\n", elapsed); + if (elapsed < MS_TO_US(2)) + errx(1, "early timer expiration: %ld us", elapsed); + + /* Delete the event */ + kev.flags = EV_DELETE; + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + success(); +} + +static void +test_update_timing(void) +{ +#define MIN_SLEEP 500 +#define MAX_SLEEP 1500 + const char *test_id = "kevent(EVFILT_TIMER (UPDATE TIMING), EV_ADD | EV_ONESHOT)"; + struct kevent kev; + int iteration; + int sleeptime; + long elapsed; + long start; + long stop; + + test_begin(test_id); + + test_no_kevents(); + + /* Re-try the update tests with a variety of delays between the + * original timer activation and the update of the timer. The goal + * is to show that in all cases the only timer event that is + * received is from the update and not the original timer add. + */ + for (sleeptime = MIN_SLEEP, iteration = 1; + sleeptime < MAX_SLEEP; + ++sleeptime, ++iteration) { + + /* First set the timer to 1 ms */ + EV_SET(&kev, vnode_fd, EVFILT_TIMER, EV_ADD | EV_ONESHOT, + NOTE_USECONDS, MS_TO_US(1), NULL); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Delay; the delay ranges from less than to greater than the + * timer period. + */ + ussleep(sleeptime); + + /* Now re-add the timer with the same parameters */ + start = now(); + if (kevent(kqfd, &kev, 1, NULL, 0, NULL) < 0) + err(1, "%s", test_id); + + /* Wait for the event */ + kev.flags |= EV_CLEAR; + kev.fflags &= ~NOTE_USECONDS; + kev.data = 1; + kevent_cmp(&kev, kevent_get(kqfd)); + stop = now(); + elapsed = stop - start; + + /* Check that the timer expired after at least 1 ms. This + * check is to make sure that the timer re-started and that + * the event is not from the original add of the timer. + */ + if (elapsed < MS_TO_US(1)) + errx(1, "early timer expiration: %ld us", elapsed); + + /* Make sure the re-added timer does not fire. In other words, + * test that the event received above was the only event from + * the add and re-add of the timer. + */ + mssleep(2); + test_no_kevents_quietly(); + } + + success(); +} + void test_evfilt_timer() { kqfd = kqueue(); - test_kevent_timer_add(); - test_kevent_timer_del(); - test_kevent_timer_get(); - test_oneshot(); - test_periodic(); - disable_and_enable(); + test_kevent_timer_add(); + test_kevent_timer_del(); + test_kevent_timer_get(); + test_oneshot(); + test_periodic(); + test_update(); + test_update_equal(); + test_update_expired(); + test_update_timing(); + test_update_periodic(); + disable_and_enable(); close(kqfd); } From owner-svn-src-all@freebsd.org Tue Aug 7 14:47:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E0DB1060DD7; Tue, 7 Aug 2018 14:47:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB27772730; Tue, 7 Aug 2018 14:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7D7B1D382; Tue, 7 Aug 2018 14:47:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77EldsJ069907; Tue, 7 Aug 2018 14:47:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Eld3I069906; Tue, 7 Aug 2018 14:47:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808071447.w77Eld3I069906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 14:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337419 - head/usr.bin/sed X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/sed X-SVN-Commit-Revision: 337419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 14:47:40 -0000 Author: pfg Date: Tue Aug 7 14:47:39 2018 New Revision: 337419 URL: https://svnweb.freebsd.org/changeset/base/337419 Log: sed(1): partial fix for the case of the regex delimited with '['. We don't generally support the weird case of regular expresions delimited by an opening square bracket ('[') but POSIX says that inside bracket expressions, escaping is not possible and both '[' and '\' represent themselves. PR: 230198 (exp-run) Obtained from: OpenBSD Modified: head/usr.bin/sed/compile.c Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Tue Aug 7 14:39:00 2018 (r337418) +++ head/usr.bin/sed/compile.c Tue Aug 7 14:47:39 2018 (r337419) @@ -393,11 +393,11 @@ compile_delimited(char *p, char *d, int is_tr) if ((d = compile_ccl(&p, d)) == NULL) errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); continue; + } else if (*p == '\\' && p[1] == c) { + p++; } else if (*p == '\\' && p[1] == '[') { *d++ = *p++; - } else if (*p == '\\' && p[1] == c) - p++; - else if (*p == '\\' && p[1] == 'n') { + } else if (*p == '\\' && p[1] == 'n') { *d++ = '\n'; p += 2; continue; From owner-svn-src-all@freebsd.org Tue Aug 7 15:03:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F8B10616C0; Tue, 7 Aug 2018 15:03:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4C9973312; Tue, 7 Aug 2018 15:03:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A43D91D6B7; Tue, 7 Aug 2018 15:03:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77F3BAV079816; Tue, 7 Aug 2018 15:03:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77F3BSa079815; Tue, 7 Aug 2018 15:03:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808071503.w77F3BSa079815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 7 Aug 2018 15:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337420 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 337420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 15:03:12 -0000 Author: gjb Date: Tue Aug 7 15:03:11 2018 New Revision: 337420 URL: https://svnweb.freebsd.org/changeset/base/337420 Log: Document SA-18:08. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/11/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Tue Aug 7 14:47:39 2018 (r337419) +++ stable/10/release/doc/share/xml/security.xml Tue Aug 7 15:03:11 2018 (r337420) @@ -106,6 +106,14 @@ Mishandling of x86 debug exceptions + + + FreeBSD-SA-18:08.tcp + 06 August 2018 + Resource exhaustion in TCP + reassembly + From owner-svn-src-all@freebsd.org Tue Aug 7 15:03:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BCAB10616C5; Tue, 7 Aug 2018 15:03:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2187273313; Tue, 7 Aug 2018 15:03:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0291A1D6B8; Tue, 7 Aug 2018 15:03:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77F3BTj079822; Tue, 7 Aug 2018 15:03:11 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77F3BWl079821; Tue, 7 Aug 2018 15:03:11 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808071503.w77F3BWl079821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 7 Aug 2018 15:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337420 - in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/doc/share/xml 11/release/doc/share/xml X-SVN-Commit-Revision: 337420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 15:03:12 -0000 Author: gjb Date: Tue Aug 7 15:03:11 2018 New Revision: 337420 URL: https://svnweb.freebsd.org/changeset/base/337420 Log: Document SA-18:08. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Aug 7 14:47:39 2018 (r337419) +++ stable/11/release/doc/share/xml/security.xml Tue Aug 7 15:03:11 2018 (r337420) @@ -19,9 +19,11 @@ - No advisories -   -   + FreeBSD-SA-18:08.tcp + 06 August 2018 + Resource exhaustion in TCP + reassembly From owner-svn-src-all@freebsd.org Tue Aug 7 15:04:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D84671061851; Tue, 7 Aug 2018 15:04:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1CE73632; Tue, 7 Aug 2018 15:04:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ECFB1D6BB; Tue, 7 Aug 2018 15:04:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77F4rgg080006; Tue, 7 Aug 2018 15:04:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77F4rvA080005; Tue, 7 Aug 2018 15:04:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071504.w77F4rvA080005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 15:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337421 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 337421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 15:04:54 -0000 Author: markj Date: Tue Aug 7 15:04:53 2018 New Revision: 337421 URL: https://svnweb.freebsd.org/changeset/base/337421 Log: MFC r336957: Add a regression test related to PR 131876. PR: 131876 Modified: stable/11/tests/sys/kern/unix_passfd_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/unix_passfd_test.c ============================================================================== --- stable/11/tests/sys/kern/unix_passfd_test.c Tue Aug 7 15:03:11 2018 (r337420) +++ stable/11/tests/sys/kern/unix_passfd_test.c Tue Aug 7 15:04:53 2018 (r337421) @@ -447,6 +447,47 @@ ATF_TC_BODY(truncated_rights, tc) closesocketpair(fd); } +ATF_TC_WITHOUT_HEAD(copyout_rights_error); +ATF_TC_BODY(copyout_rights_error, tc) +{ + struct iovec iovec; + struct msghdr msghdr; + char buf[16]; + ssize_t len; + int fd[2], error, nfds, putfd; + + atf_tc_expect_fail("PR 131876: " + "FD leak when copyout of rights returns an error"); + + memset(buf, 0, sizeof(buf)); + domainsocketpair(fd); + devnull(&putfd); + nfds = getnfds(); + + sendfd_payload(fd[0], putfd, buf, sizeof(buf)); + + bzero(&msghdr, sizeof(msghdr)); + + iovec.iov_base = buf; + iovec.iov_len = sizeof(buf); + msghdr.msg_control = (char *)-1; /* trigger EFAULT */ + msghdr.msg_controllen = CMSG_SPACE(sizeof(int)); + msghdr.msg_iov = &iovec; + msghdr.msg_iovlen = 1; + + len = recvmsg(fd[1], &msghdr, 0); + error = errno; + ATF_REQUIRE_MSG(len == -1, "recvmsg succeeded: %zd", len); + ATF_REQUIRE_MSG(errno == EFAULT, "expected EFAULT, got %d (%s)", + error, strerror(errno)); + + /* Verify that no FDs were leaked. */ + ATF_REQUIRE(getnfds() == nfds); + + close(putfd); + closesocketpair(fd); +} + ATF_TP_ADD_TCS(tp) { @@ -459,6 +500,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, devfs_orphan); ATF_TP_ADD_TC(tp, rights_creds_payload); ATF_TP_ADD_TC(tp, truncated_rights); + ATF_TP_ADD_TC(tp, copyout_rights_error); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Aug 7 15:24:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8291062017; Tue, 7 Aug 2018 15:24:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0283D741CD; Tue, 7 Aug 2018 15:24:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7AFE1D9DC; Tue, 7 Aug 2018 15:24:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77FOJHM090563; Tue, 7 Aug 2018 15:24:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77FOJif090562; Tue, 7 Aug 2018 15:24:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808071524.w77FOJif090562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 15:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337422 - in head/lib/libc: gen inet X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/libc: gen inet X-SVN-Commit-Revision: 337422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 15:24:20 -0000 Author: pfg Date: Tue Aug 7 15:24:19 2018 New Revision: 337422 URL: https://svnweb.freebsd.org/changeset/base/337422 Log: libc: fix cases of undefined behavior. These were found by the Undefined Behavious GsoC project at NetBSD: Avoid undefined behavior in ftok(3) Do not change the signedness bit with a left shift operation. Cast to unsigned integer to prevent this. ftok.c:56:10, left shift of 123456789 by 24 places cannot be represented in type 'int' ftok.c:56:10, left shift of 4160 by 24 places cannot be represented in type 'int' Avoid undefined behavior in an inet_addr.c Do not change the signedness bit with a left shift operation. Cast to unsigned integer to prevent this. inet_addr.c:218:20, left shift of 131 by 24 places cannot be represented in type 'int' Detected with micro-UBSan in the user mode. Obtained from: NetBSD MFC after: 2 weeks Modified: head/lib/libc/gen/ftok.c head/lib/libc/inet/inet_addr.c Modified: head/lib/libc/gen/ftok.c ============================================================================== --- head/lib/libc/gen/ftok.c Tue Aug 7 15:04:53 2018 (r337421) +++ head/lib/libc/gen/ftok.c Tue Aug 7 15:24:19 2018 (r337422) @@ -42,5 +42,6 @@ ftok(const char *path, int id) if (stat(path, &st) < 0) return (key_t)-1; - return (key_t) (id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 0xffff)); + return ((key_t)((unsigned int)id << 24 | (st.st_dev & 0xff) << 16 | + (st.st_ino & 0xffff))); } Modified: head/lib/libc/inet/inet_addr.c ============================================================================== --- head/lib/libc/inet/inet_addr.c Tue Aug 7 15:04:53 2018 (r337421) +++ head/lib/libc/inet/inet_addr.c Tue Aug 7 15:24:19 2018 (r337422) @@ -184,19 +184,20 @@ inet_aton(const char *cp, struct in_addr *addr) { case 2: /*%< a.b -- 8.24 bits */ if (val > 0xffffffU) return (0); - val |= parts[0] << 24; + val |= (uint32_t)parts[0] << 24; break; case 3: /*%< a.b.c -- 8.8.16 bits */ if (val > 0xffffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16); break; case 4: /*%< a.b.c.d -- 8.8.8.8 bits */ if (val > 0xffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16) | + (parts[2] << 8); break; } if (addr != NULL) From owner-svn-src-all@freebsd.org Tue Aug 7 16:36:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0F5A10637A3; Tue, 7 Aug 2018 16:36:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94AD9767A1; Tue, 7 Aug 2018 16:36:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576751E4F3; Tue, 7 Aug 2018 16:36:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77GaoJ8026378; Tue, 7 Aug 2018 16:36:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77GanlD026372; Tue, 7 Aug 2018 16:36:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071636.w77GanlD026372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 16:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337423 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: compat/cloudabi compat/freebsd32 compat/linux kern sys X-SVN-Commit-Revision: 337423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 16:36:51 -0000 Author: markj Date: Tue Aug 7 16:36:48 2018 New Revision: 337423 URL: https://svnweb.freebsd.org/changeset/base/337423 Log: Improve handling of control message truncation. If a recvmsg(2) or recvmmsg(2) caller doesn't provide sufficient space for all control messages, the kernel sets MSG_CTRUNC in the message flags to indicate truncation of the control messages. In the case of SCM_RIGHTS messages, however, we were failing to dispose of the rights that had already been externalized into the recipient's file descriptor table. Add a new function and mbuf type to handle this cleanup task, and use it any time we fail to copy control messages out to the recipient. To simplify cleanup, control message truncation is now only performed at control message boundaries. The change also fixes a few related bugs: - Rights could be leaked to the recipient process if an error occurred while copying out a message's contents. - We failed to set MSG_CTRUNC if the truncation occurred on a control message boundary, e.g., if the caller received two control messages and provided only the exact amount of buffer space needed for the first. PR: 131876 Reviewed by: ed (previous version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16561 Modified: head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/linux/linux_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/sys/mbuf.h Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/cloudabi/cloudabi_sock.c Tue Aug 7 16:36:48 2018 (r337423) @@ -120,24 +120,27 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd sizeof(int); if (nfds > fdslen) { /* Unable to store file descriptors. */ - nfds = fdslen; *rflags |= CLOUDABI_SOCK_RECV_FDS_TRUNCATED; + m_dispose_extcontrolm(control); + break; } error = copyout(CMSG_DATA(chdr), fds, nfds * sizeof(int)); - if (error != 0) { - m_free(control); - return (error); - } + if (error != 0) + break; fds += nfds; fdslen -= nfds; *rfdslen += nfds; } } - m_free(control); + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); + m_free(control); + } } - return (0); + return (error); } int Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 16:36:48 2018 (r337423) @@ -1064,7 +1064,7 @@ freebsd32_copyoutmsghdr(struct msghdr *msg, struct msg FREEBSD32_ALIGN(sizeof(struct cmsghdr))) static size_t -freebsd32_cmsg_convert(struct cmsghdr *cm, void *data, socklen_t datalen) +freebsd32_cmsg_convert(const struct cmsghdr *cm, void *data, socklen_t datalen) { size_t copylen; union { @@ -1122,7 +1122,7 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf { struct cmsghdr *cm; void *data; - socklen_t clen, datalen, datalen_out; + socklen_t clen, datalen, datalen_out, oldclen; int error; caddr_t ctlbuf; int len, maxlen, copylen; @@ -1133,15 +1133,11 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf maxlen = msg->msg_controllen; msg->msg_controllen = 0; - m = control; ctlbuf = msg->msg_control; - - while (m && len > 0) { + for (m = control; m != NULL && len > 0; m = m->m_next) { cm = mtod(m, struct cmsghdr *); clen = m->m_len; - while (cm != NULL) { - if (sizeof(struct cmsghdr) > clen || cm->cmsg_len > clen) { error = EINVAL; @@ -1152,34 +1148,36 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; datalen_out = freebsd32_cmsg_convert(cm, data, datalen); - /* Adjust message length */ - cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + - datalen_out; - - /* Copy cmsghdr */ + /* + * Copy out the message header. Preserve the native + * message size in case we need to inspect the message + * contents later. + */ copylen = sizeof(struct cmsghdr); if (len < copylen) { msg->msg_flags |= MSG_CTRUNC; - copylen = len; + m_dispose_extcontrolm(m); + goto exit; } - + oldclen = cm->cmsg_len; + cm->cmsg_len = FREEBSD32_ALIGN(sizeof(struct cmsghdr)) + + datalen_out; error = copyout(cm, ctlbuf, copylen); - if (error) + cm->cmsg_len = oldclen; + if (error != 0) goto exit; ctlbuf += FREEBSD32_ALIGN(copylen); len -= FREEBSD32_ALIGN(copylen); - if (len <= 0) - break; - - /* Copy data */ copylen = datalen_out; if (len < copylen) { msg->msg_flags |= MSG_CTRUNC; - copylen = len; + m_dispose_extcontrolm(m); + break; } + /* Copy out the message data. */ error = copyout(data, ctlbuf, copylen); if (error) goto exit; @@ -1190,20 +1188,23 @@ freebsd32_copy_msg_out(struct msghdr *msg, struct mbuf if (CMSG_SPACE(datalen) < clen) { clen -= CMSG_SPACE(datalen); cm = (struct cmsghdr *) - ((caddr_t)cm + CMSG_SPACE(datalen)); + ((caddr_t)cm + CMSG_SPACE(datalen)); } else { clen = 0; cm = NULL; } - } - m = m->m_next; + + msg->msg_controllen += FREEBSD32_ALIGN(sizeof(*cm)) + + datalen_out; + } } + if (len == 0 && m != NULL) { + msg->msg_flags |= MSG_CTRUNC; + m_dispose_extcontrolm(m); + } - msg->msg_controllen = (len <= 0) ? maxlen : ctlbuf - (caddr_t)msg->msg_control; - exit: return (error); - } int @@ -1240,19 +1241,22 @@ freebsd32_recvmsg(td, uap) error = kern_recvit(td, uap->s, &msg, UIO_USERSPACE, controlp); if (error == 0) { msg.msg_iov = uiov; - + if (control != NULL) error = freebsd32_copy_msg_out(&msg, control); else msg.msg_controllen = 0; - + if (error == 0) error = freebsd32_copyoutmsghdr(&msg, uap->msg); } free(iov, M_IOV); - if (control != NULL) + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); m_freem(control); + } return (error); } Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/compat/linux/linux_socket.c Tue Aug 7 16:36:48 2018 (r337423) @@ -1263,7 +1263,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc struct cmsgcred *cmcred; struct l_cmsghdr *linux_cmsg = NULL; struct l_ucred linux_ucred; - socklen_t datalen, outlen; + socklen_t datalen, maxlen, outlen; struct l_msghdr linux_msg; struct iovec *iov, *uiov; struct mbuf *control = NULL; @@ -1322,9 +1322,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc goto bad; } - outbuf = PTRIN(linux_msg.msg_control); - outlen = 0; - + maxlen = linux_msg.msg_controllen; + linux_msg.msg_controllen = 0; if (control) { linux_cmsg = malloc(L_CMSG_HDRSZ, M_LINUX, M_WAITOK | M_ZERO); @@ -1332,15 +1331,15 @@ linux_recvmsg_common(struct thread *td, l_int s, struc msg->msg_controllen = control->m_len; cm = CMSG_FIRSTHDR(msg); - + outbuf = PTRIN(linux_msg.msg_control); + outlen = 0; while (cm != NULL) { linux_cmsg->cmsg_type = bsd_to_linux_cmsg_type(cm->cmsg_type); linux_cmsg->cmsg_level = bsd_to_linux_sockopt_level(cm->cmsg_level); - if (linux_cmsg->cmsg_type == -1 - || cm->cmsg_level != SOL_SOCKET) - { + if (linux_cmsg->cmsg_type == -1 || + cm->cmsg_level != SOL_SOCKET) { error = EINVAL; goto bad; } @@ -1348,8 +1347,7 @@ linux_recvmsg_common(struct thread *td, l_int s, struc data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; - switch (cm->cmsg_type) - { + switch (cm->cmsg_type) { case SCM_RIGHTS: if (flags & LINUX_MSG_CMSG_CLOEXEC) { fds = datalen / sizeof(int); @@ -1394,14 +1392,13 @@ linux_recvmsg_common(struct thread *td, l_int s, struc break; } - if (outlen + LINUX_CMSG_LEN(datalen) > - linux_msg.msg_controllen) { + if (outlen + LINUX_CMSG_LEN(datalen) > maxlen) { if (outlen == 0) { error = EMSGSIZE; goto bad; } else { - linux_msg.msg_flags |= - LINUX_MSG_CTRUNC; + linux_msg.msg_flags |= LINUX_MSG_CTRUNC; + m_dispose_extcontrolm(control); goto out; } } @@ -1422,15 +1419,19 @@ linux_recvmsg_common(struct thread *td, l_int s, struc cm = CMSG_NXTHDR(msg, cm); } + linux_msg.msg_controllen = outlen; } out: - linux_msg.msg_controllen = outlen; error = copyout(&linux_msg, msghdr, sizeof(linux_msg)); bad: + if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); + m_freem(control); + } free(iov, M_IOV); - m_freem(control); free(linux_cmsg, M_LINUX); return (error); Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/kern/uipc_syscalls.c Tue Aug 7 16:36:48 2018 (r337423) @@ -905,7 +905,7 @@ kern_recvit(struct thread *td, int s, struct msghdr *m { struct uio auio; struct iovec *iov; - struct mbuf *m, *control = NULL; + struct mbuf *control, *m; caddr_t ctlbuf; struct file *fp; struct socket *so; @@ -952,6 +952,7 @@ kern_recvit(struct thread *td, int s, struct msghdr *m if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif + control = NULL; len = auio.uio_resid; error = soreceive(so, &fromsa, &auio, NULL, (mp->msg_control || controlp) ? &control : NULL, @@ -1015,30 +1016,22 @@ kern_recvit(struct thread *td, int s, struct msghdr *m control->m_data += sizeof (struct cmsghdr); } #endif + ctlbuf = mp->msg_control; len = mp->msg_controllen; - m = control; mp->msg_controllen = 0; - ctlbuf = mp->msg_control; - - while (m && len > 0) { - unsigned int tocopy; - - if (len >= m->m_len) - tocopy = m->m_len; - else { - mp->msg_flags |= MSG_CTRUNC; - tocopy = len; - } - - if ((error = copyout(mtod(m, caddr_t), - ctlbuf, tocopy)) != 0) + for (m = control; m != NULL && len >= m->m_len; m = m->m_next) { + if ((error = copyout(mtod(m, caddr_t), ctlbuf, + m->m_len)) != 0) goto out; - ctlbuf += tocopy; - len -= tocopy; - m = m->m_next; + ctlbuf += m->m_len; + len -= m->m_len; + mp->msg_controllen += m->m_len; } - mp->msg_controllen = ctlbuf - (caddr_t)mp->msg_control; + if (m != NULL) { + mp->msg_flags |= MSG_CTRUNC; + m_dispose_extcontrolm(m); + } } out: fdrop(fp, td); @@ -1050,8 +1043,11 @@ out: if (error == 0 && controlp != NULL) *controlp = control; - else if (control) + else if (control != NULL) { + if (error != 0) + m_dispose_extcontrolm(control); m_freem(control); + } return (error); } @@ -1572,4 +1568,52 @@ getsockaddr(struct sockaddr **namp, caddr_t uaddr, siz *namp = sa; } return (error); +} + +/* + * Dispose of externalized rights from an SCM_RIGHTS message. This function + * should be used in error or truncation cases to avoid leaking file descriptors + * into the recipient's (the current thread's) table. + */ +void +m_dispose_extcontrolm(struct mbuf *m) +{ + struct cmsghdr *cm; + struct file *fp; + struct thread *td; + socklen_t clen, datalen; + int error, fd, *fds, nfd; + + td = curthread; + for (; m != NULL; m = m->m_next) { + if (m->m_type != MT_EXTCONTROL) + continue; + cm = mtod(m, struct cmsghdr *); + clen = m->m_len; + while (clen > 0) { + if (clen < sizeof(*cm)) + panic("%s: truncated mbuf %p", __func__, m); + datalen = CMSG_SPACE(cm->cmsg_len - CMSG_SPACE(0)); + if (clen < datalen) + panic("%s: truncated mbuf %p", __func__, m); + + if (cm->cmsg_level == SOL_SOCKET && + cm->cmsg_type == SCM_RIGHTS) { + fds = (int *)CMSG_DATA(cm); + nfd = (cm->cmsg_len - CMSG_SPACE(0)) / + sizeof(int); + + while (nfd-- > 0) { + fd = *fds++; + error = fget(td, fd, &cap_no_rights, + &fp); + if (error == 0) + fdclose(td, fp, fd); + } + } + clen -= datalen; + cm = (struct cmsghdr *)((uint8_t *)cm + datalen); + } + m_chtype(m, MT_CONTROL); + } } Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/kern/uipc_usrreq.c Tue Aug 7 16:36:48 2018 (r337423) @@ -2050,6 +2050,13 @@ unp_externalize(struct mbuf *control, struct mbuf **co &fdep[i]->fde_caps); unp_externalize_fp(fdep[i]->fde_file); } + + /* + * The new type indicates that the mbuf data refers to + * kernel resources that may need to be released before + * the mbuf is freed. + */ + m_chtype(*controlp, MT_EXTCONTROL); FILEDESC_XUNLOCK(fdesc); free(fdep[0], M_FILECAPS); } else { Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Aug 7 15:24:19 2018 (r337422) +++ head/sys/sys/mbuf.h Tue Aug 7 16:36:48 2018 (r337423) @@ -568,7 +568,8 @@ struct mbuf { #define MT_EXP4 12 /* for experimental use */ #define MT_CONTROL 14 /* extra-data protocol message */ -#define MT_OOBDATA 15 /* expedited data */ +#define MT_EXTCONTROL 15 /* control message with externalized contents */ +#define MT_OOBDATA 16 /* expedited data */ #define MT_NOINIT 255 /* Not a type but a flag to allocate a non-initialized mbuf */ @@ -633,6 +634,7 @@ void m_demote_pkthdr(struct mbuf *); void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); +void m_dispose_extcontrolm(struct mbuf *m); struct mbuf *m_dup(const struct mbuf *, int); int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, From owner-svn-src-all@freebsd.org Tue Aug 7 16:39:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85F5A106391E; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BFD376A22; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1031E523; Tue, 7 Aug 2018 16:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Gd7cJ026523; Tue, 7 Aug 2018 16:39:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Gd74N026522; Tue, 7 Aug 2018 16:39:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071639.w77Gd74N026522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 16:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337424 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 337424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 16:39:08 -0000 Author: markj Date: Tue Aug 7 16:39:07 2018 New Revision: 337424 URL: https://svnweb.freebsd.org/changeset/base/337424 Log: Update PR 131876 regression tests after r337423. - Add some more cases to the truncation test. - Remove the "expect fail" annotations. PR: 131876 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16562 Modified: head/tests/sys/kern/unix_passfd_test.c Modified: head/tests/sys/kern/unix_passfd_test.c ============================================================================== --- head/tests/sys/kern/unix_passfd_test.c Tue Aug 7 16:36:48 2018 (r337423) +++ head/tests/sys/kern/unix_passfd_test.c Tue Aug 7 16:39:07 2018 (r337424) @@ -119,6 +119,20 @@ getnfds(void) } static void +putfds(char *buf, int fd, int nfds) +{ + struct cmsghdr *cm; + int *fdp, i; + + cm = (struct cmsghdr *)buf; + cm->cmsg_len = CMSG_LEN(nfds * sizeof(int)); + cm->cmsg_level = SOL_SOCKET; + cm->cmsg_type = SCM_RIGHTS; + for (fdp = (int *)CMSG_DATA(cm), i = 0; i < nfds; i++) + *fdp++ = fd; +} + +static void samefile(struct stat *sb1, struct stat *sb2) { @@ -131,7 +145,6 @@ sendfd_payload(int sockfd, int send_fd, void *payload, { struct iovec iovec; char message[CMSG_SPACE(sizeof(int))]; - struct cmsghdr *cmsghdr; struct msghdr msghdr; ssize_t len; @@ -147,13 +160,8 @@ sendfd_payload(int sockfd, int send_fd, void *payload, msghdr.msg_iov = &iovec; msghdr.msg_iovlen = 1; - cmsghdr = (struct cmsghdr *)(void *)message; - cmsghdr->cmsg_len = CMSG_LEN(sizeof(int)); - cmsghdr->cmsg_level = SOL_SOCKET; - cmsghdr->cmsg_type = SCM_RIGHTS; - memcpy(CMSG_DATA(cmsghdr), &send_fd, sizeof(int)); - - len = sendmsg(sockfd, &msghdr, MSG_DONTWAIT); + putfds(message, send_fd, 1); + len = sendmsg(sockfd, &msghdr, 0); ATF_REQUIRE_MSG(len != -1, "sendmsg failed: %s", strerror(errno)); return ((size_t)len); } @@ -185,20 +193,22 @@ localcreds(int sockfd) } static void -recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen) +recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen, + size_t cmsgsz) { struct cmsghdr *cmsghdr; - char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + - CMSG_SPACE(sizeof(int))]; struct msghdr msghdr; struct iovec iovec; + char *message; ssize_t len; bool foundcreds; bzero(&msghdr, sizeof(msghdr)); + message = malloc(cmsgsz); + ATF_REQUIRE(message != NULL); msghdr.msg_control = message; - msghdr.msg_controllen = sizeof(message); + msghdr.msg_controllen = cmsgsz; iovec.iov_base = buf; iovec.iov_len = buflen; @@ -237,7 +247,8 @@ recvfd(int sockfd, int *recv_fd) { char ch = 0; - recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch)); + recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch), + CMSG_SPACE(sizeof(int))); } /* @@ -418,65 +429,159 @@ ATF_TC_BODY(rights_creds_payload, tc) len = sendfd_payload(fd[0], putfd, buf, sendspace); ATF_REQUIRE_MSG(len < sendspace, "sendmsg: %zu bytes sent", len); - recvfd_payload(fd[1], &getfd, buf, len); + recvfd_payload(fd[1], &getfd, buf, len, + CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(int))); close(putfd); close(getfd); closesocketpair(fd); } +static void +send_cmsg(int sockfd, void *cmsg, size_t cmsgsz) +{ + struct iovec iov; + struct msghdr msghdr; + ssize_t len; + char ch; + + ch = 0; + bzero(&msghdr, sizeof(msghdr)); + + iov.iov_base = &ch; + iov.iov_len = sizeof(ch); + msghdr.msg_control = cmsg; + msghdr.msg_controllen = cmsgsz; + msghdr.msg_iov = &iov; + msghdr.msg_iovlen = 1; + + len = sendmsg(sockfd, &msghdr, 0); + ATF_REQUIRE_MSG(len != -1, + "sendmsg failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(len == sizeof(ch), + "sendmsg: %zd bytes sent; expected %zu", len, sizeof(ch)); +} + +static void +recv_cmsg(int sockfd, char *cmsg, size_t cmsgsz, int flags) +{ + struct iovec iov; + struct msghdr msghdr; + ssize_t len; + char ch; + + ch = 0; + bzero(&msghdr, sizeof(msghdr)); + + iov.iov_base = &ch; + iov.iov_len = sizeof(ch); + msghdr.msg_control = cmsg; + msghdr.msg_controllen = cmsgsz; + msghdr.msg_iov = &iov; + msghdr.msg_iovlen = 1; + + len = recvmsg(sockfd, &msghdr, 0); + ATF_REQUIRE_MSG(len != -1, + "recvmsg failed: %s", strerror(errno)); + ATF_REQUIRE_MSG(len == sizeof(ch), + "recvmsg: %zd bytes received; expected %zu", len, sizeof(ch)); + ATF_REQUIRE_MSG((msghdr.msg_flags & flags) == flags, + "recvmsg: got flags %#x; expected %#x", msghdr.msg_flags, flags); +} + /* - * Test for PR 131876. Receiver uses a control message buffer that is too + * Test for PR 131876. Receiver uses a control message buffer that is too * small for the incoming SCM_RIGHTS message, so the message is truncated. * The kernel must not leak the copied right into the receiver's namespace. */ ATF_TC_WITHOUT_HEAD(truncated_rights); ATF_TC_BODY(truncated_rights, tc) { - struct iovec iovec; - struct msghdr msghdr; - char buf[16], message[CMSG_SPACE(0)]; - ssize_t len; - int fd[2], nfds, putfd; + char *message; + int fd[2], nfds, putfd, rc; - atf_tc_expect_fail("PR 131876: " - "FD leak when 'control' message is truncated"); - - memset(buf, 42, sizeof(buf)); domainsocketpair(fd); devnull(&putfd); nfds = getnfds(); - len = sendfd_payload(fd[0], putfd, buf, sizeof(buf)); - ATF_REQUIRE_MSG(len == sizeof(buf), - "sendmsg: %zd bytes sent; expected %zu; %s", len, sizeof(buf), - strerror(errno)); + /* + * Case 1: Send a single descriptor and truncate the message. + */ + message = malloc(CMSG_SPACE(sizeof(int))); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + send_cmsg(fd[0], message, CMSG_LEN(sizeof(int))); + recv_cmsg(fd[1], message, CMSG_LEN(0), MSG_CTRUNC); + ATF_REQUIRE(getnfds() == nfds); + free(message); - bzero(&msghdr, sizeof(msghdr)); - bzero(message, sizeof(message)); + /* + * Case 2a: Send two descriptors in separate messages, and truncate at + * the boundary between the two messages. We should still + * receive the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC); + rc = close(*(int *)CMSG_DATA(message)); + ATF_REQUIRE_MSG(rc == 0, "close failed: %s", strerror(errno)); + ATF_REQUIRE(getnfds() == nfds); + free(message); - iovec.iov_base = buf; - iovec.iov_len = sizeof(buf); - msghdr.msg_control = message; - msghdr.msg_controllen = sizeof(message); - msghdr.msg_iov = &iovec; - msghdr.msg_iovlen = 1; + /* + * Case 2b: Send two descriptors in separate messages, and truncate + * before the end of the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(0), MSG_CTRUNC); + ATF_REQUIRE(getnfds() == nfds); + free(message); - len = recvmsg(fd[1], &msghdr, 0); - ATF_REQUIRE_MSG(len != -1, "recvmsg failed: %s", strerror(errno)); - ATF_REQUIRE_MSG((size_t)len == sizeof(buf), - "recvmsg: %zd bytes received; expected %zd", len, sizeof(buf)); - for (size_t i = 0; i < sizeof(buf); i++) - ATF_REQUIRE_MSG(buf[i] == 42, "unexpected buffer contents"); + /* + * Case 2c: Send two descriptors in separate messages, and truncate + * after the end of the first message. We should still + * receive the first message. + */ + message = malloc(CMSG_SPACE(sizeof(int)) * 2); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 1); + putfds(message + CMSG_SPACE(sizeof(int)), putfd, 1); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int)) * 2); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)) + CMSG_SPACE(0), + MSG_CTRUNC); + rc = close(*(int *)CMSG_DATA(message)); + ATF_REQUIRE_MSG(rc == 0, "close failed: %s", strerror(errno)); + ATF_REQUIRE(getnfds() == nfds); + free(message); - ATF_REQUIRE_MSG((msghdr.msg_flags & MSG_CTRUNC) != 0, - "MSG_CTRUNC not set after truncation"); + /* + * Case 3: Send three descriptors in the same message, and leave space + * only for the first when receiving the message. + */ + message = malloc(CMSG_SPACE(sizeof(int) * 3)); + ATF_REQUIRE(message != NULL); + putfds(message, putfd, 3); + send_cmsg(fd[0], message, CMSG_SPACE(sizeof(int) * 3)); + recv_cmsg(fd[1], message, CMSG_SPACE(sizeof(int)), MSG_CTRUNC); ATF_REQUIRE(getnfds() == nfds); + free(message); close(putfd); closesocketpair(fd); } +/* + * Ensure that an attempt to copy a SCM_RIGHTS message to the recipient + * fails. In this case the kernel must dispose of the externalized rights + * rather than leaking them into the recipient's file descriptor table. + */ ATF_TC_WITHOUT_HEAD(copyout_rights_error); ATF_TC_BODY(copyout_rights_error, tc) { @@ -485,9 +590,6 @@ ATF_TC_BODY(copyout_rights_error, tc) char buf[16]; ssize_t len; int fd[2], error, nfds, putfd; - - atf_tc_expect_fail("PR 131876: " - "FD leak when copyout of rights returns an error"); memset(buf, 0, sizeof(buf)); domainsocketpair(fd); From owner-svn-src-all@freebsd.org Tue Aug 7 17:13:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29931064E96; Tue, 7 Aug 2018 17:13:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5831D7819B; Tue, 7 Aug 2018 17:13:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33A861EBA2; Tue, 7 Aug 2018 17:13:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77HDhOE046662; Tue, 7 Aug 2018 17:13:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HDg82046660; Tue, 7 Aug 2018 17:13:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071713.w77HDg82046660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 17:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337425 - head/sys/dev/mii X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/mii X-SVN-Commit-Revision: 337425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 17:13:43 -0000 Author: markj Date: Tue Aug 7 17:13:42 2018 New Revision: 337425 URL: https://svnweb.freebsd.org/changeset/base/337425 Log: Recognize ICS1893C PHYs. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/dev/mii/icsphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/icsphy.c ============================================================================== --- head/sys/dev/mii/icsphy.c Tue Aug 7 16:39:07 2018 (r337424) +++ head/sys/dev/mii/icsphy.c Tue Aug 7 17:13:42 2018 (r337425) @@ -113,6 +113,7 @@ static const struct mii_phydesc icsphys[] = { MII_PHY_DESC(ICS, 1890), MII_PHY_DESC(ICS, 1892), MII_PHY_DESC(ICS, 1893), + MII_PHY_DESC(ICS, 1893C), MII_PHY_END }; Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Tue Aug 7 16:39:07 2018 (r337424) +++ head/sys/dev/mii/miidevs Tue Aug 7 17:13:42 2018 (r337425) @@ -224,6 +224,7 @@ model ICS 1889 0x0001 ICS1889 10/100 media interface model ICS 1890 0x0002 ICS1890 10/100 media interface model ICS 1892 0x0003 ICS1892 10/100 media interface model ICS 1893 0x0004 ICS1893 10/100 media interface +model ICS 1893C 0x0005 ICS1893C 10/100 media interface /* Intel Corporation PHYs */ model xxINTEL I82553 0x0000 i82553 10/100 media interface From owner-svn-src-all@freebsd.org Tue Aug 7 17:25:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4538310653DC; Tue, 7 Aug 2018 17:25:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC7677876C; Tue, 7 Aug 2018 17:25:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C96551ED6E; Tue, 7 Aug 2018 17:25:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77HPcMj051598; Tue, 7 Aug 2018 17:25:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HPciT051597; Tue, 7 Aug 2018 17:25:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808071725.w77HPciT051597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 7 Aug 2018 17:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337426 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337426 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 17:25:39 -0000 Author: markj Date: Tue Aug 7 17:25:38 2018 New Revision: 337426 URL: https://svnweb.freebsd.org/changeset/base/337426 Log: ifconfig: Fix use of _Noreturn. The _Noreturn is a function-specifier (like inline) which must preceed the declarator. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static void tunnel_status(int s); -static void usage(void) _Noreturn; +static _Noreturn void usage(void); static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); From owner-svn-src-all@freebsd.org Tue Aug 7 17:44:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 777231065F78; Tue, 7 Aug 2018 17:44:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A27D79BCE; Tue, 7 Aug 2018 17:44:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BD951F0AE; Tue, 7 Aug 2018 17:44:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77HiD3K061783; Tue, 7 Aug 2018 17:44:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HiDvC061781; Tue, 7 Aug 2018 17:44:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071744.w77HiDvC061781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 17:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337427 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 337427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 17:44:14 -0000 Author: kib Date: Tue Aug 7 17:44:13 2018 New Revision: 337427 URL: https://svnweb.freebsd.org/changeset/base/337427 Log: MFC r336980: Provide compat32 shims for sched_rr_get_interval(2). PR: 230175 Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/freebsd32/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 17:25:38 2018 (r337426) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 7 17:44:13 2018 (r337427) @@ -3175,3 +3175,20 @@ freebsd32_ppoll(struct thread *td, struct freebsd32_pp return (kern_poll(td, uap->fds, uap->nfds, tsp, ssp)); } + +int +freebsd32_sched_rr_get_interval(struct thread *td, + struct freebsd32_sched_rr_get_interval_args *uap) +{ + struct timespec ts; + struct timespec32 ts32; + int error; + + error = kern_sched_rr_get_interval(td, uap->pid, &ts); + if (error == 0) { + CP(ts, ts32, tv_sec); + CP(ts, ts32, tv_nsec); + error = copyout(&ts32, uap->interval, sizeof(ts32)); + } + return (error); +} Modified: stable/11/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/11/sys/compat/freebsd32/syscalls.master Tue Aug 7 17:25:38 2018 (r337426) +++ stable/11/sys/compat/freebsd32/syscalls.master Tue Aug 7 17:44:13 2018 (r337427) @@ -602,8 +602,9 @@ 331 AUE_NULL NOPROTO { int sched_yield (void); } 332 AUE_NULL NOPROTO { int sched_get_priority_max (int policy); } 333 AUE_NULL NOPROTO { int sched_get_priority_min (int policy); } -334 AUE_NULL NOPROTO { int sched_rr_get_interval (pid_t pid, \ - struct timespec *interval); } +334 AUE_NULL STD { int freebsd32_sched_rr_get_interval ( \ + pid_t pid, \ + struct timespec32 *interval); } 335 AUE_NULL NOPROTO { int utrace(const void *addr, size_t len); } 336 AUE_SENDFILE COMPAT4 { int freebsd32_sendfile(int fd, int s, \ uint32_t offset1, uint32_t offset2, \ From owner-svn-src-all@freebsd.org Tue Aug 7 17:44:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE23C1065FB2; Tue, 7 Aug 2018 17:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 745FD79CE2; Tue, 7 Aug 2018 17:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5560C1F0B0; Tue, 7 Aug 2018 17:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77HicQb061863; Tue, 7 Aug 2018 17:44:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77HibnO061858; Tue, 7 Aug 2018 17:44:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071744.w77HibnO061858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 17:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337428 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 337428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 17:44:39 -0000 Author: kib Date: Tue Aug 7 17:44:36 2018 New Revision: 337428 URL: https://svnweb.freebsd.org/changeset/base/337428 Log: Regen. Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h stable/11/sys/compat/freebsd32/freebsd32_syscall.h stable/11/sys/compat/freebsd32/freebsd32_syscalls.c stable/11/sys/compat/freebsd32/freebsd32_sysent.c stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_proto.h Tue Aug 7 17:44:13 2018 (r337427) +++ stable/11/sys/compat/freebsd32/freebsd32_proto.h Tue Aug 7 17:44:36 2018 (r337428) @@ -296,6 +296,10 @@ struct freebsd32_aio_suspend_args { struct freebsd32_aio_error_args { char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; }; +struct freebsd32_sched_rr_get_interval_args { + char pid_l_[PADL_(pid_t)]; pid_t pid; char pid_r_[PADR_(pid_t)]; + char interval_l_[PADL_(struct timespec32 *)]; struct timespec32 * interval; char interval_r_[PADR_(struct timespec32 *)]; +}; struct freebsd32_jail_args { char jail_l_[PADL_(struct jail32 *)]; struct jail32 * jail; char jail_r_[PADR_(struct jail32 *)]; }; @@ -751,6 +755,7 @@ int freebsd32_kldstat(struct thread *, struct freebsd3 int freebsd32_aio_return(struct thread *, struct freebsd32_aio_return_args *); int freebsd32_aio_suspend(struct thread *, struct freebsd32_aio_suspend_args *); int freebsd32_aio_error(struct thread *, struct freebsd32_aio_error_args *); +int freebsd32_sched_rr_get_interval(struct thread *, struct freebsd32_sched_rr_get_interval_args *); int freebsd32_jail(struct thread *, struct freebsd32_jail_args *); int freebsd32_sigtimedwait(struct thread *, struct freebsd32_sigtimedwait_args *); int freebsd32_sigwaitinfo(struct thread *, struct freebsd32_sigwaitinfo_args *); @@ -1215,6 +1220,7 @@ int freebsd10_freebsd32_pipe(struct thread *, struct f #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_read AUE_NULL #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_write AUE_NULL #define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_sched_rr_get_interval AUE_NULL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE #define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION Modified: stable/11/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscall.h Tue Aug 7 17:44:13 2018 (r337427) +++ stable/11/sys/compat/freebsd32/freebsd32_syscall.h Tue Aug 7 17:44:36 2018 (r337428) @@ -271,7 +271,7 @@ #define FREEBSD32_SYS_sched_yield 331 #define FREEBSD32_SYS_sched_get_priority_max 332 #define FREEBSD32_SYS_sched_get_priority_min 333 -#define FREEBSD32_SYS_sched_rr_get_interval 334 +#define FREEBSD32_SYS_freebsd32_sched_rr_get_interval 334 #define FREEBSD32_SYS_utrace 335 /* 336 is freebsd4 freebsd32_sendfile */ #define FREEBSD32_SYS_kldsym 337 Modified: stable/11/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Tue Aug 7 17:44:13 2018 (r337427) +++ stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Tue Aug 7 17:44:36 2018 (r337428) @@ -343,7 +343,7 @@ const char *freebsd32_syscallnames[] = { "sched_yield", /* 331 = sched_yield */ "sched_get_priority_max", /* 332 = sched_get_priority_max */ "sched_get_priority_min", /* 333 = sched_get_priority_min */ - "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ + "freebsd32_sched_rr_get_interval", /* 334 = freebsd32_sched_rr_get_interval */ "utrace", /* 335 = utrace */ "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ "kldsym", /* 337 = kldsym */ Modified: stable/11/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_sysent.c Tue Aug 7 17:44:13 2018 (r337427) +++ stable/11/sys/compat/freebsd32/freebsd32_sysent.c Tue Aug 7 17:44:36 2018 (r337428) @@ -386,7 +386,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)sys_sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */ { AS(sched_get_priority_max_args), (sy_call_t *)sys_sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ { AS(sched_get_priority_min_args), (sy_call_t *)sys_sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ - { AS(sched_rr_get_interval_args), (sy_call_t *)sys_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ + { AS(freebsd32_sched_rr_get_interval_args), (sy_call_t *)freebsd32_sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = freebsd32_sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)sys_utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)sys_kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ Modified: stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Aug 7 17:44:13 2018 (r337427) +++ stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Aug 7 17:44:36 2018 (r337428) @@ -1652,11 +1652,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } - /* sched_rr_get_interval */ + /* freebsd32_sched_rr_get_interval */ case 334: { - struct sched_rr_get_interval_args *p = params; + struct freebsd32_sched_rr_get_interval_args *p = params; iarg[0] = p->pid; /* pid_t */ - uarg[1] = (intptr_t) p->interval; /* struct timespec * */ + uarg[1] = (intptr_t) p->interval; /* struct timespec32 * */ *n_args = 2; break; } @@ -5944,14 +5944,14 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* sched_rr_get_interval */ + /* freebsd32_sched_rr_get_interval */ case 334: switch(ndx) { case 0: p = "pid_t"; break; case 1: - p = "struct timespec *"; + p = "struct timespec32 *"; break; default: break; @@ -9918,7 +9918,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; - /* sched_rr_get_interval */ + /* freebsd32_sched_rr_get_interval */ case 334: if (ndx == 0 || ndx == 1) p = "int"; From owner-svn-src-all@freebsd.org Tue Aug 7 17:45:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDBF0106605D; Tue, 7 Aug 2018 17:45:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8167F79E72; Tue, 7 Aug 2018 17:45:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6286B1F0B3; Tue, 7 Aug 2018 17:45:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Hjos9061988; Tue, 7 Aug 2018 17:45:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Hjoc4061987; Tue, 7 Aug 2018 17:45:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071745.w77Hjoc4061987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 17:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337429 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 337429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 17:45:51 -0000 Author: kib Date: Tue Aug 7 17:45:49 2018 New Revision: 337429 URL: https://svnweb.freebsd.org/changeset/base/337429 Log: MFC r336987: For compat32, emulate the same wraparound check as occurs on the real ILP32 system. PR: 230162 Modified: stable/11/sys/vm/vm_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_mmap.c ============================================================================== --- stable/11/sys/vm/vm_mmap.c Tue Aug 7 17:44:36 2018 (r337428) +++ stable/11/sys/vm/vm_mmap.c Tue Aug 7 17:45:49 2018 (r337429) @@ -596,6 +596,12 @@ kern_mprotect(struct thread *td, uintptr_t addr0, size addr -= pageoff; size += pageoff; size = (vm_size_t) round_page(size); +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + if (((addr + size) & 0xffffffff) < addr) + return (EINVAL); + } else +#endif if (addr + size < addr) return (EINVAL); From owner-svn-src-all@freebsd.org Tue Aug 7 18:26:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2475110672B2; Tue, 7 Aug 2018 18:26:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DCC7B43C; Tue, 7 Aug 2018 18:26:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B2DF1F721; Tue, 7 Aug 2018 18:26:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77IQkhF082478; Tue, 7 Aug 2018 18:26:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77IQktX082477; Tue, 7 Aug 2018 18:26:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071826.w77IQktX082477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 18:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337430 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 18:26:47 -0000 Author: kib Date: Tue Aug 7 18:26:46 2018 New Revision: 337430 URL: https://svnweb.freebsd.org/changeset/base/337430 Log: Add missed handling of local relocs against ifunc target in the obj modules. Reported and tested by: wulf Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Aug 7 17:45:49 2018 (r337429) +++ head/sys/kern/link_elf_obj.c Tue Aug 7 18:26:46 2018 (r337430) @@ -142,7 +142,7 @@ static int link_elf_each_function_name(linker_file_t, static int link_elf_each_function_nameval(linker_file_t, linker_function_nameval_callback_t, void *); -static int link_elf_reloc_local(linker_file_t); +static int link_elf_reloc_local(linker_file_t, bool); static long link_elf_symtab_get(linker_file_t, const Elf_Sym **); static long link_elf_strtab_get(linker_file_t, caddr_t *); @@ -441,10 +441,9 @@ link_elf_link_preload(linker_class_t cls, const char * } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; - *result = lf; return (0); @@ -479,13 +478,18 @@ link_elf_link_preload_finish(linker_file_t lf) ef = (elf_file_t)lf; error = relocate_file(ef); if (error) - return error; + return (error); /* Notify MD code that a module is being loaded. */ error = elf_cpu_load_file(lf); if (error) return (error); + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + return (error); + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); return (0); @@ -969,7 +973,7 @@ link_elf_load_file(linker_class_t cls, const char *fil } /* Local intra-module relocations */ - error = link_elf_reloc_local(lf); + error = link_elf_reloc_local(lf, false); if (error != 0) goto out; @@ -990,6 +994,11 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; + /* Now ifuncs. */ + error = link_elf_reloc_local(lf, true); + if (error != 0) + goto out; + /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1374,7 +1383,10 @@ elf_obj_lookup(linker_file_t lf, Elf_Size symidx, int /* Quick answer if there is a definition included. */ if (sym->st_shndx != SHN_UNDEF) { - *res = sym->st_value; + res1 = (Elf_Addr)sym->st_value; + if (ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) + res1 = ((Elf_Addr (*)(void))res1)(); + *res = res1; return (0); } @@ -1470,7 +1482,7 @@ link_elf_fix_link_set(elf_file_t ef) } static int -link_elf_reloc_local(linker_file_t lf) +link_elf_reloc_local(linker_file_t lf, bool ifuncs) { elf_file_t ef = (elf_file_t)lf; const Elf_Rel *rellim; @@ -1505,8 +1517,13 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); + else if (ifuncs) + elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup); } } @@ -1531,8 +1548,13 @@ link_elf_reloc_local(linker_file_t lf) /* Only do local relocs */ if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; - elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); + if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC) == + ifuncs) + elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); + else if (ifuncs) + elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup); } } return (0); From owner-svn-src-all@freebsd.org Tue Aug 7 18:29:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A024710673BE; Tue, 7 Aug 2018 18:29:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54F3E7B5DE; Tue, 7 Aug 2018 18:29:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EFD1F724; Tue, 7 Aug 2018 18:29:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77ITBPB082614; Tue, 7 Aug 2018 18:29:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77ITAV8082610; Tue, 7 Aug 2018 18:29:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808071829.w77ITAV8082610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 18:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337431 - in head/sys/amd64: linux linux32 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: linux linux32 X-SVN-Commit-Revision: 337431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 18:29:11 -0000 Author: kib Date: Tue Aug 7 18:29:10 2018 New Revision: 337431 URL: https://svnweb.freebsd.org/changeset/base/337431 Log: Futex support functions in linux.ko and linux32.ko on amd64 should be aware of SMAP. Reported and tested by: Johannes Lundberg , wulf Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_machdep.c head/sys/amd64/linux/linux_support.s head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_support.s Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux/linux_machdep.c Tue Aug 7 18:29:10 2018 (r337431) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include #include @@ -88,8 +91,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - int linux_execve(struct thread *td, struct linux_execve_args *args) { @@ -275,4 +276,49 @@ linux_set_cloned_tls(struct thread *td, void *desc) td->td_frame->tf_fs = _ufssel; return (0); +} + +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xchgl_smap : futex_xchgl_nosmap); +} + +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_addl_smap : futex_addl_nosmap); +} + +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_orl_smap : futex_orl_nosmap); +} + +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_andl_smap : futex_andl_nosmap); +} + +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xorl_smap : futex_xorl_nosmap); } Modified: head/sys/amd64/linux/linux_support.s ============================================================================== --- head/sys/amd64/linux/linux_support.s Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux/linux_support.s Tue Aug 7 18:29:10 2018 (r337431) @@ -38,7 +38,7 @@ futex_fault: movl $-EFAULT,%eax ret -ENTRY(futex_xchgl) +ENTRY(futex_xchgl_nosmap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -49,14 +49,29 @@ ENTRY(futex_xchgl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xchgl) +END(futex_xchgl_nosmap) -ENTRY(futex_addl) +ENTRY(futex_xchgl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac + xchgl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xchgl_smap) + +ENTRY(futex_addl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault #ifdef SMP lock #endif @@ -65,14 +80,32 @@ ENTRY(futex_addl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_addl) +END(futex_addl_nosmap) -ENTRY(futex_orl) +ENTRY(futex_addl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac +#ifdef SMP + lock +#endif + xaddl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_addl_smap) + +ENTRY(futex_orl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx orl %edi,%ecx @@ -85,9 +118,9 @@ ENTRY(futex_orl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_orl) +END(futex_orl_nosmap) -ENTRY(futex_andl) +ENTRY(futex_orl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -95,6 +128,28 @@ ENTRY(futex_andl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + orl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_orl_smap) + +ENTRY(futex_andl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx andl %edi,%ecx #ifdef SMP lock @@ -105,9 +160,9 @@ ENTRY(futex_andl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_andl) +END(futex_andl_nosmap) -ENTRY(futex_xorl) +ENTRY(futex_andl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -115,6 +170,28 @@ ENTRY(futex_xorl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + andl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_andl_smap) + +ENTRY(futex_xorl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx xorl %edi,%ecx #ifdef SMP lock @@ -125,4 +202,26 @@ ENTRY(futex_xorl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xorl) +END(futex_xorl_nosmap) + +ENTRY(futex_xorl_smap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx + xorl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xorl_smap) Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux32/linux32_machdep.c Tue Aug 7 18:29:10 2018 (r337431) @@ -58,10 +58,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include +#include #include #include @@ -821,4 +823,49 @@ linux_set_thread_area(struct thread *td, update_gdt_gsbase(td, info.base_addr); return (0); +} + +int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xchgl_smap : futex_xchgl_nosmap); +} + +int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_addl_smap : futex_addl_nosmap); +} + +int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_orl_smap : futex_orl_nosmap); +} + +int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_andl_smap : futex_andl_nosmap); +} + +int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + futex_xorl_smap : futex_xorl_nosmap); } Modified: head/sys/amd64/linux32/linux32_support.s ============================================================================== --- head/sys/amd64/linux32/linux32_support.s Tue Aug 7 18:26:46 2018 (r337430) +++ head/sys/amd64/linux32/linux32_support.s Tue Aug 7 18:29:10 2018 (r337431) @@ -38,7 +38,7 @@ futex_fault: movl $-EFAULT,%eax ret -ENTRY(futex_xchgl) +ENTRY(futex_xchgl_nosmap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -49,14 +49,29 @@ ENTRY(futex_xchgl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xchgl) +END(futex_xchgl_nosmap) -ENTRY(futex_addl) +ENTRY(futex_xchgl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac + xchgl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xchgl_smap) + +ENTRY(futex_addl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault #ifdef SMP lock #endif @@ -65,14 +80,32 @@ ENTRY(futex_addl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_addl) +END(futex_addl_nosmap) -ENTRY(futex_orl) +ENTRY(futex_addl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi ja futex_fault + stac +#ifdef SMP + lock +#endif + xaddl %edi,(%rsi) + clac + movl %edi,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_addl_smap) + +ENTRY(futex_orl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx orl %edi,%ecx @@ -85,9 +118,9 @@ ENTRY(futex_orl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_orl) +END(futex_orl_nosmap) -ENTRY(futex_andl) +ENTRY(futex_orl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -95,6 +128,28 @@ ENTRY(futex_andl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + orl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_orl_smap) + +ENTRY(futex_andl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx andl %edi,%ecx #ifdef SMP lock @@ -105,9 +160,9 @@ ENTRY(futex_andl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_andl) +END(futex_andl_nosmap) -ENTRY(futex_xorl) +ENTRY(futex_andl_smap) movq PCPU(CURPCB),%r8 movq $futex_fault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax @@ -115,6 +170,28 @@ ENTRY(futex_xorl) ja futex_fault movl (%rsi),%eax 1: movl %eax,%ecx + andl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_andl_smap) + +ENTRY(futex_xorl_nosmap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx xorl %edi,%ecx #ifdef SMP lock @@ -125,4 +202,26 @@ ENTRY(futex_xorl) xorl %eax,%eax movq %rax,PCB_ONFAULT(%r8) ret -END(futex_xorl) +END(futex_xorl_nosmap) + +ENTRY(futex_xorl_smap) + movq PCPU(CURPCB),%r8 + movq $futex_fault,PCB_ONFAULT(%r8) + movq $VM_MAXUSER_ADDRESS-4,%rax + cmpq %rax,%rsi + ja futex_fault + movl (%rsi),%eax +1: movl %eax,%ecx + xorl %edi,%ecx + stac +#ifdef SMP + lock +#endif + cmpxchgl %ecx,(%rsi) + clac + jnz 1b + movl %eax,(%rdx) + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + ret +END(futex_xorl_smap) From owner-svn-src-all@freebsd.org Tue Aug 7 18:56:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 612C51067C3B; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D687C398; Tue, 7 Aug 2018 18:56:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED3501FBE2; Tue, 7 Aug 2018 18:56:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Iu1Ba097732; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Iu1tv097731; Tue, 7 Aug 2018 18:56:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071856.w77Iu1tv097731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337432 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 337432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 18:56:02 -0000 Author: marius Date: Tue Aug 7 18:56:01 2018 New Revision: 337432 URL: https://svnweb.freebsd.org/changeset/base/337432 Log: Implement atomic_swap_64(9). Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Tue Aug 7 18:29:10 2018 (r337431) +++ head/sys/arm/include/atomic-v4.h Tue Aug 7 18:56:01 2018 (r337432) @@ -249,6 +249,19 @@ atomic_subtract_64(volatile u_int64_t *p, u_int64_t va __with_interrupts_disabled(*p -= val); } +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t value; + + __with_interrupts_disabled( + { + value = *p; + *p = v; + }); + return (value); +} + #else /* !_KERNEL */ static __inline void From owner-svn-src-all@freebsd.org Tue Aug 7 18:56:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 557CC1067C91; Tue, 7 Aug 2018 18:56:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB747C500; Tue, 7 Aug 2018 18:56:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFCD31FBE3; Tue, 7 Aug 2018 18:56:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77IupEt097803; Tue, 7 Aug 2018 18:56:51 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77IupF9097802; Tue, 7 Aug 2018 18:56:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071856.w77IupF9097802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337433 - head/sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/riscv/include X-SVN-Commit-Revision: 337433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 18:56:52 -0000 Author: marius Date: Tue Aug 7 18:56:51 2018 New Revision: 337433 URL: https://svnweb.freebsd.org/changeset/base/337433 Log: Implement atomic_swap_{int,long,ptr}(9). Modified: head/sys/riscv/include/atomic.h Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Tue Aug 7 18:56:01 2018 (r337432) +++ head/sys/riscv/include/atomic.h Tue Aug 7 18:56:51 2018 (r337433) @@ -412,6 +412,8 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) return (old); } +#define atomic_swap_int atomic_swap_32 + #define atomic_add_long atomic_add_64 #define atomic_clear_long atomic_clear_64 #define atomic_cmpset_long atomic_cmpset_64 @@ -420,6 +422,7 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) #define atomic_readandclear_long atomic_readandclear_64 #define atomic_set_long atomic_set_64 #define atomic_subtract_long atomic_subtract_64 +#define atomic_swap_long atomic_swap_64 #define atomic_add_ptr atomic_add_64 #define atomic_clear_ptr atomic_clear_64 @@ -429,6 +432,7 @@ atomic_swap_64(volatile uint64_t *p, uint64_t val) #define atomic_readandclear_ptr atomic_readandclear_64 #define atomic_set_ptr atomic_set_64 #define atomic_subtract_ptr atomic_subtract_64 +#define atomic_swap_ptr atomic_swap_64 ATOMIC_ACQ_REL(set, 64) ATOMIC_ACQ_REL(clear, 64) From owner-svn-src-all@freebsd.org Tue Aug 7 18:59:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8FB1067E0B; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 536AB7C7B5; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3605C1FBE5; Tue, 7 Aug 2018 18:59:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77Ix2NL097937; Tue, 7 Aug 2018 18:59:02 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Ix2kd097935; Tue, 7 Aug 2018 18:59:02 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201808071859.w77Ix2kd097935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 7 Aug 2018 18:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337434 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 337434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 18:59:03 -0000 Author: marius Date: Tue Aug 7 18:59:02 2018 New Revision: 337434 URL: https://svnweb.freebsd.org/changeset/base/337434 Log: Update the list of architectures having atomic_fcmpset_{8,16,64}(9) and atomic_swap_{64,int}(9) respectively as of r337433. Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Aug 7 18:56:51 2018 (r337433) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Tue Aug 7 18:59:02 2018 (r337434) @@ -129,9 +129,7 @@ atomic_clear_mask(unsigned int mask, atomic_t *v) static inline int atomic_xchg(atomic_t *v, int i) { -#if defined(__i386__) || defined(__amd64__) || \ - defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) +#if !defined(__mips__) return (atomic_swap_int(&v->counter, i)); #else int ret; @@ -159,7 +157,7 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#if defined(__i386__) || defined(__amd64__) +#if defined(__amd64__) || defined(__arm64__) || defined(__i386__) #define LINUXKPI_ATOMIC_8(...) __VA_ARGS__ #define LINUXKPI_ATOMIC_16(...) __VA_ARGS__ #else @@ -167,8 +165,9 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define LINUXKPI_ATOMIC_16(...) #endif -#if defined(__amd64__) || (defined(__ARM_ARCH) && (__ARM_ARCH >= 6)) || \ - defined(__aarch64__) || defined(__powerpc64__) || defined(__riscv) +#if !(defined(i386) || (defined(__mips__) && !(defined(__mips_n32) || \ + defined(__mips_n64))) || (defined(__powerpc__) && \ + !defined(__powerpc64__))) #define LINUXKPI_ATOMIC_64(...) __VA_ARGS__ #else #define LINUXKPI_ATOMIC_64(...) Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Tue Aug 7 18:56:51 2018 (r337433) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Tue Aug 7 18:59:02 2018 (r337434) @@ -107,9 +107,8 @@ atomic64_add_unless(atomic64_t *v, int64_t a, int64_t static inline int64_t atomic64_xchg(atomic64_t *v, int64_t i) { -#if defined(__i386__) || defined(__amd64__) || \ - defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc64__) +#if !((defined(__mips__) && !(defined(__mips_n32) || defined(__mips_n64))) || \ + (defined(__powerpc__) && !defined(__powerpc64__))) return (atomic_swap_64(&v->counter, i)); #else int64_t ret; From owner-svn-src-all@freebsd.org Tue Aug 7 19:23:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1012C10689CF; Tue, 7 Aug 2018 19:23:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7B357D680; Tue, 7 Aug 2018 19:23:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9890D20094; Tue, 7 Aug 2018 19:23:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77JN46M013193; Tue, 7 Aug 2018 19:23:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77JN4Xi013191; Tue, 7 Aug 2018 19:23:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808071923.w77JN4Xi013191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 7 Aug 2018 19:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337435 - in head: sbin/init stand/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sbin/init stand/man X-SVN-Commit-Revision: 337435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 19:23:05 -0000 Author: trasz Date: Tue Aug 7 19:23:03 2018 New Revision: 337435 URL: https://svnweb.freebsd.org/changeset/base/337435 Log: Move description of init_shell, init_script, and init_chroot kenv tunables from loader(8) to init(8), since it's init that actually uses them. Add .Xrs at their old place. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sbin/init/init.8 head/stand/man/loader.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Tue Aug 7 18:59:02 2018 (r337434) +++ head/sbin/init/init.8 Tue Aug 7 19:23:03 2018 (r337435) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd August 7, 2018 .Dt INIT 8 .Os .Sh NAME @@ -294,6 +294,74 @@ as follows: .Xr ttys 5 file .El +.Sh KERNEL ENVIRONMENT VARIABLES +The following +.Xr kenv 2 +variables are available as +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va init_chroot +If set to a valid directory in the root file system, it causes +.Nm +to perform a +.Xr chroot 2 +operation on that directory, making it the new root directory. +That happens before entering single-user mode or multi-user +mode (but after executing the +.Va init_script +if enabled). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +.It Va init_script +If set to a valid file name in the root file system, +instructs +.Nm +to run that script as the very first action, +before doing anything else. +Signal handling and exit code interpretation is similar to +running the +.Pa /etc/rc +script. +In particular, single-user operation is enforced +if the script terminates with a non-zero exit code, +or if a SIGTERM is delivered to the +.Nm +process (PID 1). +This functionality has generally been eclipsed by rerooting. +See +.Xr reboot 8 +.Fl r +for details. +.It Va init_shell +Defines the shell binary to be used for executing the various shell scripts. +The default is +.Dq Li /bin/sh . +It is used for running the +.Va init_script +if set, as well as for the +.Pa /etc/rc +and +.Pa /etc/rc.shutdown +scripts. +The value of the corresponding +.Xr kenv 2 +variable is evaluated every time +.Nm +calls a shell script, so it can be changed later on using the +.Xr kenv 1 +utility. +In particular, if a non-default shell is used for running an +.Va init_script , +it might be desirable to have that script reset the value of +.Va init_shell +back to the default, so that the +.Pa /etc/rc +script is executed with the standard shell +.Pa /bin/sh . .Sh FILES .Bl -tag -width /var/log/init.log -compact .It Pa /dev/console Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Tue Aug 7 18:59:02 2018 (r337434) +++ head/stand/man/loader.8 Tue Aug 7 19:23:03 2018 (r337435) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2018 +.Dd August 7, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -478,20 +478,8 @@ directive from has been processed, allowing kernel panics that happen during the early stages of boot to be captured. .It Va init_chroot -If set to a valid directory in the root file system, it causes -.Xr init 8 -to perform a -.Xr chroot 2 -operation on that directory, making it the new root directory. -That happens before entering single-user mode or multi-user -mode (but after executing the -.Va init_script -if enabled). -This functionality has generally been eclipsed by rerooting. See -.Xr reboot 8 -.Fl r -for details. +.Xr init 8 . .It Va init_path Sets the list of binaries which the kernel will try to run as the initial process. @@ -499,51 +487,11 @@ The first matching binary is used. The default list is .Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init . .It Va init_script -If set to a valid file name in the root file system, -instructs -.Xr init 8 -to run that script as the very first action, -before doing anything else. -Signal handling and exit code interpretation is similar to -running the -.Pa /etc/rc -script. -In particular, single-user operation is enforced -if the script terminates with a non-zero exit code, -or if a SIGTERM is delivered to the -.Xr init 8 -process (PID 1). -This functionality has generally been eclipsed by rerooting. See -.Xr reboot 8 -.Fl r -for details. +.Xr init 8 . .It Va init_shell -Defines the shell binary to be used for executing the various shell scripts. -The default is -.Dq Li /bin/sh . -It is used for running the -.Va init_script -if set, as well as for the -.Pa /etc/rc -and -.Pa /etc/rc.shutdown -scripts. -The value of the corresponding -.Xr kenv 2 -variable is evaluated every time -.Xr init 8 -calls a shell script, so it can be changed later on using the -.Xr kenv 1 -utility. -In particular, if a non-default shell is used for running an -.Va init_script , -it might be desirable to have that script reset the value of -.Va init_shell -back to the default, so that the -.Pa /etc/rc -script is executed with the standard shell -.Pa /bin/sh . +See +.Xr init 8 . .It Va interpret Has the value .Dq Li OK From owner-svn-src-all@freebsd.org Tue Aug 7 20:43:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3F7106AB96; Tue, 7 Aug 2018 20:43:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C99BE80FB3; Tue, 7 Aug 2018 20:43:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAE7420D76; Tue, 7 Aug 2018 20:43:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77KhoYK055530; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77Khook055529; Tue, 7 Aug 2018 20:43:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808072043.w77Khook055529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Aug 2018 20:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337436 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 20:43:51 -0000 Author: kib Date: Tue Aug 7 20:43:50 2018 New Revision: 337436 URL: https://svnweb.freebsd.org/changeset/base/337436 Log: Followup to r337430: only call elf_reloc_ifunc on x86. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Aug 7 19:23:03 2018 (r337435) +++ head/sys/kern/link_elf_obj.c Tue Aug 7 20:43:50 2018 (r337436) @@ -485,10 +485,12 @@ link_elf_link_preload_finish(linker_file_t lf) if (error) return (error); +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) return (error); +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -994,10 +996,12 @@ link_elf_load_file(linker_class_t cls, const char *fil if (error) goto out; +#if defined(__i386__) || defined(__amd64__) /* Now ifuncs. */ error = link_elf_reloc_local(lf, true); if (error != 0) goto out; +#endif /* Invoke .ctors */ link_elf_invoke_ctors(lf->ctors_addr, lf->ctors_size); @@ -1521,9 +1525,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rel, ELF_RELOC_REL, elf_obj_lookup); +#endif } } @@ -1552,9 +1558,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) ifuncs) elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#if defined(__i386__) || defined(__amd64__) else if (ifuncs) elf_reloc_ifunc(lf, base, rela, ELF_RELOC_RELA, elf_obj_lookup); +#endif } } return (0); From owner-svn-src-all@freebsd.org Tue Aug 7 21:17:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35987106B42B; Tue, 7 Aug 2018 21:17:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD1081D84; Tue, 7 Aug 2018 21:17:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C001D2123F; Tue, 7 Aug 2018 21:17:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77LHjwa070914; Tue, 7 Aug 2018 21:17:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77LHjoI070913; Tue, 7 Aug 2018 21:17:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201808072117.w77LHjoI070913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 7 Aug 2018 21:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337437 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 337437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 21:17:46 -0000 Author: mckusick Date: Tue Aug 7 21:17:45 2018 New Revision: 337437 URL: https://svnweb.freebsd.org/changeset/base/337437 Log: When getting mount information for all filesystems, mount uses the getfsstat(2) system call using the MNT_NOWAIT flag to indicate that it wants to use the statfs information cached in the mount structure. When the -v (verbose) flag is specified, we need to use the MNT_WAIT flag to getfsstat(2) so that kernel will call VFS_STATFS to get the current statfs statistics from each filesystem. Sponsored by: Netflix Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Tue Aug 7 20:43:50 2018 (r337436) +++ head/sbin/mount/mount.c Tue Aug 7 21:17:45 2018 (r337437) @@ -329,7 +329,8 @@ main(int argc, char *argv[]) rval = 0; switch (argc) { case 0: - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) + if ((mntsize = getmntinfo(&mntbuf, + verbose ? MNT_WAIT : MNT_NOWAIT)) == 0) err(1, "getmntinfo"); if (all) { while ((fs = getfsent()) != NULL) { From owner-svn-src-all@freebsd.org Tue Aug 7 21:29:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC19106B6CB; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30FBF8227D; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 134A6213F6; Tue, 7 Aug 2018 21:29:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77LTEMu076160; Tue, 7 Aug 2018 21:29:14 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77LTEBe076159; Tue, 7 Aug 2018 21:29:14 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808072129.w77LTEBe076159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 7 Aug 2018 21:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337438 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 337438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 21:29:15 -0000 Author: rmacklem Date: Tue Aug 7 21:29:14 2018 New Revision: 337438 URL: https://svnweb.freebsd.org/changeset/base/337438 Log: Allow newnfs_request() to retry all callback RPCs with an NFSERR_DELAY reply. The code in newnfs_request() retries RPCs that get a reply of NFSERR_DELAY, but exempts certain NFSv4 operations. However, for callback RPCs, there should not be any exemptions at this time. The code would have erroneously exempted the CBRECALL callback, since it has the same operation number as the CLOSE operation. This patch fixes this by checking for a callback RPC (indicated by clp != NULL) and not checking for exempt operations for callbacks. This would have only affected the NFSv4 server when delegations are enabled (they are not enabled by default) and the client replies to CBRECALL with NFSERR_DELAY. This may never actually happen. Spotted during code inspection. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Aug 7 21:17:45 2018 (r337437) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Aug 7 21:29:14 2018 (r337438) @@ -1052,10 +1052,14 @@ tryagain: NFSCL_DEBUG(1, "Got err=%d\n", reterr); } } + /* + * When clp != NULL, it is a callback and all + * callback operations can be retried for NFSERR_DELAY. + */ if (((nd->nd_repstat == NFSERR_DELAY || nd->nd_repstat == NFSERR_GRACE) && - (nd->nd_flag & ND_NFSV4) && - nd->nd_procnum != NFSPROC_DELEGRETURN && + (nd->nd_flag & ND_NFSV4) && (clp != NULL || + (nd->nd_procnum != NFSPROC_DELEGRETURN && nd->nd_procnum != NFSPROC_SETATTR && nd->nd_procnum != NFSPROC_READ && nd->nd_procnum != NFSPROC_READDS && @@ -1067,7 +1071,7 @@ tryagain: nd->nd_procnum != NFSPROC_OPENDOWNGRADE && nd->nd_procnum != NFSPROC_CLOSE && nd->nd_procnum != NFSPROC_LOCK && - nd->nd_procnum != NFSPROC_LOCKU) || + nd->nd_procnum != NFSPROC_LOCKU))) || (nd->nd_repstat == NFSERR_DELAY && (nd->nd_flag & ND_NFSV4) == 0) || nd->nd_repstat == NFSERR_RESOURCE) { From owner-svn-src-all@freebsd.org Tue Aug 7 22:00:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6B2106C4F0; Tue, 7 Aug 2018 22:00:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BCF58332A; Tue, 7 Aug 2018 22:00:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w77M0NaK087187 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Aug 2018 15:00:23 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w77M0NGr087186; Tue, 7 Aug 2018 15:00:23 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 7 Aug 2018 15:00:23 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336047 - in head/sys: amd64/include i386/include sys Message-ID: <20180807220023.GY420@FreeBSD.org> References: <201807061950.w66Joibw081390@repo.freebsd.org> <20180803222739.GH420@FreeBSD.org> <20180804074817.GH6049@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180804074817.GH6049@kib.kiev.ua> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 22:00:32 -0000 On Sat, Aug 04, 2018 at 10:48:17AM +0300, Konstantin Belousov wrote: K> On Fri, Aug 03, 2018 at 03:27:39PM -0700, Gleb Smirnoff wrote: K> > Hi Konstantin, K> > K> > On Fri, Jul 06, 2018 at 07:50:44PM +0000, Konstantin Belousov wrote: K> > K> Author: kib K> > K> Date: Fri Jul 6 19:50:44 2018 K> > K> New Revision: 336047 K> > K> URL: https://svnweb.freebsd.org/changeset/base/336047 K> > K> K> > K> Log: K> > K> Expand x86 struct pcpus to UMA_PCPU_ALLOC_SIZE AKA PAGE_SIZE. K> > K> K> > K> This restores counters(9) operation. K> > K> Revert r336024. Improve assert of pcpu size on x86. K> > K> K> > K> Reviewed by: mmacy K> > K> Sponsored by: The FreeBSD Foundation K> > K> Differential revision: https://reviews.freebsd.org/D16163 K> > K> > Since this has been broken already several times as people who edit K> > surrounding code don't understand the magic, and since now we round K> > the struct pcpu size to PAGE_SIZE anyways, what about stop carefully K> > craft the padding and just change alignment of struct pcpu to PAGE_SIZE? K> I do not see how it would avoided that breakage. Also, I like the K> explicitness in the padding, it is useful when new pcpu members are K> added. I have to do that more than once this year. I was wrong. __aligned would do proper placement of items in an array, but sizeof would return lesser value. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Aug 7 22:13:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16D27106C967; Tue, 7 Aug 2018 22:13:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB6A83A48; Tue, 7 Aug 2018 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B1A621C14; Tue, 7 Aug 2018 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77MD4q7001293; Tue, 7 Aug 2018 22:13:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77MD3Ab001289; Tue, 7 Aug 2018 22:13:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808072213.w77MD3Ab001289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 7 Aug 2018 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337439 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 337439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 22:13:05 -0000 Author: np Date: Tue Aug 7 22:13:03 2018 New Revision: 337439 URL: https://svnweb.freebsd.org/changeset/base/337439 Log: cxgbe(4): Allow the driver to specify a burst size when configuring a traffic class for rate limiting. Add experimental knobs that allow the user to specify a default pktsize and burstsize for traffic classes associated with a port: dev...tc.pktsize dev...tc.burstsize Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/adapter.h Tue Aug 7 22:13:03 2018 (r337439) @@ -249,6 +249,7 @@ struct tx_cl_rl_params { enum fw_sched_params_mode mode; /* aggr or per-flow */ uint32_t maxrate; uint16_t pktsize; + uint16_t burstsize; }; /* Tx scheduler parameters for a channel/port */ @@ -259,7 +260,9 @@ struct tx_sched_params { /* Class WRR */ /* XXX */ - /* Class Rate Limiter */ + /* Class Rate Limiter (including the default pktsize and burstsize). */ + int pktsize; + int burstsize; struct tx_cl_rl_params cl_rl[]; }; Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/common/common.h Tue Aug 7 22:13:03 2018 (r337439) @@ -814,7 +814,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok); + int burstsize, int sleep_ok); int t4_sched_params_ch_rl(struct adapter *adapter, int channel, int ratemode, unsigned int maxrate, int sleep_ok); int t4_sched_params_cl_wrr(struct adapter *adapter, int channel, int cl, Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Aug 7 22:13:03 2018 (r337439) @@ -9803,7 +9803,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok) + int burstsize, int sleep_ok) { struct fw_sched_cmd cmd; @@ -9825,6 +9825,7 @@ int t4_sched_params(struct adapter *adapter, int type, cmd.u.params.max = cpu_to_be32(maxrate); cmd.u.params.weight = cpu_to_be16(weight); cmd.u.params.pktsize = cpu_to_be16(pktsize); + cmd.u.params.burstsize = cpu_to_be16(burstsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), NULL, sleep_ok); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/t4_main.c Tue Aug 7 22:13:03 2018 (r337439) @@ -6008,6 +6008,13 @@ cxgbe_sysctls(struct port_info *pi) */ oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", CTLFLAG_RD, NULL, "Tx scheduler traffic classes (cl_rl)"); + children2 = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "pktsize", + CTLFLAG_RW, &pi->sched_params->pktsize, 0, + "pktsize for per-flow cl-rl (0 means up to the driver )"); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "burstsize", + CTLFLAG_RW, &pi->sched_params->burstsize, 0, + "burstsize for per-flow cl-rl (0 means up to the driver)"); for (i = 0; i < sc->chip_params->nsched_cls; i++) { struct tx_cl_rl_params *tc = &pi->sched_params->cl_rl[i]; Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Tue Aug 7 21:29:14 2018 (r337438) +++ head/sys/dev/cxgbe/t4_sched.c Tue Aug 7 22:13:03 2018 (r337439) @@ -211,7 +211,7 @@ set_sched_class_params(struct adapter *sc, struct t4_s } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, - p->weight, p->pktsize, sleep_ok); + p->weight, p->pktsize, 0, sleep_ok); end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); if (p->level == SCHED_CLASS_LEVEL_CL_RL) { @@ -258,7 +258,7 @@ update_tx_sched(void *context, int pending) rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, - tc->pktsize, 1); + tc->pktsize, tc->burstsize, 1); end_synchronized_op(sc, 0); mtx_lock(&sc->tc_lock); @@ -481,7 +481,7 @@ int t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, u_int maxrate, int *tc_idx) { - int rc = 0, fa = -1, i; + int rc = 0, fa = -1, i, pktsize, burstsize; bool update; struct tx_cl_rl_params *tc; struct port_info *pi; @@ -489,7 +489,16 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, MPASS(port_id >= 0 && port_id < sc->params.nports); pi = sc->port[port_id]; + if (pi->sched_params->pktsize > 0) + pktsize = pi->sched_params->pktsize; + else + pktsize = pi->vi[0].ifp->if_mtu; + if (pi->sched_params->burstsize > 0) + burstsize = pi->sched_params->burstsize; + else + burstsize = pktsize * 4; tc = &pi->sched_params->cl_rl[0]; + update = false; mtx_lock(&sc->tc_lock); for (i = 0; i < sc->chip_params->nsched_cls; i++, tc++) { @@ -499,8 +508,8 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, if (tc->ratemode == FW_SCHED_PARAMS_RATE_ABS && tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE && tc->mode == FW_SCHED_PARAMS_MODE_FLOW && - tc->maxrate == maxrate && - tc->pktsize == pi->vi[0].ifp->if_mtu) { + tc->maxrate == maxrate && tc->pktsize == pktsize && + tc->burstsize == burstsize) { tc->refcount++; *tc_idx = i; if ((tc->flags & (CLRL_ERR | CLRL_ASYNC | CLRL_SYNC)) == @@ -519,7 +528,8 @@ t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; tc->mode = FW_SCHED_PARAMS_MODE_FLOW; tc->maxrate = maxrate; - tc->pktsize = pi->vi[0].ifp->if_mtu; + tc->pktsize = pktsize; + tc->burstsize = burstsize; *tc_idx = fa; update = true; } else { From owner-svn-src-all@freebsd.org Tue Aug 7 23:03:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE138106D943; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 754DA85065; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 514932242D; Tue, 7 Aug 2018 23:03:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w77N3pUP026671; Tue, 7 Aug 2018 23:03:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w77N3pSt026670; Tue, 7 Aug 2018 23:03:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808072303.w77N3pSt026670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Aug 2018 23:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337440 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2018 23:03:52 -0000 Author: pfg Date: Tue Aug 7 23:03:50 2018 New Revision: 337440 URL: https://svnweb.freebsd.org/changeset/base/337440 Log: Fix printf(1) ignores width and precision in %b format. The precision with behavior is "unspecified" by POSIX (as of 2018), but most implementations seem to have taken it to be treated the same as for "s"; applied after the unescaping. Adopt the same treatment on our printf. PR: 229641 Submitted by: Garrett D'Amore (illumos) Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Aug 7 22:13:03 2018 (r337439) +++ head/usr.bin/printf/printf.c Tue Aug 7 23:03:50 2018 (r337440) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * + * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - p = strdup(getstr()); - if (p == NULL) { + /* Convert "b" to "s" for output. */ + start[strlen(start) - 1] = 's'; + if ((p = strdup(getstr())) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - fputs(p, stdout); + PF(start, p); + /* Restore format for next loop. */ + free(p); if (getout) - return (end_fmt); + exit(*rval); break; } case 'c': { From owner-svn-src-all@freebsd.org Wed Aug 8 01:20:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 830DD10705B0; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A988890B3; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1827A238F6; Wed, 8 Aug 2018 01:20:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w781K2di093694; Wed, 8 Aug 2018 01:20:02 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w781K2Xa093693; Wed, 8 Aug 2018 01:20:02 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808080120.w781K2Xa093693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 8 Aug 2018 01:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337441 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 337441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 01:20:03 -0000 Author: kevlo Date: Wed Aug 8 01:20:02 2018 New Revision: 337441 URL: https://svnweb.freebsd.org/changeset/base/337441 Log: - Fix hash calculation by MAC address - Since rx_cmd_c is an uint16_t, use le16toh() instead of le32toh() Reviewed by: emaste Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Tue Aug 7 23:03:50 2018 (r337440) +++ head/sys/dev/usb/net/if_muge.c Wed Aug 8 01:20:02 2018 (r337441) @@ -1196,7 +1196,7 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err goto tr_setup; usbd_copy_out(pc, off, &rx_cmd_c, sizeof(rx_cmd_c)); off += (sizeof(rx_cmd_c)); - rx_cmd_c = le32toh(rx_cmd_c); + rx_cmd_c = le16toh(rx_cmd_c); if (off > actlen) goto tr_setup; @@ -1891,7 +1891,7 @@ muge_multicast_write(struct muge_softc *sc) static inline uint32_t muge_hash(uint8_t addr[ETHER_ADDR_LEN]) { - return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 26) & 0x3f; + return (ether_crc32_be(addr, ETHER_ADDR_LEN) >> 23) & 0x1ff; } /** From owner-svn-src-all@freebsd.org Wed Aug 8 01:33:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E4621070DFB; Wed, 8 Aug 2018 01:33:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B214789A96; Wed, 8 Aug 2018 01:33:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9118C23C35; Wed, 8 Aug 2018 01:33:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w781XbmW003786; Wed, 8 Aug 2018 01:33:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w781XaUM003779; Wed, 8 Aug 2018 01:33:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808080133.w781XaUM003779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 8 Aug 2018 01:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337442 - in head/contrib/file: . doc magic magic/Magdir python src tests X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/contrib/file: . doc magic magic/Magdir python src tests X-SVN-Commit-Revision: 337442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 01:33:38 -0000 Author: eadler Date: Wed Aug 8 01:33:36 2018 New Revision: 337442 URL: https://svnweb.freebsd.org/changeset/base/337442 Log: file: update to 5.34 PR: 230141 exp-run by: antoine Added: head/contrib/file/magic/Magdir/dataone - copied unchanged from r336862, vendor/file/dist/magic/Magdir/dataone head/contrib/file/python/CHANGELOG.md - copied unchanged from r336862, vendor/file/dist/python/CHANGELOG.md head/contrib/file/python/LICENSE - copied unchanged from r336862, vendor/file/dist/python/LICENSE head/contrib/file/python/README.md - copied unchanged from r336862, vendor/file/dist/python/README.md head/contrib/file/python/tests.py - copied unchanged from r336862, vendor/file/dist/python/tests.py head/contrib/file/tests/JW07022A.mp3.result - copied unchanged from r336862, vendor/file/dist/tests/JW07022A.mp3.result head/contrib/file/tests/JW07022A.mp3.testfile - copied unchanged from r336862, vendor/file/dist/tests/JW07022A.mp3.testfile Deleted: head/contrib/file/python/README Modified: head/contrib/file/ChangeLog head/contrib/file/Makefile.in head/contrib/file/README head/contrib/file/aclocal.m4 head/contrib/file/compile head/contrib/file/config.guess head/contrib/file/config.h.in head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/depcomp head/contrib/file/doc/Makefile.in head/contrib/file/doc/file.man head/contrib/file/doc/magic.man head/contrib/file/install-sh head/contrib/file/ltmain.sh head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/audio head/contrib/file/magic/Magdir/cad head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/dbpf head/contrib/file/magic/Magdir/dump head/contrib/file/magic/Magdir/elf head/contrib/file/magic/Magdir/fsav head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/linux head/contrib/file/magic/Magdir/make head/contrib/file/magic/Magdir/measure head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/msooxml head/contrib/file/magic/Magdir/pdf head/contrib/file/magic/Magdir/sgi head/contrib/file/magic/Makefile.am head/contrib/file/magic/Makefile.in head/contrib/file/missing head/contrib/file/python/Makefile.am head/contrib/file/python/Makefile.in head/contrib/file/python/magic.py head/contrib/file/python/setup.py head/contrib/file/src/Makefile.in head/contrib/file/src/apprentice.c head/contrib/file/src/compress.c head/contrib/file/src/der.c head/contrib/file/src/file.h head/contrib/file/src/funcs.c head/contrib/file/src/readcdf.c head/contrib/file/src/readelf.c head/contrib/file/src/readelf.h head/contrib/file/src/seccomp.c head/contrib/file/src/softmagic.c head/contrib/file/tests/Makefile.am head/contrib/file/tests/Makefile.in Directory Properties: head/contrib/file/ (props changed) Modified: head/contrib/file/ChangeLog ============================================================================== --- head/contrib/file/ChangeLog Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/ChangeLog Wed Aug 8 01:33:36 2018 (r337442) @@ -1,3 +1,15 @@ +2018-07-25 8:50 Christos Zoulas + + * release 5.34 + +2018-06-22 16:38 Christos Zoulas + + * Add Quad indirect offsets + +2018-05-24 14:10 Christos Zoulas + + * Enable parsing of ELF dynamic sections to handle PIE better + 2018-04-15 14:52 Christos Zoulas * release 5.33 Modified: head/contrib/file/Makefile.in ============================================================================== --- head/contrib/file/Makefile.in Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/Makefile.in Wed Aug 8 01:33:36 2018 (r337442) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ @@ -49,11 +87,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ - README TODO compile config.guess config.sub depcomp install-sh \ - missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -61,6 +94,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -124,6 +159,9 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO compile \ + config.guess config.sub depcomp install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -178,6 +216,7 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -193,6 +232,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ +HAVE_VISIBILITY = @HAVE_VISIBILITY@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -306,7 +346,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__c echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -327,8 +366,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -357,13 +396,12 @@ distclean-libtool: # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ @@ -538,10 +576,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -576,16 +620,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -761,6 +806,8 @@ uninstall-am: maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. Modified: head/contrib/file/README ============================================================================== --- head/contrib/file/README Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/README Wed Aug 8 01:33:36 2018 (r337442) @@ -1,10 +1,10 @@ ## README for file(1) Command ## - @(#) $File: README,v 1.53 2018/03/11 13:06:47 glen Exp $ + @(#) $File: README,v 1.54 2018/05/30 03:06:56 christos Exp $ -Mailing List: file@mx.gw.com [currently down] -Mailing List archives: http://mx.gw.com/pipermail/file/ [currently down] -Bug tracker: http://bugs.gw.com/ [currently down] +Mailing List: file@astron.com +Mailing List archives: http://mailman.astron.com/pipermail/file/ +Bug tracker: http://bugs.astron.com/ E-mail: christos@astron.com Build Status: https://travis-ci.org/file/file Modified: head/contrib/file/aclocal.m4 ============================================================================== --- head/contrib/file/aclocal.m4 Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/aclocal.m4 Wed Aug 8 01:33:36 2018 (r337442) @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,85 @@ You have another version of autoconf. It may work, bu If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# visibility.m4 serial 5 (gettext-0.18.2) +dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. + +dnl Tests whether the compiler supports the command-line option +dnl -fvisibility=hidden and the function and variable attributes +dnl __attribute__((__visibility__("hidden"))) and +dnl __attribute__((__visibility__("default"))). +dnl Does *not* test for __visibility__("protected") - which has tricky +dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on +dnl Mac OS X. +dnl Does *not* test for __visibility__("internal") - which has processor +dnl dependent semantics. +dnl Does *not* test for #pragma GCC visibility push(hidden) - which is +dnl "really only recommended for legacy code". +dnl Set the variable CFLAG_VISIBILITY. +dnl Defines and sets the variable HAVE_VISIBILITY. + +AC_DEFUN([gl_VISIBILITY], +[ + AC_REQUIRE([AC_PROG_CC]) + CFLAG_VISIBILITY= + HAVE_VISIBILITY=0 + if test -n "$GCC"; then + dnl First, check whether -Werror can be added to the command line, or + dnl whether it leads to an error because of some other option that the + dnl user has put into $CC $CFLAGS $CPPFLAGS. + AC_MSG_CHECKING([whether the -Werror option is usable]) + AC_CACHE_VAL([gl_cv_cc_vis_werror], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_vis_werror=yes], + [gl_cv_cc_vis_werror=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_vis_werror]) + dnl Now check whether visibility declarations are supported. + AC_MSG_CHECKING([for simple visibility declarations]) + AC_CACHE_VAL([gl_cv_cc_visibility], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fvisibility=hidden" + dnl We use the option -Werror and a function dummyfunc, because on some + dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning + dnl "visibility attribute not supported in this configuration; ignored" + dnl at the first function definition in every compilation unit, and we + dnl don't want to use the option in this case. + if test $gl_cv_cc_vis_werror = yes; then + CFLAGS="$CFLAGS -Werror" + fi + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[extern __attribute__((__visibility__("hidden"))) int hiddenvar; + extern __attribute__((__visibility__("default"))) int exportedvar; + extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); + extern __attribute__((__visibility__("default"))) int exportedfunc (void); + void dummyfunc (void) {} + ]], + [[]])], + [gl_cv_cc_visibility=yes], + [gl_cv_cc_visibility=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_visibility]) + if test $gl_cv_cc_visibility = yes; then + CFLAG_VISIBILITY="-fvisibility=hidden" + HAVE_VISIBILITY=1 + fi + fi + AC_SUBST([CFLAG_VISIBILITY]) + AC_SUBST([HAVE_VISIBILITY]) + AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], + [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) +]) + +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +110,10 @@ To do so, use the procedure documented by the package, # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +129,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +181,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +219,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +410,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -373,7 +450,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the @@ -409,7 +486,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -418,6 +495,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -493,8 +576,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -526,6 +609,51 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, se AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -534,7 +662,6 @@ dnl mangled by Autoconf and run in a shell conditional m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -556,7 +683,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -567,7 +694,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg" # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -577,7 +704,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -598,7 +725,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -646,41 +773,9 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -719,7 +814,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,9 +843,73 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -831,7 +990,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -891,7 +1050,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -919,7 +1078,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -938,7 +1097,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,76 +1116,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of '-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR Modified: head/contrib/file/compile ============================================================================== --- head/contrib/file/compile Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/compile Wed Aug 8 01:33:36 2018 (r337442) @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify Modified: head/contrib/file/config.guess ============================================================================== --- head/contrib/file/config.guess Wed Aug 8 01:20:02 2018 (r337441) +++ head/contrib/file/config.guess Wed Aug 8 01:33:36 2018 (r337442) @@ -1,10 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2012-12-29' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -26,12 +24,12 @@ timestamp='2012-12-29' # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -52,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEAS UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -151,19 +168,29 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 8 02:30:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993211072151; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2348B0EF; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3039F24539; Wed, 8 Aug 2018 02:30:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w782UZGm029238; Wed, 8 Aug 2018 02:30:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w782UZJP029237; Wed, 8 Aug 2018 02:30:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808080230.w782UZJP029237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 8 Aug 2018 02:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337443 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 337443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 02:30:35 -0000 Author: alc Date: Wed Aug 8 02:30:34 2018 New Revision: 337443 URL: https://svnweb.freebsd.org/changeset/base/337443 Log: Defer and aggregate swap_pager_meta_build frees. Before swp_pager_meta_build replaces an old swapblk with an new one, it frees the old one. To allow such freeing of blocks to be aggregated, have swp_pager_meta_build return the old swap block, and make the caller responsible for freeing it. Define a pair of short static functions, swp_pager_init_freerange and swp_pager_update_freerange, to do the initialization and updating of blk addresses and counters used in aggregating blocks to be freed. Submitted by: Doug Moore Reviewed by: kib, markj (an earlier version) Tested by: pho MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13707 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Aug 8 01:33:36 2018 (r337442) +++ head/sys/vm/swap_pager.c Wed Aug 8 02:30:34 2018 (r337443) @@ -403,11 +403,32 @@ static daddr_t swp_pager_getswapspace(int npages); /* * Metadata functions */ -static void swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); +static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t); static void swp_pager_meta_free_all(vm_object_t); static daddr_t swp_pager_meta_ctl(vm_object_t, vm_pindex_t, int); +static void +swp_pager_init_freerange(daddr_t *start, daddr_t *num) +{ + + *start = SWAPBLK_NONE; + *num = 0; +} + +static void +swp_pager_update_freerange(daddr_t *start, daddr_t *num, daddr_t addr) +{ + + if (*start + *num == addr) { + (*num)++; + } else { + swp_pager_freeswapspace(*start, *num); + *start = addr; + *num = 1; + } +} + static void * swblk_trie_alloc(struct pctrie *ptree) { @@ -861,7 +882,9 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t sta int n = 0; daddr_t blk = SWAPBLK_NONE; vm_pindex_t beg = start; /* save start index */ + daddr_t addr, n_free, s_free; + swp_pager_init_freerange(&s_free, &n_free); VM_OBJECT_WLOCK(object); while (size) { if (n == 0) { @@ -875,12 +898,15 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t sta } } } - swp_pager_meta_build(object, start, blk); + addr = swp_pager_meta_build(object, start, blk); + if (addr != SWAPBLK_NONE) + swp_pager_update_freerange(&s_free, &n_free, addr); --size; ++start; ++blk; --n; } + swp_pager_freeswapspace(s_free, n_free); swp_pager_meta_free(object, start, n); VM_OBJECT_WUNLOCK(object); return (0); @@ -910,7 +936,7 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst vm_pindex_t offset, int destroysource) { vm_pindex_t i; - daddr_t dstaddr, first_free, num_free, srcaddr; + daddr_t dstaddr, n_free, s_free, srcaddr; VM_OBJECT_ASSERT_WLOCKED(srcobject); VM_OBJECT_ASSERT_WLOCKED(dstobject); @@ -937,42 +963,38 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst /* * Transfer source to destination. */ - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); for (i = 0; i < dstobject->size; ++i) { srcaddr = swp_pager_meta_ctl(srcobject, i + offset, SWM_POP); if (srcaddr == SWAPBLK_NONE) continue; dstaddr = swp_pager_meta_ctl(dstobject, i, 0); - if (dstaddr == SWAPBLK_NONE) { + if (dstaddr != SWAPBLK_NONE) { /* - * Destination has no swapblk and is not resident, - * copy source. - * - * swp_pager_meta_build() can sleep. - */ - vm_object_pip_add(srcobject, 1); - VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); - swp_pager_meta_build(dstobject, i, srcaddr); - vm_object_pip_wakeup(dstobject); - VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); - } else { - /* * Destination has valid swapblk or it is represented - * by a resident page. We destroy the sourceblock. + * by a resident page. We destroy the source block. */ - if (first_free + num_free == srcaddr) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = srcaddr; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, srcaddr); + continue; } + + /* + * Destination has no swapblk and is not resident, + * copy source. + * + * swp_pager_meta_build() can sleep. + */ + vm_object_pip_add(srcobject, 1); + VM_OBJECT_WUNLOCK(srcobject); + vm_object_pip_add(dstobject, 1); + dstaddr = swp_pager_meta_build(dstobject, i, srcaddr); + KASSERT(dstaddr == SWAPBLK_NONE, + ("Unexpected destination swapblk")); + vm_object_pip_wakeup(dstobject); + VM_OBJECT_WLOCK(srcobject); + vm_object_pip_wakeup(srcobject); } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); /* * Free left over swap blocks in source. @@ -1307,7 +1329,9 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, { int i, n; boolean_t sync; + daddr_t addr, n_free, s_free; + swp_pager_init_freerange(&s_free, &n_free); if (count && ma[0]->object != object) { panic("swap_pager_putpages: object mismatch %p/%p", object, @@ -1322,8 +1346,11 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, * check for bogus sysops * force sync if not pageout process */ - if (object->type != OBJT_SWAP) - swp_pager_meta_build(object, 0, SWAPBLK_NONE); + if (object->type != OBJT_SWAP) { + addr = swp_pager_meta_build(object, 0, SWAPBLK_NONE); + KASSERT(addr == SWAPBLK_NONE, + ("unexpected object swap block")); + } VM_OBJECT_WUNLOCK(object); n = 0; @@ -1391,11 +1418,11 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, for (j = 0; j < n; ++j) { vm_page_t mreq = ma[i+j]; - swp_pager_meta_build( - mreq->object, - mreq->pindex, - blk + j - ); + addr = swp_pager_meta_build(mreq->object, mreq->pindex, + blk + j); + if (addr != SWAPBLK_NONE) + swp_pager_update_freerange(&s_free, &n_free, + addr); MPASS(mreq->dirty == VM_PAGE_BITS_ALL); mreq->oflags |= VPO_SWAPINPROG; bp->b_pages[j] = mreq; @@ -1453,6 +1480,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, swp_pager_async_iodone(bp); } VM_OBJECT_WLOCK(object); + swp_pager_freeswapspace(s_free, n_free); } /* @@ -1783,14 +1811,15 @@ swp_pager_swblk_empty(struct swblk *sb, int start, int * * The specified swapblk is added to the object's swap metadata. If * the swapblk is not valid, it is freed instead. Any previously - * assigned swapblk is freed. + * assigned swapblk is returned. */ -static void +static daddr_t swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) { static volatile int swblk_zone_exhausted, swpctrie_zone_exhausted; struct swblk *sb, *sb1; vm_pindex_t modpi, rdpi; + daddr_t prev_swapblk; int error, i; VM_OBJECT_ASSERT_WLOCKED(object); @@ -1815,7 +1844,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); if (sb == NULL) { if (swapblk == SWAPBLK_NONE) - return; + return (SWAPBLK_NONE); for (;;) { sb = uma_zalloc(swblk_zone, M_NOWAIT | (curproc == pageproc ? M_USE_RESERVE : 0)); @@ -1882,9 +1911,8 @@ allocated: MPASS(sb->p == rdpi); modpi = pindex % SWAP_META_PAGES; - /* Delete prior contents of metadata. */ - if (sb->d[modpi] != SWAPBLK_NONE) - swp_pager_freeswapspace(sb->d[modpi], 1); + /* Return prior contents of metadata. */ + prev_swapblk = sb->d[modpi]; /* Enter block into metadata. */ sb->d[modpi] = swapblk; @@ -1896,6 +1924,7 @@ allocated: SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, rdpi); uma_zfree(swblk_zone, sb); } + return (prev_swapblk); } /* @@ -1912,7 +1941,7 @@ static void swp_pager_meta_free(vm_object_t object, vm_pindex_t pindex, vm_pindex_t count) { struct swblk *sb; - daddr_t first_free, num_free; + daddr_t n_free, s_free; vm_pindex_t last; int i, limit, start; @@ -1920,8 +1949,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi if (object->type != OBJT_SWAP || count == 0) return; - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); last = pindex + count; for (;;) { sb = SWAP_PCTRIE_LOOKUP_GE(&object->un_pager.swp.swp_blks, @@ -1934,13 +1962,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi for (i = start; i < limit; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; - if (first_free + num_free == sb->d[i]) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = sb->d[i]; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); sb->d[i] = SWAPBLK_NONE; } if (swp_pager_swblk_empty(sb, 0, start) && @@ -1951,7 +1973,7 @@ swp_pager_meta_free(vm_object_t object, vm_pindex_t pi } pindex = sb->p + SWAP_META_PAGES; } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); } /* @@ -1964,7 +1986,7 @@ static void swp_pager_meta_free_all(vm_object_t object) { struct swblk *sb; - daddr_t first_free, num_free; + daddr_t n_free, s_free; vm_pindex_t pindex; int i; @@ -1972,26 +1994,19 @@ swp_pager_meta_free_all(vm_object_t object) if (object->type != OBJT_SWAP) return; - first_free = SWAPBLK_NONE; - num_free = 0; + swp_pager_init_freerange(&s_free, &n_free); for (pindex = 0; (sb = SWAP_PCTRIE_LOOKUP_GE( &object->un_pager.swp.swp_blks, pindex)) != NULL;) { pindex = sb->p + SWAP_META_PAGES; for (i = 0; i < SWAP_META_PAGES; i++) { if (sb->d[i] == SWAPBLK_NONE) continue; - if (first_free + num_free == sb->d[i]) - num_free++; - else { - swp_pager_freeswapspace(first_free, num_free); - first_free = sb->d[i]; - num_free = 1; - } + swp_pager_update_freerange(&s_free, &n_free, sb->d[i]); } SWAP_PCTRIE_REMOVE(&object->un_pager.swp.swp_blks, sb->p); uma_zfree(swblk_zone, sb); } - swp_pager_freeswapspace(first_free, num_free); + swp_pager_freeswapspace(s_free, n_free); } /* From owner-svn-src-all@freebsd.org Wed Aug 8 04:46:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CADCF10743F7; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD418E7C8; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 562FD25B54; Wed, 8 Aug 2018 04:46:04 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w784k4OY001501; Wed, 8 Aug 2018 04:46:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w784k3K3001499; Wed, 8 Aug 2018 04:46:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808080446.w784k3K3001499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 8 Aug 2018 04:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337447 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 337447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 04:46:05 -0000 Author: cem Date: Wed Aug 8 04:46:03 2018 New Revision: 337447 URL: https://svnweb.freebsd.org/changeset/base/337447 Log: FUSE: Remove some set-but-not-used variables No functional change. Modified: head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_file.c Wed Aug 8 04:46:03 2018 (r337447) @@ -102,7 +102,6 @@ fuse_filehandle_open(struct vnode *vp, struct fuse_open_out *foo; int err = 0; - int isdir = 0; int oflags = 0; int op = FUSE_OPEN; @@ -120,7 +119,6 @@ fuse_filehandle_open(struct vnode *vp, oflags = fuse_filehandle_xlate_to_oflags(fufh_type); if (vnode_isdir(vp)) { - isdir = 1; op = FUSE_OPENDIR; if (fufh_type != FUFH_RDONLY) { printf("FUSE:non-rdonly fh requested for a directory?\n"); @@ -172,7 +170,6 @@ fuse_filehandle_close(struct vnode *vp, struct fuse_filehandle *fufh = NULL; int err = 0; - int isdir = 0; int op = FUSE_RELEASE; fuse_trace_printf("fuse_filehandle_put(vp=%p, fufh_type=%d)\n", @@ -187,10 +184,8 @@ fuse_filehandle_close(struct vnode *vp, if (fuse_isdeadfs(vp)) { goto out; } - if (vnode_isdir(vp)) { + if (vnode_isdir(vp)) op = FUSE_RELEASEDIR; - isdir = 1; - } fdisp_init(&fdi, sizeof(*fri)); fdisp_make_vp(&fdi, op, vp, td, cred); fri = fdi.indata; Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_vfsops.c Wed Aug 8 04:46:03 2018 (r337447) @@ -209,7 +209,6 @@ fuse_vfsop_mount(struct mount *mp) int err; uint64_t mntopts, __mntopts; - int max_read_set; uint32_t max_read; int daemon_timeout; int fd; @@ -224,7 +223,6 @@ fuse_vfsop_mount(struct mount *mp) struct vfsoptlist *opts; subtype = NULL; - max_read_set = 0; max_read = ~0; err = 0; mntopts = 0; @@ -277,8 +275,7 @@ fuse_vfsop_mount(struct mount *mp) FUSE_FLAGOPT(no_mmap, FSESS_NO_MMAP); FUSE_FLAGOPT(brokenio, FSESS_BROKENIO); - if (vfs_scanopt(opts, "max_read=", "%u", &max_read) == 1) - max_read_set = 1; + (void)vfs_scanopt(opts, "max_read=", "%u", &max_read); if (vfs_scanopt(opts, "timeout=", "%u", &daemon_timeout) == 1) { if (daemon_timeout < FUSE_MIN_DAEMON_TIMEOUT) daemon_timeout = FUSE_MIN_DAEMON_TIMEOUT; Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Wed Aug 8 03:46:12 2018 (r337446) +++ head/sys/fs/fuse/fuse_vnops.c Wed Aug 8 04:46:03 2018 (r337447) @@ -1249,7 +1249,6 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) struct ucred *cred = ap->a_cred; struct fuse_filehandle *fufh = NULL; - struct fuse_vnode_data *fvdat; struct fuse_iov cookediov; int err = 0; @@ -1264,7 +1263,6 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) (uio_resid(uio) < sizeof(struct dirent))) { return EINVAL; } - fvdat = VTOFUD(vp); if (!fuse_filehandle_valid(vp, FUFH_RDONLY)) { FS_DEBUG("calling readdir() before open()"); From owner-svn-src-all@freebsd.org Wed Aug 8 06:31:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F5E105087A; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 300DB717CE; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 127EA26C9F; Wed, 8 Aug 2018 06:31:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w786Vk1l057243; Wed, 8 Aug 2018 06:31:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w786VkqZ057242; Wed, 8 Aug 2018 06:31:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201808080631.w786VkqZ057242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 8 Aug 2018 06:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337448 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 337448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 06:31:47 -0000 Author: eadler Date: Wed Aug 8 06:31:46 2018 New Revision: 337448 URL: https://svnweb.freebsd.org/changeset/base/337448 Log: top(1): hide THR column in separate-thread mode. It does not make sense to show a "thread count" column when displaying threads separately. In fact we don't, but do show the header for this column. Fix this. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Aug 8 04:46:03 2018 (r337447) +++ head/usr.bin/top/machine.c Wed Aug 8 06:31:46 2018 (r337448) @@ -388,7 +388,10 @@ format_header(const char *uname_field) sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : ""); sbuf_printf(header, " %-*.*s ", namelength, namelength, uname_field); - sbuf_cat(header, "THR PRI NICE SIZE RES "); + if (!ps.thread) { + sbuf_cat(header, "THR "); + } + sbuf_cat(header, "PRI NICE SIZE RES "); if (ps.swap) { sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP"); } From owner-svn-src-all@freebsd.org Wed Aug 8 07:58:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F2D710525CA; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F94573D21; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F73F279D2; Wed, 8 Aug 2018 07:58:30 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w787wUIB001389; Wed, 8 Aug 2018 07:58:30 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w787wUou001388; Wed, 8 Aug 2018 07:58:30 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201808080758.w787wUou001388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 8 Aug 2018 07:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337452 - head X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 07:58:30 -0000 Author: royger Date: Wed Aug 8 07:58:29 2018 New Revision: 337452 URL: https://svnweb.freebsd.org/changeset/base/337452 Log: build: skip the database check for the distributeworld target distributeworld is used to generate install media, so it makes no sense to check the host database since the install media can be generated from any box, regardless of the version of FreeBSD it's running. Sponsored by: Citrix Systems R&D Reviewed by: ian, gjb Differential revision: https://reviews.freebsd.org/D16507 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Aug 8 07:32:14 2018 (r337451) +++ head/Makefile.inc1 Wed Aug 8 07:58:29 2018 (r337452) @@ -830,6 +830,13 @@ IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh .else IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP} .endif + +# When generating install media, do not allow user and group information from +# the build host to affect the contents of the distribution. +.if make(distributeworld) +DB_FROM_SRC= yes +.endif + .if defined(DB_FROM_SRC) INSTALLFLAGS+= -N ${.CURDIR}/etc MTREEFLAGS+= -N ${.CURDIR}/etc From owner-svn-src-all@freebsd.org Wed Aug 8 12:07:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E7E105A565; Wed, 8 Aug 2018 12:07:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3FB57B11A; Wed, 8 Aug 2018 12:07:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 964DB225E; Wed, 8 Aug 2018 12:07:46 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78C7k7q031174; Wed, 8 Aug 2018 12:07:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78C7kK2031172; Wed, 8 Aug 2018 12:07:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201808081207.w78C7kK2031172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Wed, 8 Aug 2018 12:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337453 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 337453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 12:07:47 -0000 Author: fsu Date: Wed Aug 8 12:07:45 2018 New Revision: 337453 URL: https://svnweb.freebsd.org/changeset/base/337453 Log: Fix directory blocks checksum updating logic. The checksum updating functions were not called in case of dir index inode splitting and in case of dir entry removing, when the entry was first in the block. Fix and move the dir entry adding logic when i_count == 0 to new function. MFC after: 3 months Modified: head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Wed Aug 8 07:58:29 2018 (r337452) +++ head/sys/fs/ext2fs/ext2_htree.c Wed Aug 8 12:07:45 2018 (r337453) @@ -800,7 +800,7 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ cursize = roundup(ip->i_size, blksize); dirsize = cursize + blksize; blknum = dirsize / blksize - 1; - + ext2_dx_csum_set(ip, (struct ext2fs_direct_2 *)newidxblock); error = ext2_htree_append_block(dvp, newidxblock, cnp, blksize); if (error) Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed Aug 8 07:58:29 2018 (r337452) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed Aug 8 12:07:45 2018 (r337453) @@ -859,6 +859,68 @@ ext2_dirbadentry(struct vnode *dp, struct ext2fs_direc } /* + * Insert an entry into the fresh directory block. + * Initialize entry tail if the metadata_csum feature is turned on. + */ +static int +ext2_add_first_entry(struct vnode *dvp, struct ext2fs_direct_2 *entry, + struct componentname *cnp) +{ + struct inode *dp; + struct iovec aiov; + struct uio auio; + char* buf = NULL; + int dirblksize, error; + + dp = VTOI(dvp); + dirblksize = dp->i_e2fs->e2fs_bsize; + + if (dp->i_offset & (dirblksize - 1)) + panic("ext2_add_first_entry: bad directory offset"); + + if (EXT2_HAS_RO_COMPAT_FEATURE(dp->i_e2fs, + EXT2F_ROCOMPAT_METADATA_CKSUM)) { + entry->e2d_reclen = dirblksize - sizeof(struct ext2fs_direct_tail); + buf = malloc(dirblksize, M_TEMP, M_WAITOK); + if (!buf) { + error = ENOMEM; + goto out; + } + memcpy(buf, entry, EXT2_DIR_REC_LEN(entry->e2d_namlen)); + ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, dirblksize)); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf); + + auio.uio_offset = dp->i_offset; + auio.uio_resid = dirblksize; + aiov.iov_len = auio.uio_resid; + aiov.iov_base = (caddr_t)buf; + } else { + entry->e2d_reclen = dirblksize; + auio.uio_offset = dp->i_offset; + auio.uio_resid = EXT2_DIR_REC_LEN(entry->e2d_namlen); + aiov.iov_len = auio.uio_resid; + aiov.iov_base = (caddr_t)entry; + } + + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_WRITE; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = (struct thread *)0; + error = VOP_WRITE(dvp, &auio, IO_SYNC, cnp->cn_cred); + if (error) + goto out; + + dp->i_size = roundup2(dp->i_size, dirblksize); + dp->i_flag |= IN_CHANGE; + +out: + free(buf, M_TEMP); + return (error); + +} + +/* * Write a directory entry after a call to namei, using the parameters * that it left in nameidata. The argument ip is the inode which the new * directory entry will refer to. Dvp is a pointer to the directory to @@ -871,7 +933,6 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str { struct inode *dp; struct ext2fs_direct_2 newdir; - struct buf *bp; int DIRBLKSIZ = ip->i_e2fs->e2fs_bsize; int error; @@ -911,36 +972,15 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str } } - if (dp->i_count == 0) { - /* - * If dp->i_count is 0, then namei could find no - * space in the directory. Here, dp->i_offset will - * be on a directory block boundary and we will write the - * new entry into a fresh block. - */ - if (dp->i_offset & (DIRBLKSIZ - 1)) - panic("ext2_direnter: newblk"); + /* + * If dp->i_count is 0, then namei could find no + * space in the directory. Here, dp->i_offset will + * be on a directory block boundary and we will write the + * new entry into a fresh block. + */ + if (dp->i_count == 0) + return ext2_add_first_entry(dvp, &newdir, cnp); - newdir.e2d_reclen = DIRBLKSIZ; - - bp = getblk(ip->i_devvp, lblkno(dp->i_e2fs, dp->i_offset), - DIRBLKSIZ, 0, 0, 0); - if (!bp) - return (EIO); - - memcpy(bp->b_data, &newdir, sizeof(struct ext2fs_direct_2)); - - ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); - error = bwrite(bp); - if (error) - return (error); - - dp->i_size = roundup2(dp->i_size, DIRBLKSIZ); - dp->i_flag |= IN_CHANGE; - - return (0); - } - error = ext2_add_entry(dvp, &newdir); if (!error && dp->i_endoff && dp->i_endoff < dp->i_size) error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC, @@ -1071,6 +1111,7 @@ ext2_dirremove(struct vnode *dvp, struct componentname &bp)) != 0) return (error); ep->e2d_ino = 0; + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); From owner-svn-src-all@freebsd.org Wed Aug 8 12:08:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B75105A5E9; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BB307B26C; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D080225F; Wed, 8 Aug 2018 12:08:47 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78C8kQk031267; Wed, 8 Aug 2018 12:08:46 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78C8krZ031264; Wed, 8 Aug 2018 12:08:46 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201808081208.w78C8krZ031264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Wed, 8 Aug 2018 12:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337454 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 337454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 12:08:47 -0000 Author: fsu Date: Wed Aug 8 12:08:46 2018 New Revision: 337454 URL: https://svnweb.freebsd.org/changeset/base/337454 Log: Split the dir_index and dir_nlink features. Do not allow to create more that EXT4_LINK_MAX links to directory in case if the dir_nlink is not set, like it is done in the fresh e2fsprogs updates. MFC after: 3 months Modified: head/sys/fs/ext2fs/ext2_dir.h head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_dir.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dir.h Wed Aug 8 12:07:45 2018 (r337453) +++ head/sys/fs/ext2fs/ext2_dir.h Wed Aug 8 12:08:46 2018 (r337454) @@ -89,7 +89,6 @@ struct ext2fs_direct_tail { /* * Maximal count of links to a file */ -#define EXT2_LINK_MAX 32000 #define EXT4_LINK_MAX 65000 /* Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 8 12:07:45 2018 (r337453) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 8 12:08:46 2018 (r337454) @@ -675,19 +675,6 @@ out: return (error); } -static unsigned short -ext2_max_nlink(struct inode *ip) -{ - struct m_ext2fs *fs; - - fs = ip->i_e2fs; - - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_DIR_NLINK)) - return (EXT4_LINK_MAX); - else - return (EXT2_LINK_MAX); -} - /* * link vnode call */ @@ -705,7 +692,7 @@ ext2_link(struct vop_link_args *ap) panic("ext2_link: no name"); #endif ip = VTOI(vp); - if ((nlink_t)ip->i_nlink >= ext2_max_nlink(ip)) { + if ((nlink_t)ip->i_nlink >= EXT4_LINK_MAX) { error = EMLINK; goto out; } @@ -732,10 +719,12 @@ ext2_inc_nlink(struct inode *ip) ip->i_nlink++; - if (ext2_htree_has_idx(ip) && ip->i_nlink > 1) { - if (ip->i_nlink >= ext2_max_nlink(ip) || ip->i_nlink == 2) + if (S_ISDIR(ip->i_mode) && + EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK) && + ip->i_nlink > 1) { + if (ip->i_nlink >= EXT4_LINK_MAX || ip->i_nlink == 2) ip->i_nlink = 1; - } else if (ip->i_nlink > ext2_max_nlink(ip)) { + } else if (ip->i_nlink > EXT4_LINK_MAX) { ip->i_nlink--; return (EMLINK); } @@ -833,7 +822,8 @@ abortit: goto abortit; dp = VTOI(fdvp); ip = VTOI(fvp); - if (ip->i_nlink >= ext2_max_nlink(ip) && !ext2_htree_has_idx(ip)) { + if (ip->i_nlink >= EXT4_LINK_MAX && + !EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK)) { VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; @@ -1304,8 +1294,8 @@ ext2_mkdir(struct vop_mkdir_args *ap) panic("ext2_mkdir: no name"); #endif dp = VTOI(dvp); - if ((nlink_t)dp->i_nlink >= ext2_max_nlink(dp) && - !ext2_htree_has_idx(dp)) { + if ((nlink_t)dp->i_nlink >= EXT4_LINK_MAX && + !EXT2_HAS_RO_COMPAT_FEATURE(dp->i_e2fs, EXT2F_ROCOMPAT_DIR_NLINK)) { error = EMLINK; goto out; } @@ -1655,10 +1645,11 @@ ext2_pathconf(struct vop_pathconf_args *ap) switch (ap->a_name) { case _PC_LINK_MAX: - if (ext2_htree_has_idx(VTOI(ap->a_vp))) + if (EXT2_HAS_RO_COMPAT_FEATURE(VTOI(ap->a_vp)->i_e2fs, + EXT2F_ROCOMPAT_DIR_NLINK)) *ap->a_retval = INT_MAX; else - *ap->a_retval = ext2_max_nlink(VTOI(ap->a_vp)); + *ap->a_retval = EXT4_LINK_MAX; break; case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; From owner-svn-src-all@freebsd.org Wed Aug 8 13:36:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FF1105C706; Wed, 8 Aug 2018 13:36:50 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFDE67E3B3; Wed, 8 Aug 2018 13:36:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C918311B; Wed, 8 Aug 2018 13:36:49 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Danqr078485; Wed, 8 Aug 2018 13:36:49 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Dan3f078484; Wed, 8 Aug 2018 13:36:49 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201808081336.w78Dan3f078484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 8 Aug 2018 13:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337455 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 337455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 13:36:50 -0000 Author: rrs Date: Wed Aug 8 13:36:49 2018 New Revision: 337455 URL: https://svnweb.freebsd.org/changeset/base/337455 Log: Fix a small bug in rack where it will end up sending the FIN twice. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D16604 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Aug 8 12:08:46 2018 (r337454) +++ head/sys/netinet/tcp_stacks/rack.c Wed Aug 8 13:36:49 2018 (r337455) @@ -7603,13 +7603,10 @@ dontupdate: * If our state indicates that FIN should be sent and we have not * yet done so, then we need to send. */ - if (flags & TH_FIN) { - if ((tp->t_flags & TF_SENTFIN) || - (((tp->t_flags & TF_SENTFIN) == 0) && - (tp->snd_nxt == tp->snd_una))) { - pass = 11; - goto send; - } + if ((flags & TH_FIN) && + (tp->snd_nxt == tp->snd_una)) { + pass = 11; + goto send; } /* * No reason to send a segment, just return. From owner-svn-src-all@freebsd.org Wed Aug 8 15:08:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C231D105E9C8; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7639B815F7; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534FA4446; Wed, 8 Aug 2018 15:08:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78F8NS9025570; Wed, 8 Aug 2018 15:08:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78F8Nb3025569; Wed, 8 Aug 2018 15:08:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081508.w78F8Nb3025569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337456 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 337456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 15:08:24 -0000 Author: pfg Date: Wed Aug 8 15:08:22 2018 New Revision: 337456 URL: https://svnweb.freebsd.org/changeset/base/337456 Log: msdosfs: fixes for Undefined Behavior. These were found by the Undefined Behaviour GsoC project at NetBSD: Do not change signedness bit with left shift. While there avoid signed integer overflow. Address both issues with using unsigned type. msdosfs_fat.c:512:42, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:521:44, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:744:14, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:744:24, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]' msdosfs_fat.c:840:13, left shift of 1 by 31 places cannot be represented in type 'int' msdosfs_fat.c:840:36, signed integer overflow: -2147483648 - 1 cannot be represented in type 'int [20]' Detected with micro-UBSan in the user mode. Hinted from: NetBSD (CVS 1.33) MFC after: 2 weeks Differenctial Revision: https://reviews.freebsd.org/D16615 Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Wed Aug 8 13:36:49 2018 (r337455) +++ head/sys/fs/msdosfs/msdosfs_fat.c Wed Aug 8 15:08:22 2018 (r337456) @@ -391,7 +391,7 @@ usemap_alloc(struct msdosfsmount *pmp, u_long cn) KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) == 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; pmp->pm_flags |= MSDOSFS_FSIMOD; @@ -412,7 +412,7 @@ usemap_free(struct msdosfsmount *pmp, u_long cn) KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); - pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); + pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } int @@ -775,7 +775,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != FULL_RUN) { cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -792,7 +792,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, for (cn = 0; cn < newst;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != FULL_RUN) { cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -950,7 +950,7 @@ fillinusemap(struct msdosfsmount *pmp) for (cn = pmp->pm_maxcluster + 1; cn < (pmp->pm_maxcluster + N_INUSEBITS) / N_INUSEBITS; cn++) - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); return (0); } From owner-svn-src-all@freebsd.org Wed Aug 8 15:12:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE10105EC97; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D22E81AA6; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ECF645D3; Wed, 8 Aug 2018 15:12:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78FCXsO030336; Wed, 8 Aug 2018 15:12:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78FCXc2030335; Wed, 8 Aug 2018 15:12:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081512.w78FCXc2030335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337457 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 15:12:33 -0000 Author: pfg Date: Wed Aug 8 15:12:32 2018 New Revision: 337457 URL: https://svnweb.freebsd.org/changeset/base/337457 Log: Revert r337440: the log message is wrong. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Aug 8 15:08:22 2018 (r337456) +++ head/usr.bin/printf/printf.c Wed Aug 8 15:12:32 2018 (r337457) @@ -1,7 +1,6 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -376,19 +375,16 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - /* Convert "b" to "s" for output. */ - start[strlen(start) - 1] = 's'; - if ((p = strdup(getstr())) == NULL) { + p = strdup(getstr()); + if (p == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - PF(start, p); - /* Restore format for next loop. */ - + fputs(p, stdout); free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-all@freebsd.org Wed Aug 8 15:25:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5386B105F136; Wed, 8 Aug 2018 15:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 058B682110; Wed, 8 Aug 2018 15:25:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA6FA477A; Wed, 8 Aug 2018 15:25:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78FP1j4035565; Wed, 8 Aug 2018 15:25:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78FP1TS035564; Wed, 8 Aug 2018 15:25:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201808081525.w78FP1TS035564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 8 Aug 2018 15:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337458 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 15:25:02 -0000 Author: pfg Date: Wed Aug 8 15:25:01 2018 New Revision: 337458 URL: https://svnweb.freebsd.org/changeset/base/337458 Log: Fix printf(1) ignores width and precision in %b format. The precision with the conversion specifier b is specified by POSIX: see point 7 in the reference documentation. This corrects previous wrong log in r337440. Reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html PR: 229641 Reported by: Rudolf Cejka Submitted by: Garrett D'Amore (illumos) MFC after: 1 week Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Aug 8 15:12:32 2018 (r337457) +++ head/usr.bin/printf/printf.c Wed Aug 8 15:25:01 2018 (r337458) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * + * Copyright 2018 Staysail Systems, Inc. * Copyright 2014 Garrett D'Amore * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 1989, 1993 @@ -375,16 +376,19 @@ printf_doformat(char *fmt, int *rval) char *p; int getout; - p = strdup(getstr()); - if (p == NULL) { + /* Convert "b" to "s" for output. */ + start[strlen(start) - 1] = 's'; + if ((p = strdup(getstr())) == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); } getout = escape(p, 0, &len); - fputs(p, stdout); + PF(start, p); + /* Restore format for next loop. */ + free(p); if (getout) - return (end_fmt); + exit(*rval); break; } case 'c': { From owner-svn-src-all@freebsd.org Wed Aug 8 16:04:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 663691060544; Wed, 8 Aug 2018 16:04:28 +0000 (UTC) (envelope-from prvs=751fb83b8=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 966E683825; Wed, 8 Aug 2018 16:04:27 +0000 (UTC) (envelope-from prvs=751fb83b8=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.53,458,1531785600"; d="scan'208";a="77360106" Date: Wed, 8 Aug 2018 18:01:57 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Brooks Davis CC: Ian Lepore , , , Subject: Re: svn commit: r336526 - head Message-ID: <20180808160157.uxjcbxu57z45pap2@mac> References: <201807200044.w6K0i4QQ079894@repo.freebsd.org> <20180726135806.foqjgb555vhwhqun@mac.bytemobile.com> <1532616552.61594.23.camel@freebsd.org> <20180726145412.zp4zjznpwmhbaj65@mac.bytemobile.com> <1532617518.61594.31.camel@freebsd.org> <20180726161546.kts5tjbow7wfzhyk@mac.bytemobile.com> <20180726174146.GA63738@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180726174146.GA63738@spindle.one-eyed-alien.net> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:04:28 -0000 On Thu, Jul 26, 2018 at 05:41:46PM +0000, Brooks Davis wrote: > On Thu, Jul 26, 2018 at 06:15:46PM +0200, Roger Pau Monn?? wrote: > > On Thu, Jul 26, 2018 at 09:05:18AM -0600, Ian Lepore wrote: > > > On Thu, 2018-07-26 at 16:54 +0200, Roger Pau Monn? wrote: > > > > On Thu, Jul 26, 2018 at 08:49:12AM -0600, Ian Lepore wrote: > > > > > > > > > > On Thu, 2018-07-26 at 15:58 +0200, Roger Pau Monn? wrote: > > > > > > > > > > > > On Fri, Jul 20, 2018 at 12:44:04AM +0000, Ian Lepore wrote: > > > > > > > > > > > > > > > > > > > > > Author: ian > > > > > > > Date: Fri Jul 20 00:44:04 2018 > > > > > > > New Revision: 336526 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/336526 > > > > > > > > > > > > > > Log: > > > > > > > ? Add ntpd to the list of users/groups to check before > > > > > > > installing. > > > > > > The Xen CI loop is getting this when trying to create dist media > > > > > > for HEAD FreeBSD (`make -C release ftp`): > > > > > > > > > > > > + LC_ALL=C > > > > > > + export LC_ALL > > > > > > + > > > > > > PATH=/usr/lib/ccache:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbi > > > > > > n:/u > > > > > > sr/local/bin:/root/bin:/usr/lib/git-core > > > > > > + http_proxy=http://cache:3128/ > > > > > > + export http_proxy > > > > > > + https_proxy=http://cache:3128/ > > > > > > + export https_proxy > > > > > > + exec > > > > > > + cd /home/osstest/build.125515.build-amd64-freebsd > > > > > > + rm -f build-ok-stamp > > > > > > + cd freebsd > > > > > > + export 'MAKEOBJDIRPREFIX=/home/osstest/build.125515.build- > > > > > > amd64- > > > > > > freebsd/obj' > > > > > > + export 'TARGET=amd64' > > > > > > + make -C release ftp -DWITHOUT_AUTO_OBJ > > > > > > + tee ../release-ftp-log > > > > > > mkdir -p dist > > > > > > cd /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/release/.. && make TARGET_ARCH=amd64 TARGET=amd64 > > > > > > distributeworld DISTDIR=/usr/home/osstest/build.125515.build- > > > > > > amd64- > > > > > > freebsd/freebsd/release/dist > > > > > > make[2]: "/usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/obj/usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/amd64.amd64/toolchain-metadata.mk" line 1: Using > > > > > > cached toolchain metadata from build at??on Mon Jul 23 10:29:23 > > > > > > UTC > > > > > > 2018 > > > > > > ERROR: Required ntpd user is missing, see /usr/src/UPDATING. > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make[2]: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make[1]: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd > > > > > > *** Error code 1 > > > > > > > > > > > > Stop. > > > > > > make: stopped in /usr/home/osstest/build.125515.build-amd64- > > > > > > freebsd/freebsd/release > > > > > > > > > > > > The full build log can be found at: > > > > > > > > > > > > http://logs.test-lab.xenproject.org/osstest/logs/125569/build-amd > > > > > > 64-f > > > > > > reebsd/7.ts-freebsd-build.log > > > > > > > > > > > > Note that it's ~100MB. > > > > > > > > > > > > Thanks, Roger. > > > > > > > > > > > If the script is creating a new distribution image from scratch, it > > > > > should be using -DDB_FROM_SRC on all distrib* and install* make > > > > > targets, to avoid using (and verifying against) the passwd database > > > > > on > > > > > the build system. > > > > Shouldn't then that be set by default for the ftp release target? > > > > The sole purpose of that target is to create the sets that go to the > > > > servers AFAICT. > > > > > > > > Or maybe it's the distributeworld target the one missing the > > > > DB_FROM_SRC? > > > > > > > > Roger. > > > > > > > > > > I don't know anything about the release scripts or how they work. > > > > > > I started down the path of trying to make the build system > > > automatically set DB_FROM_SRC if DESTDIR is anything other than "/", > > > but I realized that's wrong too... I occasionally mount an sdcard from > > > some embedded system on my build machine and update it from a > > > crossbuild using DESTDIR=/mnt, and in a case like that, using the > > > passwd database from the system being updated is the right thing to do > > > and DB_FROM_SRC isn't right (although it would work most of the time > > > for most people). > > > > > > Right now there's no way to even properly use the passwd data from the > > > target system, and when I tried to do that, I ran into other bugs. The > > > only options now are to use the running system even when it's not > > > what's being installed (clearly wrong) or use DB_FROM_SRC to bypass the > > > checks, but also bypass using the passwd data from the target system > > > (but it works okay as long as none of the names/uids < 1024 have been > > > changed on the target system/image). > > > > But when executing something like the distributeworld target there's > > nothing to check. You cannot check against the current DB, and there's > > no destination DB since you are just generating install sets. Hence I > > think that at least for distributeworld and maybe other targets > > DB_FROM_SRC should be set by default in order to restore previous > > behavior. > > DB_FROM_SRC isn't default solely to support environments where uids/gids > don't match those in our password/group files. Unfortunately the FreeBSD > cluster has such a setup. Otherwise we'd probably have just told > people to a) don't do that and b) if you must, modify your source tree > appropriately. It's certainly the case that we should always use > DB_FROM_SRC if release builds. I think you might be right about > distributeworld, but we might need to check how that interacts with > etcupdate/mergemaster. There seems to be further fallout apart from the DB_FROM_SRC issue, I've created a PR to track this regression: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230459 Roger. From owner-svn-src-all@freebsd.org Wed Aug 8 16:08:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED93B1060678; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0587839FD; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CC714DCB; Wed, 8 Aug 2018 16:08:39 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78G8dnW055918; Wed, 8 Aug 2018 16:08:39 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78G8dMp055917; Wed, 8 Aug 2018 16:08:39 GMT (envelope-from br@FreeBSD.org) Message-Id: <201808081608.w78G8dMp055917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 8 Aug 2018 16:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337459 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 337459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:08:40 -0000 Author: br Date: Wed Aug 8 16:08:38 2018 New Revision: 337459 URL: https://svnweb.freebsd.org/changeset/base/337459 Log: Implement uma_small_alloc(), uma_small_free(). Reviewed by: markj Obtained from: arm64 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16628 Modified: head/sys/riscv/include/vmparam.h head/sys/riscv/riscv/uma_machdep.c Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Wed Aug 8 15:25:01 2018 (r337458) +++ head/sys/riscv/include/vmparam.h Wed Aug 8 16:08:38 2018 (r337459) @@ -223,10 +223,7 @@ #define VM_INITIAL_PAGEIN 16 #endif -/* - * RISCVTODO - * #define UMA_MD_SMALL_ALLOC - */ +#define UMA_MD_SMALL_ALLOC #ifndef LOCORE extern vm_paddr_t dmap_phys_base; Modified: head/sys/riscv/riscv/uma_machdep.c ============================================================================== --- head/sys/riscv/riscv/uma_machdep.c Wed Aug 8 15:25:01 2018 (r337458) +++ head/sys/riscv/riscv/uma_machdep.c Wed Aug 8 16:08:38 2018 (r337459) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,13 +45,39 @@ void * uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, int wait) { + vm_page_t m; + vm_paddr_t pa; + void *va; - panic("uma_small_alloc"); + *flags = UMA_SLAB_PRIV; + m = vm_page_alloc_domain(NULL, 0, domain, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); + pa = m->phys_addr; +#if 0 + /* RISCVTODO: minidump */ + if ((wait & M_NODUMP) == 0) + dump_add_page(pa); +#endif + va = (void *)PHYS_TO_DMAP(pa); + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) + bzero(va, PAGE_SIZE); + return (va); } void uma_small_free(void *mem, vm_size_t size, u_int8_t flags) { + vm_page_t m; + vm_paddr_t pa; - panic("uma_small_free"); + pa = DMAP_TO_PHYS((vm_offset_t)mem); +#if 0 + /* RISCVTODO: minidump */ + dump_drop_page(pa); +#endif + m = PHYS_TO_VM_PAGE(pa); + vm_page_unwire_noq(m); + vm_page_free(m); } From owner-svn-src-all@freebsd.org Wed Aug 8 16:09:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AEC810606EA; Wed, 8 Aug 2018 16:09:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFF283B5E; Wed, 8 Aug 2018 16:09:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 109154DCF; Wed, 8 Aug 2018 16:09:29 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78G9SAb056000; Wed, 8 Aug 2018 16:09:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78G9SnQ055998; Wed, 8 Aug 2018 16:09:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808081609.w78G9SnQ055998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 16:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337460 - in stable/11/sys: net netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11/sys: net netinet netinet6 X-SVN-Commit-Revision: 337460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:09:29 -0000 Author: ae Date: Wed Aug 8 16:09:28 2018 New Revision: 337460 URL: https://svnweb.freebsd.org/changeset/base/337460 Log: MFC r336405: Move invoking of callout_stop(&lle->lle_timer) into llentry_free(). This deduplicates the code a bit, and also implicitly adds missing callout_stop() to in[6]_lltable_delete_entry() functions. PR: 209682, 225927 Modified: stable/11/sys/net/if_llatbl.c stable/11/sys/netinet/in.c stable/11/sys/netinet6/in6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_llatbl.c ============================================================================== --- stable/11/sys/net/if_llatbl.c Wed Aug 8 16:08:38 2018 (r337459) +++ stable/11/sys/net/if_llatbl.c Wed Aug 8 16:09:28 2018 (r337460) @@ -429,6 +429,9 @@ llentry_free(struct llentry *lle) pkts_dropped = lltable_drop_entry_queue(lle); + /* cancel timer */ + if (callout_stop(&lle->lle_timer) > 0) + LLE_REMREF(lle); LLE_FREE_LOCKED(lle); return (pkts_dropped); @@ -515,8 +518,6 @@ lltable_free(struct lltable *llt) IF_AFDATA_WUNLOCK(llt->llt_ifp); LIST_FOREACH_SAFE(lle, &dchain, lle_chain, next) { - if (callout_stop(&lle->lle_timer) > 0) - LLE_REMREF(lle); llentry_free(lle); } Modified: stable/11/sys/netinet/in.c ============================================================================== --- stable/11/sys/netinet/in.c Wed Aug 8 16:08:38 2018 (r337459) +++ stable/11/sys/netinet/in.c Wed Aug 8 16:09:28 2018 (r337460) @@ -1144,10 +1144,6 @@ in_lltable_free_entry(struct lltable *llt, struct llen lltable_unlink_entry(llt, lle); } - /* cancel timer */ - if (callout_stop(&lle->lle_timer) > 0) - LLE_REMREF(lle); - /* Drop hold queue */ pkts_dropped = llentry_free(lle); ARPSTAT_ADD(dropped, pkts_dropped); Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Wed Aug 8 16:08:38 2018 (r337459) +++ stable/11/sys/netinet6/in6.c Wed Aug 8 16:09:28 2018 (r337460) @@ -2104,9 +2104,6 @@ in6_lltable_free_entry(struct lltable *llt, struct lle lltable_unlink_entry(llt, lle); } - if (callout_stop(&lle->lle_timer) > 0) - LLE_REMREF(lle); - llentry_free(lle); } From owner-svn-src-all@freebsd.org Wed Aug 8 16:11:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 658171060A09; Wed, 8 Aug 2018 16:11:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA8B83F12; Wed, 8 Aug 2018 16:11:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F16434F24; Wed, 8 Aug 2018 16:11:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78GBlrB060122; Wed, 8 Aug 2018 16:11:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78GBkMe060114; Wed, 8 Aug 2018 16:11:46 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808081611.w78GBkMe060114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 16:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337461 - in stable/11: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Commit-Revision: 337461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:11:48 -0000 Author: ae Date: Wed Aug 8 16:11:46 2018 New Revision: 337461 URL: https://svnweb.freebsd.org/changeset/base/337461 Log: MFC r336132: Add "record-state", "set-limit" and "defer-action" rule options to ipfw. "record-state" is similar to "keep-state", but it doesn't produce implicit O_PROBE_STATE opcode in a rule. "set-limit" is like "limit", but it has the same feature as "record-state", it is single opcode without implicit O_PROBE_STATE opcode. "defer-action" is targeted to be used with dynamic states. When rule with this opcode is matched, the rule's action will not be executed, instead dynamic state will be created. And when this state will be matched by "check-state", then rule action will be executed. This allows create a more complicated rulesets. Submitted by: lev Modified: stable/11/sbin/ipfw/ipfw.8 stable/11/sbin/ipfw/ipfw2.c stable/11/sbin/ipfw/ipfw2.h stable/11/sys/netinet/ip_fw.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw.8 ============================================================================== --- stable/11/sbin/ipfw/ipfw.8 Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sbin/ipfw/ipfw.8 Wed Aug 8 16:11:46 2018 (r337461) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2018 +.Dd July 9, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -212,9 +212,11 @@ or depending on how the kernel is configured. .Pp If the ruleset includes one or more rules with the -.Cm keep-state -or +.Cm keep-state , +.Cm record-state , .Cm limit +or +.Cm set-limit option, the firewall will have a .Em stateful @@ -231,6 +233,18 @@ or .Cm limit rule, and are typically used to open the firewall on-demand to legitimate traffic only. +Please, note, that +.Cm keep-state +amd +.Cm limit +imply implicit +.Cm check-state +for all packets (not only these matched by the rule) but +.Cm record-state +and +.Cm set-limit +have no implicit +.Cm check-state . See the .Sx STATEFUL FIREWALL and @@ -628,7 +642,12 @@ to simulate the effect of multiple paths leading to ou packet delivery. .Pp Note: this condition is checked before any other condition, including -ones such as keep-state or check-state which might have side effects. +ones such as +.Cm keep-state +or +.Cm check-state +which might have +side effects. .It Cm log Op Cm logamount Ar number Packets matching a rule with the .Cm log @@ -1462,6 +1481,21 @@ action followed by the comment. .It Cm bridged Alias for .Cm layer2 . +.It Cm defer-immediate-action | defer-action +A rule with this option will not perform normal action +upon a match. This option is intended to be used with +.Cm record-state +or +.Cm keep-state +as the dynamic rule, created but ignored on match, will work +as intended. +Rules with both +.Cm record-state +and +.Cm defer-immediate-action +create a dynamic rule and continue with the next rule without actually +performing the action part of this rule. When the rule is later activated +via the state table, the action is performed as usual. .It Cm diverted Matches only packets generated by a divert socket. .It Cm diverted-loopback @@ -1780,6 +1814,14 @@ and they are always printed as hexadecimal (unless the option is used, in which case symbolic resolution will be attempted). .It Cm proto Ar protocol Matches packets with the corresponding IP protocol. +.It Cm record-state +Upon a match, the firewall will create a dynamic rule as if +.Cm keep-state +was specified. +However, this option doesn't imply an implicit +.Cm check-state +in contrast to +.Cm keep-state . .It Cm recv | xmit | via Brq Ar ifX | Ar if Ns Cm * | Ar table Ns Po Ar name Ns Oo , Ns Ar value Oc Pc | Ar ipno | Ar any Matches packets received, transmitted or going through, respectively, the interface specified by exact name @@ -1828,6 +1870,12 @@ A packet might not have a receive or transmit interfac originating from the local host have no receive interface, while packets destined for the local host have no transmit interface. +.It Cm set-limit Bro Cm src-addr | src-port | dst-addr | dst-port Brc Ar N +Works like +.Cm limit +but does not have an implicit +.Cm check-state +attached to it. .It Cm setup Matches TCP packets that have the SYN bit set but no ACK bit. This is the short form of @@ -2284,16 +2332,18 @@ create rules for specific flows when packets that match a given pattern are detected. Support for stateful operation comes through the -.Cm check-state , keep-state +.Cm check-state , keep-state , record-state , limit and -.Cm limit +.Cm set-limit options of .Nm rules . .Pp Dynamic rules are created when a packet matches a -.Cm keep-state -or +.Cm keep-state , +.Cm record-state , .Cm limit +or +.Cm set-limit rule, causing the creation of a .Em dynamic rule which will match all and only packets with @@ -3660,6 +3710,15 @@ rule should usually be placed near the beginning of th ruleset to minimize the amount of work scanning the ruleset. Your mileage may vary. .Pp +For more complex scenarios with dynamic rules +.Cm record-state +and +.Cm defer-action +can be used to precisely control creation and checking of dynamic rules. +Example of usage of these options are provided in +.Sx NETWORK ADDRESS TRANSLATION (NAT) +Section. +.Pp To limit the number of connections a user can open you can use the following type of rules: .Pp @@ -3926,6 +3985,40 @@ or it could be split in: .Dl " 10.0.0.100" .Dl "ipfw nat 5 config redirect_port tcp" .Dl " 192.168.0.1:80,192.168.0.10:22,192.168.0.20:25 500" +.Pp +Sometimes you may want to mix NAT and dynamic rules. It could be achived with +.Cm record-state +and +.Cm defer-action +options. Problem is, you need to create dynamic rule before NAT and check it +after NAT actions (or vice versa) to have consistent addresses and ports. +Rule with +.Cm keep-state +option will trigger activation of existing dynamic state, and action of such +rule will be performed as soon as rule is matched. In case of NAT and +.Cm allow +rule packet need to be passed to NAT, not allowed as soon is possible. +.Pp +There is example of set of rules to achive this. Bear in mind that this +is exmaple only and it is not very usefult by itself. +.Pp +On way out, after all checks place this rules: +.Pp +.Dl "ipfw add allow record-state skip-action" +.Dl "ipfw add nat 1" +.Pp +And on way in there should be something like this: +.Pp +.Dl "ipfw add nat 1" +.Dl "ipfw add check-state" +.Pp +Please note, that first rule on way out doesn't allow packet and doesn't +execute existing dynamic rules. All it does, create new dynamic rule with +.Cm allow +action, if it is not created yet. Later, this dynamic rule is used on way +in by +.Cm check-state +rule. .Sh SEE ALSO .Xr cpp 1 , .Xr m4 1 , Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sbin/ipfw/ipfw2.c Wed Aug 8 16:11:46 2018 (r337461) @@ -305,7 +305,9 @@ static struct _s_x rule_options[] = { { "jail", TOK_JAIL }, { "in", TOK_IN }, { "limit", TOK_LIMIT }, + { "set-limit", TOK_SETLIMIT }, { "keep-state", TOK_KEEPSTATE }, + { "record-state", TOK_RECORDSTATE }, { "bridged", TOK_LAYER2 }, { "layer2", TOK_LAYER2 }, { "out", TOK_OUT }, @@ -368,6 +370,8 @@ static struct _s_x rule_options[] = { { "src-ip6", TOK_SRCIP6}, { "lookup", TOK_LOOKUP}, { "flow", TOK_FLOW}, + { "defer-action", TOK_SKIPACTION }, + { "defer-immediate-action", TOK_SKIPACTION }, { "//", TOK_COMMENT }, { "not", TOK_NOT }, /* pseudo option */ @@ -1371,9 +1375,10 @@ struct show_state { const ipfw_insn *eaction; uint8_t *printed; int flags; -#define HAVE_PROTO 0x0001 -#define HAVE_SRCIP 0x0002 -#define HAVE_DSTIP 0x0004 +#define HAVE_PROTO 0x0001 +#define HAVE_SRCIP 0x0002 +#define HAVE_DSTIP 0x0004 +#define HAVE_PROBE_STATE 0x0008 int proto; int or_block; }; @@ -1415,13 +1420,12 @@ mark_printed(struct show_state *state, const ipfw_insn } static void -print_limit(struct buf_pr *bp, const ipfw_insn_limit *limit) +print_limit_mask(struct buf_pr *bp, const ipfw_insn_limit *limit) { struct _s_x *p = limit_masks; char const *comma = " "; uint8_t x; - bprintf(bp, " limit"); for (x = limit->limit_mask; p->x != 0; p++) { if ((x & p->x) == p->x) { x &= ~p->x; @@ -1455,6 +1459,7 @@ print_instruction(struct buf_pr *bp, const struct form bprintf(bp, "prob %f ", d); break; case O_PROBE_STATE: /* no need to print anything here */ + state->flags |= HAVE_PROBE_STATE; break; case O_IP_SRC: case O_IP_SRC_LOOKUP: @@ -1661,13 +1666,20 @@ print_instruction(struct buf_pr *bp, const struct form bprintf(bp, " // %s", (char *)(cmd + 1)); break; case O_KEEP_STATE: - bprintf(bp, " keep-state"); + if (state->flags & HAVE_PROBE_STATE) + bprintf(bp, " keep-state"); + else + bprintf(bp, " record-state"); bprintf(bp, " :%s", object_search_ctlv(fo->tstate, cmd->arg1, IPFW_TLV_STATE_NAME)); break; case O_LIMIT: - print_limit(bp, insntod(cmd, limit)); + if (state->flags & HAVE_PROBE_STATE) + bprintf(bp, " limit"); + else + bprintf(bp, " set-limit"); + print_limit_mask(bp, insntod(cmd, limit)); bprintf(bp, " :%s", object_search_ctlv(fo->tstate, cmd->arg1, IPFW_TLV_STATE_NAME)); @@ -1691,6 +1703,9 @@ print_instruction(struct buf_pr *bp, const struct form print_newports(bp, insntod(cmd, u16), 0, O_TAGGED); break; + case O_SKIP_ACTION: + bprintf(bp, " defer-immediate-action"); + break; default: bprintf(bp, " [opcode %d len %d]", cmd->opcode, cmd->len); @@ -3706,8 +3721,10 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize /* * various flags used to record that we entered some fields. */ - ipfw_insn *have_state = NULL; /* check-state or keep-state */ + ipfw_insn *have_state = NULL; /* any state-related option */ + int have_rstate = 0; ipfw_insn *have_log = NULL, *have_altq = NULL, *have_tag = NULL; + ipfw_insn *have_skipcmd = NULL; size_t len; int i; @@ -4647,15 +4664,16 @@ read_options: av++; break; - case TOK_KEEPSTATE: { + case TOK_KEEPSTATE: + case TOK_RECORDSTATE: { uint16_t uidx; if (open_par) - errx(EX_USAGE, "keep-state cannot be part " + errx(EX_USAGE, "keep-state or record-state cannot be part " "of an or block"); if (have_state) - errx(EX_USAGE, "only one of keep-state " - "and limit is allowed"); + errx(EX_USAGE, "only one of keep-state, record-state, " + " limit and set-limit is allowed"); if (*av != NULL && *av[0] == ':') { if (state_check_name(*av + 1) != 0) errx(EX_DATAERR, @@ -4667,21 +4685,24 @@ read_options: uidx = pack_object(tstate, default_state_name, IPFW_TLV_STATE_NAME); have_state = cmd; + have_rstate = i == TOK_RECORDSTATE; fill_cmd(cmd, O_KEEP_STATE, 0, uidx); break; } - case TOK_LIMIT: { + case TOK_LIMIT: + case TOK_SETLIMIT: { ipfw_insn_limit *c = (ipfw_insn_limit *)cmd; int val; if (open_par) errx(EX_USAGE, - "limit cannot be part of an or block"); + "limit or set-limit cannot be part of an or block"); if (have_state) - errx(EX_USAGE, "only one of keep-state and " - "limit is allowed"); + errx(EX_USAGE, "only one of keep-state, record-state, " + " limit and set-limit is allowed"); have_state = cmd; + have_rstate = i == TOK_SETLIMIT; cmd->len = F_INSN_SIZE(ipfw_insn_limit); CHECK_CMDLEN; @@ -4884,6 +4905,14 @@ read_options: av++; break; + case TOK_SKIPACTION: + if (have_skipcmd) + errx(EX_USAGE, "only one defer-action " + "is allowed"); + have_skipcmd = cmd; + fill_cmd(cmd, O_SKIP_ACTION, 0, 0); + break; + default: errx(EX_USAGE, "unrecognised option [%d] %s\n", i, s); } @@ -4894,6 +4923,11 @@ read_options: } done: + + if (!have_state && have_skipcmd) + warnx("Rule contains \"defer-immediate-action\" " + "and doesn't contain any state-related options."); + /* * Now copy stuff into the rule. * If we have a keep-state option, the first instruction @@ -4916,12 +4950,15 @@ done: /* * generate O_PROBE_STATE if necessary */ - if (have_state && have_state->opcode != O_CHECK_STATE) { + if (have_state && have_state->opcode != O_CHECK_STATE && !have_rstate) { fill_cmd(dst, O_PROBE_STATE, 0, have_state->arg1); dst = next_cmd(dst, &rblen); } - /* copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG */ + /* + * copy all commands but O_LOG, O_KEEP_STATE, O_LIMIT, O_ALTQ, O_TAG, + * O_SKIP_ACTION + */ for (src = (ipfw_insn *)cmdbuf; src != cmd; src += i) { i = F_LEN(src); CHECK_RBUFLEN(i); @@ -4932,6 +4969,7 @@ done: case O_LIMIT: case O_ALTQ: case O_TAG: + case O_SKIP_ACTION: break; default: bcopy(src, dst, i * sizeof(uint32_t)); @@ -4948,6 +4986,17 @@ done: bcopy(have_state, dst, i * sizeof(uint32_t)); dst += i; } + + /* + * put back the have_skipcmd command as very last opcode + */ + if (have_skipcmd) { + i = F_LEN(have_skipcmd); + CHECK_RBUFLEN(i); + bcopy(have_skipcmd, dst, i * sizeof(uint32_t)); + dst += i; + } + /* * start action section */ Modified: stable/11/sbin/ipfw/ipfw2.h ============================================================================== --- stable/11/sbin/ipfw/ipfw2.h Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sbin/ipfw/ipfw2.h Wed Aug 8 16:11:46 2018 (r337461) @@ -124,7 +124,9 @@ enum tokens { TOK_JAIL, TOK_IN, TOK_LIMIT, + TOK_SETLIMIT, TOK_KEEPSTATE, + TOK_RECORDSTATE, TOK_LAYER2, TOK_OUT, TOK_DIVERTED, @@ -294,6 +296,8 @@ enum tokens { TOK_PREFIXLEN, TOK_TCPSETMSS, + + TOK_SKIPACTION, }; /* Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sys/netinet/ip_fw.h Wed Aug 8 16:11:46 2018 (r337461) @@ -283,6 +283,8 @@ enum ipfw_opcodes { /* arguments (4 byte each) */ O_EXTERNAL_INSTANCE, /* arg1=id of eaction handler instance */ O_EXTERNAL_DATA, /* variable length data */ + O_SKIP_ACTION, /* none */ + O_LAST_OPCODE /* not an opcode! */ }; Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Aug 8 16:11:46 2018 (r337461) @@ -2582,7 +2582,9 @@ do { \ * * O_LIMIT and O_KEEP_STATE: these opcodes are * not real 'actions', and are stored right - * before the 'action' part of the rule. + * before the 'action' part of the rule (one + * exception is O_SKIP_ACTION which could be + * between these opcodes and 'action' one). * These opcodes try to install an entry in the * state tables; if successful, we continue with * the next opcode (match=1; break;), otherwise @@ -2599,6 +2601,16 @@ do { \ * further instances of these opcodes become NOPs. * The jump to the next rule is done by setting * l=0, cmdlen=0. + * + * O_SKIP_ACTION: this opcode is not a real 'action' + * either, and is stored right before the 'action' + * part of the rule, right after the O_KEEP_STATE + * opcode. It causes match failure so the real + * 'action' could be executed only if the rule + * is checked via dynamic rule from the state + * table, as in such case execution starts + * from the true 'action' opcode directly. + * */ case O_LIMIT: case O_KEEP_STATE: @@ -2649,6 +2661,11 @@ do { \ if (cmd->opcode == O_CHECK_STATE) l = 0; /* exit inner loop */ match = 1; + break; + + case O_SKIP_ACTION: + match = 0; /* skip to the next rule */ + l = 0; /* exit inner loop */ break; case O_ACCEPT: Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Aug 8 16:09:28 2018 (r337460) +++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Aug 8 16:11:46 2018 (r337461) @@ -1746,6 +1746,7 @@ check_ipfw_rule_body(ipfw_insn *cmd, int cmd_len, stru #endif case O_IP4: case O_TAG: + case O_SKIP_ACTION: if (cmdlen != F_INSN_SIZE(ipfw_insn)) goto bad_size; break; From owner-svn-src-all@freebsd.org Wed Aug 8 16:17:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 164A21060D81; Wed, 8 Aug 2018 16:17:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFEB084449; Wed, 8 Aug 2018 16:17:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A096E4F61; Wed, 8 Aug 2018 16:17:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78GHplp061375; Wed, 8 Aug 2018 16:17:51 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78GHoch061371; Wed, 8 Aug 2018 16:17:50 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808081617.w78GHoch061371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 16:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337462 - in stable/11/sys: net netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/11/sys: net netinet netinet6 X-SVN-Commit-Revision: 337462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:17:52 -0000 Author: ae Date: Wed Aug 8 16:17:50 2018 New Revision: 337462 URL: https://svnweb.freebsd.org/changeset/base/337462 Log: MFC r331098 (by melifaro): Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration. Current arp/nd code relies on the feedback from the datapath indicating that the entry is still used. This mechanism is incorporated into the arpresolve()/nd6_resolve() routines. After the inpcb route cache introduction, the packet path for the locally-originated packets changed, passing cached lle pointer to the ether_output() directly. This resulted in the arp/ndp entry expire each time exactly after the configured max_age interval. During the small window between the ARP/NDP request and reply from the router, most of the packets got lost. Fix this behaviour by plugging datapath notification code to the packet path used by route cache. Unify the notification code by using single inlined function with the per-AF callbacks. Modified: stable/11/sys/net/if_ethersubr.c stable/11/sys/net/if_llatbl.h stable/11/sys/netinet/if_ether.c stable/11/sys/netinet/in.c stable/11/sys/netinet6/in6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_ethersubr.c ============================================================================== --- stable/11/sys/net/if_ethersubr.c Wed Aug 8 16:11:46 2018 (r337461) +++ stable/11/sys/net/if_ethersubr.c Wed Aug 8 16:17:50 2018 (r337462) @@ -313,7 +313,13 @@ ether_output(struct ifnet *ifp, struct mbuf *m, if (lle == NULL) { /* if we lookup, keep cache */ addref = 1; - } + } else + /* + * Notify LLE code that + * the entry was used + * by datapath. + */ + llentry_mark_used(lle); } if (lle != NULL) { phdr = lle->r_linkdata; Modified: stable/11/sys/net/if_llatbl.h ============================================================================== --- stable/11/sys/net/if_llatbl.h Wed Aug 8 16:11:46 2018 (r337461) +++ stable/11/sys/net/if_llatbl.h Wed Aug 8 16:17:50 2018 (r337462) @@ -155,6 +155,7 @@ typedef void (llt_fill_sa_entry_t)(const struct llentr typedef void (llt_free_tbl_t)(struct lltable *); typedef void (llt_link_entry_t)(struct lltable *, struct llentry *); typedef void (llt_unlink_entry_t)(struct llentry *); +typedef void (llt_mark_used_t)(struct llentry *); typedef int (llt_foreach_cb_t)(struct lltable *, struct llentry *, void *); typedef int (llt_foreach_entry_t)(struct lltable *, llt_foreach_cb_t *, void *); @@ -179,6 +180,7 @@ struct lltable { llt_unlink_entry_t *llt_unlink_entry; llt_fill_sa_entry_t *llt_fill_sa_entry; llt_free_tbl_t *llt_free_tbl; + llt_mark_used_t *llt_mark_used; }; MALLOC_DECLARE(M_LLTABLE); @@ -251,6 +253,19 @@ lla_lookup(struct lltable *llt, u_int flags, const str { return (llt->llt_lookup(llt, flags, l3addr)); +} + +/* + * Notify the LLE code that the entry was used by datapath. + */ +static __inline void +llentry_mark_used(struct llentry *lle) +{ + + if (lle->r_skip_req == 0) + return; + if ((lle->r_flags & RLLE_VALID) != 0) + lle->lle_tbl->llt_mark_used(lle); } int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); Modified: stable/11/sys/netinet/if_ether.c ============================================================================== --- stable/11/sys/netinet/if_ether.c Wed Aug 8 16:11:46 2018 (r337461) +++ stable/11/sys/netinet/if_ether.c Wed Aug 8 16:17:50 2018 (r337462) @@ -502,12 +502,8 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag } bcopy(lladdr, desten, ll_len); - /* Check if we have feedback request from arptimer() */ - if (la->r_skip_req != 0) { - LLE_REQ_LOCK(la); - la->r_skip_req = 0; /* Notify that entry was used */ - LLE_REQ_UNLOCK(la); - } + /* Notify LLE code that the entry was used by datapath */ + llentry_mark_used(la); if (pflags != NULL) *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); if (plle) { @@ -638,12 +634,8 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf * bcopy(la->r_linkdata, desten, la->r_hdrlen); if (pflags != NULL) *pflags = LLE_VALID | (la->r_flags & RLLE_IFADDR); - /* Check if we have feedback request from arptimer() */ - if (la->r_skip_req != 0) { - LLE_REQ_LOCK(la); - la->r_skip_req = 0; /* Notify that entry was used */ - LLE_REQ_UNLOCK(la); - } + /* Notify the LLE handling code that the entry was used. */ + llentry_mark_used(la); if (plle) { LLE_ADDREF(la); *plle = la; Modified: stable/11/sys/netinet/in.c ============================================================================== --- stable/11/sys/netinet/in.c Wed Aug 8 16:11:46 2018 (r337461) +++ stable/11/sys/netinet/in.c Wed Aug 8 16:17:50 2018 (r337462) @@ -1056,6 +1056,19 @@ in_lltable_destroy_lle_unlocked(struct llentry *lle) } /* + * Called by the datapath to indicate that + * the entry was used. + */ +static void +in_lltable_mark_used(struct llentry *lle) +{ + + LLE_REQ_LOCK(lle); + lle->r_skip_req = 0; + LLE_REQ_UNLOCK(lle); +} + +/* * Called by LLE_FREE_LOCKED when number of references * drops to zero. */ @@ -1454,6 +1467,7 @@ in_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in_lltable_fill_sa_entry; llt->llt_free_entry = in_lltable_free_entry; llt->llt_match_prefix = in_lltable_match_prefix; + llt->llt_mark_used = in_lltable_mark_used; lltable_link(llt); return (llt); Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Wed Aug 8 16:11:46 2018 (r337461) +++ stable/11/sys/netinet6/in6.c Wed Aug 8 16:17:50 2018 (r337462) @@ -2145,6 +2145,25 @@ in6_lltable_rtcheck(struct ifnet *ifp, return 0; } +/* + * Called by the datapath to indicate that the entry was used. + */ +static void +in6_lltable_mark_used(struct llentry *lle) +{ + + LLE_REQ_LOCK(lle); + lle->r_skip_req = 0; + + /* + * Set the hit time so the callback function + * can determine the remaining time before + * transiting to the DELAY state. + */ + lle->lle_hittime = time_uptime; + LLE_REQ_UNLOCK(lle); +} + static inline uint32_t in6_lltable_hash_dst(const struct in6_addr *dst, uint32_t hsize) { @@ -2377,6 +2396,7 @@ in6_lltattach(struct ifnet *ifp) llt->llt_fill_sa_entry = in6_lltable_fill_sa_entry; llt->llt_free_entry = in6_lltable_free_entry; llt->llt_match_prefix = in6_lltable_match_prefix; + llt->llt_mark_used = in6_lltable_mark_used; lltable_link(llt); return (llt); From owner-svn-src-all@freebsd.org Wed Aug 8 16:40:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4AC81061CE2; Wed, 8 Aug 2018 16:40:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 27DBC853C9; Wed, 8 Aug 2018 16:40:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w78GegxI012856; Wed, 8 Aug 2018 09:40:43 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w78Gegho012855; Wed, 8 Aug 2018 09:40:42 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808081640.w78Gegho012855@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337462 - in stable/11/sys: net netinet netinet6 In-Reply-To: <201808081617.w78GHoch061371@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 09:40:42 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:40:54 -0000 > Author: ae > Date: Wed Aug 8 16:17:50 2018 > New Revision: 337462 > URL: https://svnweb.freebsd.org/changeset/base/337462 > > Log: > MFC r331098 (by melifaro): > Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration. > > Current arp/nd code relies on the feedback from the datapath indicating > that the entry is still used. This mechanism is incorporated into the > arpresolve()/nd6_resolve() routines. After the inpcb route cache > introduction, the packet path for the locally-originated packets changed, > passing cached lle pointer to the ether_output() directly. This resulted > in the arp/ndp entry expire each time exactly after the configured max_age > interval. During the small window between the ARP/NDP request and reply > from the router, most of the packets got lost. > > Fix this behaviour by plugging datapath notification code to the packet > path used by route cache. Unify the notification code by using single > inlined function with the per-AF callbacks. Is this worthy of an EN for 11.2? This is a rather annoying problem for some people. > Modified: > stable/11/sys/net/if_ethersubr.c > stable/11/sys/net/if_llatbl.h > stable/11/sys/netinet/if_ether.c > stable/11/sys/netinet/in.c > stable/11/sys/netinet6/in6.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/net/if_ethersubr.c > ============================================================================== > --- stable/11/sys/net/if_ethersubr.c Wed Aug 8 16:11:46 2018 (r337461) > +++ stable/11/sys/net/if_ethersubr.c Wed Aug 8 16:17:50 2018 (r337462) > @@ -313,7 +313,13 @@ ether_output(struct ifnet *ifp, struct mbuf *m, > if (lle == NULL) { > /* if we lookup, keep cache */ > addref = 1; > - } > + } else > + /* > + * Notify LLE code that > + * the entry was used > + * by datapath. > + */ > + llentry_mark_used(lle); > } > if (lle != NULL) { > phdr = lle->r_linkdata; > > Modified: stable/11/sys/net/if_llatbl.h > ============================================================================== > --- stable/11/sys/net/if_llatbl.h Wed Aug 8 16:11:46 2018 (r337461) > +++ stable/11/sys/net/if_llatbl.h Wed Aug 8 16:17:50 2018 (r337462) > @@ -155,6 +155,7 @@ typedef void (llt_fill_sa_entry_t)(const struct llentr > typedef void (llt_free_tbl_t)(struct lltable *); > typedef void (llt_link_entry_t)(struct lltable *, struct llentry *); > typedef void (llt_unlink_entry_t)(struct llentry *); > +typedef void (llt_mark_used_t)(struct llentry *); > > typedef int (llt_foreach_cb_t)(struct lltable *, struct llentry *, void *); > typedef int (llt_foreach_entry_t)(struct lltable *, llt_foreach_cb_t *, void *); > @@ -179,6 +180,7 @@ struct lltable { > llt_unlink_entry_t *llt_unlink_entry; > llt_fill_sa_entry_t *llt_fill_sa_entry; > llt_free_tbl_t *llt_free_tbl; > + llt_mark_used_t *llt_mark_used; > }; > > MALLOC_DECLARE(M_LLTABLE); > @@ -251,6 +253,19 @@ lla_lookup(struct lltable *llt, u_int flags, const str > { > > return (llt->llt_lookup(llt, flags, l3addr)); > +} > + > +/* > + * Notify the LLE code that the entry was used by datapath. > + */ > +static __inline void > +llentry_mark_used(struct llentry *lle) > +{ > + > + if (lle->r_skip_req == 0) > + return; > + if ((lle->r_flags & RLLE_VALID) != 0) > + lle->lle_tbl->llt_mark_used(lle); > } > > int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); > > Modified: stable/11/sys/netinet/if_ether.c > ============================================================================== > --- stable/11/sys/netinet/if_ether.c Wed Aug 8 16:11:46 2018 (r337461) > +++ stable/11/sys/netinet/if_ether.c Wed Aug 8 16:17:50 2018 (r337462) > @@ -502,12 +502,8 @@ arpresolve_full(struct ifnet *ifp, int is_gw, int flag > } > bcopy(lladdr, desten, ll_len); > > - /* Check if we have feedback request from arptimer() */ > - if (la->r_skip_req != 0) { > - LLE_REQ_LOCK(la); > - la->r_skip_req = 0; /* Notify that entry was used */ > - LLE_REQ_UNLOCK(la); > - } > + /* Notify LLE code that the entry was used by datapath */ > + llentry_mark_used(la); > if (pflags != NULL) > *pflags = la->la_flags & (LLE_VALID|LLE_IFADDR); > if (plle) { > @@ -638,12 +634,8 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf * > bcopy(la->r_linkdata, desten, la->r_hdrlen); > if (pflags != NULL) > *pflags = LLE_VALID | (la->r_flags & RLLE_IFADDR); > - /* Check if we have feedback request from arptimer() */ > - if (la->r_skip_req != 0) { > - LLE_REQ_LOCK(la); > - la->r_skip_req = 0; /* Notify that entry was used */ > - LLE_REQ_UNLOCK(la); > - } > + /* Notify the LLE handling code that the entry was used. */ > + llentry_mark_used(la); > if (plle) { > LLE_ADDREF(la); > *plle = la; > > Modified: stable/11/sys/netinet/in.c > ============================================================================== > --- stable/11/sys/netinet/in.c Wed Aug 8 16:11:46 2018 (r337461) > +++ stable/11/sys/netinet/in.c Wed Aug 8 16:17:50 2018 (r337462) > @@ -1056,6 +1056,19 @@ in_lltable_destroy_lle_unlocked(struct llentry *lle) > } > > /* > + * Called by the datapath to indicate that > + * the entry was used. > + */ > +static void > +in_lltable_mark_used(struct llentry *lle) > +{ > + > + LLE_REQ_LOCK(lle); > + lle->r_skip_req = 0; > + LLE_REQ_UNLOCK(lle); > +} > + > +/* > * Called by LLE_FREE_LOCKED when number of references > * drops to zero. > */ > @@ -1454,6 +1467,7 @@ in_lltattach(struct ifnet *ifp) > llt->llt_fill_sa_entry = in_lltable_fill_sa_entry; > llt->llt_free_entry = in_lltable_free_entry; > llt->llt_match_prefix = in_lltable_match_prefix; > + llt->llt_mark_used = in_lltable_mark_used; > lltable_link(llt); > > return (llt); > > Modified: stable/11/sys/netinet6/in6.c > ============================================================================== > --- stable/11/sys/netinet6/in6.c Wed Aug 8 16:11:46 2018 (r337461) > +++ stable/11/sys/netinet6/in6.c Wed Aug 8 16:17:50 2018 (r337462) > @@ -2145,6 +2145,25 @@ in6_lltable_rtcheck(struct ifnet *ifp, > return 0; > } > > +/* > + * Called by the datapath to indicate that the entry was used. > + */ > +static void > +in6_lltable_mark_used(struct llentry *lle) > +{ > + > + LLE_REQ_LOCK(lle); > + lle->r_skip_req = 0; > + > + /* > + * Set the hit time so the callback function > + * can determine the remaining time before > + * transiting to the DELAY state. > + */ > + lle->lle_hittime = time_uptime; > + LLE_REQ_UNLOCK(lle); > +} > + > static inline uint32_t > in6_lltable_hash_dst(const struct in6_addr *dst, uint32_t hsize) > { > @@ -2377,6 +2396,7 @@ in6_lltattach(struct ifnet *ifp) > llt->llt_fill_sa_entry = in6_lltable_fill_sa_entry; > llt->llt_free_entry = in6_lltable_free_entry; > llt->llt_match_prefix = in6_lltable_match_prefix; > + llt->llt_mark_used = in6_lltable_mark_used; > lltable_link(llt); > > return (llt); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 8 16:55:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 224251062492; Wed, 8 Aug 2018 16:55:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C493F85EF3; Wed, 8 Aug 2018 16:55:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AD6955CB; Wed, 8 Aug 2018 16:55:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Gt2K5081454; Wed, 8 Aug 2018 16:55:02 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Gt2vC081451; Wed, 8 Aug 2018 16:55:02 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201808081655.w78Gt2vC081451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 8 Aug 2018 16:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337463 - in head/sys: arm/arm arm/include vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: arm/arm arm/include vm X-SVN-Commit-Revision: 337463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 16:55:03 -0000 Author: alc Date: Wed Aug 8 16:55:01 2018 New Revision: 337463 URL: https://svnweb.freebsd.org/changeset/base/337463 Log: Add support for pmap_enter(..., psind=1) to the armv6 pmap. In other words, add support for explicitly requesting that pmap_enter() create a 1 MB page mapping. (Essentially, this feature allows the machine-independent layer to create superpage mappings preemptively, and not wait for automatic promotion to occur.) Export pmap_ps_enabled() to the machine-independent layer. Add a flag to pmap_pv_insert_pte1() that specifies whether it should fail or reclaim a PV entry when one is not available. Refactor pmap_enter_pte1() into two functions, one by the same name, that is a general-purpose function for creating pte1 mappings, and another, pmap_enter_1mpage(), that is used to prefault 1 MB read- and/or execute- only mappings for execve(2), mmap(2), and shmat(2). In addition, as an optimization to pmap_enter(..., psind=0), eliminate the use of pte2_is_managed() from pmap_enter(). Unlike the x86 pmap implementations, armv6 does not have a managed bit defined within the PTE. So, pte2_is_managed() is actually a call to PHYS_TO_VM_PAGE(), which is O(n) in the number of vm_phys_segs[]. All but one call to PHYS_TO_VM_PAGE() in pmap_enter() can be avoided. Reviewed by: kib, markj, mmel Tested by: mmel MFC after: 6 weeks Differential Revision: https://reviews.freebsd.org/D16555 Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap-v6.h head/sys/vm/vm_fault.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/arm/arm/pmap-v6.c Wed Aug 8 16:55:01 2018 (r337463) @@ -323,9 +323,17 @@ SYSCTL_INT(_debug, OID_AUTO, PMAP1unchanged, CTLFLAG_R "Number of times pmap_pte2_quick didn't change PMAP1"); static struct mtx PMAP2mutex; +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + static __inline void pt2_wirecount_init(vm_page_t m); static boolean_t pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va); +static int pmap_enter_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, + u_int flags, vm_page_t m); void cache_icache_sync_fresh(vm_offset_t va, vm_paddr_t pa, vm_size_t size); /* @@ -1557,6 +1565,13 @@ static int sp_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, sp_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &sp_enabled, 0, "Are large page mappings enabled?"); +bool +pmap_ps_enabled(pmap_t pmap __unused) +{ + + return (sp_enabled != 0); +} + static SYSCTL_NODE(_vm_pmap, OID_AUTO, pte1, CTLFLAG_RD, 0, "1MB page mapping counters"); @@ -3227,21 +3242,22 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, /* * Create the pv entries for each of the pages within a section. */ -static boolean_t -pmap_pv_insert_pte1(pmap_t pmap, vm_offset_t va, vm_paddr_t pa) +static bool +pmap_pv_insert_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, u_int flags) { struct md_page *pvh; pv_entry_t pv; + bool noreclaim; rw_assert(&pvh_global_lock, RA_WLOCKED); - if (pv_entry_count < pv_entry_high_water && - (pv = get_pv_entry(pmap, TRUE)) != NULL) { - pv->pv_va = va; - pvh = pa_to_pvh(pa); - TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); - return (TRUE); - } else - return (FALSE); + noreclaim = (flags & PMAP_ENTER_NORECLAIM) != 0; + if ((noreclaim && pv_entry_count >= pv_entry_high_water) || + (pv = get_pv_entry(pmap, noreclaim)) == NULL) + return (false); + pv->pv_va = va; + pvh = pa_to_pvh(pte1_pa(pte1)); + TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); + return (true); } static inline void @@ -3879,7 +3895,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if ((prot & VM_PROT_WRITE) == 0) npte2 |= PTE2_RO; KASSERT((npte2 & (PTE2_NM | PTE2_RO)) != PTE2_RO, - ("pmap_enter: flags includes VM_PROT_WRITE but prot doesn't")); + ("%s: flags includes VM_PROT_WRITE but prot doesn't", __func__)); if ((prot & VM_PROT_EXECUTE) == 0) npte2 |= PTE2_NX; if ((flags & PMAP_ENTER_WIRED) != 0) @@ -3892,6 +3908,15 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); sched_pin(); + if (psind == 1) { + /* Assert the required virtual and physical alignment. */ + KASSERT((va & PTE1_OFFSET) == 0, + ("%s: va unaligned", __func__)); + KASSERT(m->psind > 0, ("%s: m->psind < psind", __func__)); + rv = pmap_enter_pte1(pmap, va, PTE1_PA(pa) | ATTR_TO_L1(npte2) | + PTE1_V, flags, m); + goto out; + } /* * In the case that a page table page is not @@ -3937,7 +3962,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v */ if (mpte2) pt2_wirecount_dec(mpte2, pte1_index(va)); - if (pte2_is_managed(opte2)) + if ((m->oflags & VPO_UNMANAGED) == 0) om = m; goto validate; } @@ -3962,10 +3987,12 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if (opa) { if (pte2_is_wired(opte2)) pmap->pm_stats.wired_count--; - if (pte2_is_managed(opte2)) { - om = PHYS_TO_VM_PAGE(opa); + om = PHYS_TO_VM_PAGE(opa); + if (om != NULL && (om->oflags & VPO_UNMANAGED) != 0) + om = NULL; + if (om != NULL) pv = pmap_pvh_remove(&om->md, pmap, va); - } + /* * Remove extra pte2 reference */ @@ -3997,7 +4024,7 @@ validate: * Now validate mapping with desired protection/wiring. */ if (prot & VM_PROT_WRITE) { - if (pte2_is_managed(npte2)) + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_WRITEABLE); } @@ -4034,19 +4061,18 @@ validate: opte2 = pte2_load_clear(pte2p); pmap_tlb_flush(pmap, va); pte2_store(pte2p, npte2); - if (opte2 & PTE2_A) { - if (pte2_is_managed(opte2)) + if (om != NULL) { + KASSERT((om->oflags & VPO_UNMANAGED) == 0, + ("%s: om %p unmanaged", __func__, om)); + if ((opte2 & PTE2_A) != 0) vm_page_aflag_set(om, PGA_REFERENCED); - } - if (pte2_is_dirty(opte2)) { - if (pte2_is_managed(opte2)) + if (pte2_is_dirty(opte2)) vm_page_dirty(om); + if (TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + vm_page_aflag_clear(om, PGA_WRITEABLE); } - if (pte2_is_managed(opte2) && - TAILQ_EMPTY(&om->md.pv_list) && - ((om->flags & PG_FICTITIOUS) != 0 || - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) - vm_page_aflag_clear(om, PGA_WRITEABLE); } else pte2_store(pte2p, npte2); } @@ -4652,66 +4678,124 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_ } /* - * Tries to create 1MB page mapping. Returns TRUE if successful and - * FALSE otherwise. Fails if (1) a page table page cannot be allocated without - * blocking, (2) a mapping already exists at the specified virtual address, or - * (3) a pv entry cannot be allocated without reclaiming another pv entry. + * Tries to create a read- and/or execute-only 1 MB page mapping. Returns + * true if successful. Returns false if (1) a mapping already exists at the + * specified virtual address or (2) a PV entry cannot be allocated without + * reclaiming another PV entry. */ -static boolean_t -pmap_enter_pte1(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) +static bool +pmap_enter_1mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot) { - pt1_entry_t *pte1p; + pt1_entry_t pte1; vm_paddr_t pa; - uint32_t l1prot; + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + pa = VM_PAGE_TO_PHYS(m); + pte1 = PTE1(pa, PTE1_NM | PTE1_RO, ATTR_TO_L1(vm_page_pte2_attr(m))); + if ((prot & VM_PROT_EXECUTE) == 0) + pte1 |= PTE1_NX; + if (va < VM_MAXUSER_ADDRESS) + pte1 |= PTE1_U; + if (pmap != kernel_pmap) + pte1 |= PTE1_NG; + return (pmap_enter_pte1(pmap, va, pte1, PMAP_ENTER_NOSLEEP | + PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, m) == KERN_SUCCESS); +} + +/* + * Tries to create the specified 1 MB page mapping. Returns KERN_SUCCESS if + * the mapping was created, and either KERN_FAILURE or KERN_RESOURCE_SHORTAGE + * otherwise. Returns KERN_FAILURE if PMAP_ENTER_NOREPLACE was specified and + * a mapping already exists at the specified virtual address. Returns + * KERN_RESOURCE_SHORTAGE if PMAP_ENTER_NORECLAIM was specified and PV entry + * allocation failed. + */ +static int +pmap_enter_pte1(pmap_t pmap, vm_offset_t va, pt1_entry_t pte1, u_int flags, + vm_page_t m) +{ + struct spglist free; + pt1_entry_t opte1, *pte1p; + pt2_entry_t pte2, *pte2p; + vm_offset_t cur, end; + vm_page_t mt; + rw_assert(&pvh_global_lock, RA_WLOCKED); + KASSERT((pte1 & (PTE1_NM | PTE1_RO)) == 0 || + (pte1 & (PTE1_NM | PTE1_RO)) == (PTE1_NM | PTE1_RO), + ("%s: pte1 has inconsistent NM and RO attributes", __func__)); PMAP_LOCK_ASSERT(pmap, MA_OWNED); pte1p = pmap_pte1(pmap, va); - if (pte1_is_valid(pte1_load(pte1p))) { - CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", __func__, - va, pmap); - return (FALSE); + opte1 = pte1_load(pte1p); + if (pte1_is_valid(opte1)) { + if ((flags & PMAP_ENTER_NOREPLACE) != 0) { + CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", + __func__, va, pmap); + return (KERN_FAILURE); + } + /* Break the existing mapping(s). */ + SLIST_INIT(&free); + if (pte1_is_section(opte1)) { + /* + * If the section resulted from a promotion, then a + * reserved PT page could be freed. + */ + pmap_remove_pte1(pmap, pte1p, va, &free); + } else { + sched_pin(); + end = va + PTE1_SIZE; + for (cur = va, pte2p = pmap_pte2_quick(pmap, va); + cur != end; cur += PAGE_SIZE, pte2p++) { + pte2 = pte2_load(pte2p); + if (!pte2_is_valid(pte2)) + continue; + if (pmap_remove_pte2(pmap, pte2p, cur, &free)) + break; + } + sched_unpin(); + } + vm_page_free_pages_toq(&free, false); } if ((m->oflags & VPO_UNMANAGED) == 0) { /* * Abort this mapping if its PV entry could not be created. */ - if (!pmap_pv_insert_pte1(pmap, va, VM_PAGE_TO_PHYS(m))) { + if (!pmap_pv_insert_pte1(pmap, va, pte1, flags)) { CTR3(KTR_PMAP, "%s: failure for va %#lx in pmap %p", __func__, va, pmap); - return (FALSE); + return (KERN_RESOURCE_SHORTAGE); } + if ((pte1 & PTE1_RO) == 0) { + for (mt = m; mt < &m[PTE1_SIZE / PAGE_SIZE]; mt++) + vm_page_aflag_set(mt, PGA_WRITEABLE); + } } + /* * Increment counters. */ + if (pte1_is_wired(pte1)) + pmap->pm_stats.wired_count += PTE1_SIZE / PAGE_SIZE; pmap->pm_stats.resident_count += PTE1_SIZE / PAGE_SIZE; /* + * Sync icache if exec permission and attribute VM_MEMATTR_WB_WA + * is set. QQQ: For more info, see comments in pmap_enter(). + */ + if ((pte1 & PTE1_NX) == 0 && m->md.pat_mode == VM_MEMATTR_WB_WA && + pmap != kernel_pmap && (!pte1_is_section(opte1) || + pte1_pa(opte1) != VM_PAGE_TO_PHYS(m) || (opte1 & PTE2_NX) != 0)) + cache_icache_sync_fresh(va, VM_PAGE_TO_PHYS(m), PTE1_SIZE); + + /* * Map the section. - * - * QQQ: Why VM_PROT_WRITE is not evaluated and the mapping is - * made readonly? */ - pa = VM_PAGE_TO_PHYS(m); - l1prot = PTE1_RO | PTE1_NM; - if (va < VM_MAXUSER_ADDRESS) - l1prot |= PTE1_U | PTE1_NG; - if ((prot & VM_PROT_EXECUTE) == 0) - l1prot |= PTE1_NX; - else if (m->md.pat_mode == VM_MEMATTR_WB_WA && pmap != kernel_pmap) { - /* - * Sync icache if exec permission and attribute VM_MEMATTR_WB_WA - * is set. QQQ: For more info, see comments in pmap_enter(). - */ - cache_icache_sync_fresh(va, pa, PTE1_SIZE); - } - pte1_store(pte1p, PTE1(pa, l1prot, ATTR_TO_L1(vm_page_pte2_attr(m)))); + pte1_store(pte1p, pte1); pmap_pte1_mappings++; CTR3(KTR_PMAP, "%s: success for va %#lx in pmap %p", __func__, va, pmap); - return (TRUE); + return (KERN_SUCCESS); } /* @@ -4747,7 +4831,7 @@ pmap_enter_object(pmap_t pmap, vm_offset_t start, vm_o va = start + ptoa(diff); if ((va & PTE1_OFFSET) == 0 && va + PTE1_SIZE <= end && m->psind == 1 && sp_enabled && - pmap_enter_pte1(pmap, va, m, prot)) + pmap_enter_1mpage(pmap, va, m, prot)) m = &m[PTE1_SIZE / PAGE_SIZE - 1]; else mpt2pg = pmap_enter_quick_locked(pmap, va, m, prot, @@ -6020,8 +6104,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ continue; if (dst_pmap->pm_pt1[pte1_idx] == 0 && (!pte1_is_managed(src_pte1) || - pmap_pv_insert_pte1(dst_pmap, addr, - pte1_pa(src_pte1)))) { + pmap_pv_insert_pte1(dst_pmap, addr, src_pte1, + PMAP_ENTER_NORECLAIM))) { dst_pmap->pm_pt1[pte1_idx] = src_pte1 & ~PTE1_W; dst_pmap->pm_stats.resident_count += Modified: head/sys/arm/include/pmap-v6.h ============================================================================== --- head/sys/arm/include/pmap-v6.h Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/arm/include/pmap-v6.h Wed Aug 8 16:55:01 2018 (r337463) @@ -167,6 +167,7 @@ void pmap_bootstrap(vm_offset_t); void pmap_kenter(vm_offset_t, vm_paddr_t); void pmap_kremove(vm_offset_t); boolean_t pmap_page_is_mapped(vm_page_t); +bool pmap_ps_enabled(pmap_t pmap); void pmap_tlb_flush(pmap_t, vm_offset_t); void pmap_tlb_flush_range(pmap_t, vm_offset_t, vm_size_t); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Aug 8 16:17:50 2018 (r337462) +++ head/sys/vm/vm_fault.c Wed Aug 8 16:55:01 2018 (r337463) @@ -270,8 +270,8 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) { vm_page_t m, m_map; -#if (defined(__amd64__) || defined(__i386__) || defined(__aarch64__)) && \ - VM_NRESERVLEVEL > 0 +#if (defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__)) && VM_NRESERVLEVEL > 0 vm_page_t m_super; int flags; #endif @@ -285,8 +285,8 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t return (KERN_FAILURE); m_map = m; psind = 0; -#if (defined(__amd64__) || defined(__i386__) || defined(__aarch64__)) && \ - VM_NRESERVLEVEL > 0 +#if (defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__)) && VM_NRESERVLEVEL > 0 if ((m->flags & PG_FICTITIOUS) == 0 && (m_super = vm_reserv_to_superpage(m)) != NULL && rounddown2(vaddr, pagesizes[m_super->psind]) >= fs->entry->start && @@ -462,7 +462,8 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro pidx <= pager_last; pidx += npages, m = vm_page_next(&m[npages - 1])) { vaddr = fs->entry->start + IDX_TO_OFF(pidx) - fs->entry->offset; -#if defined(__amd64__) || defined(__i386__) || defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ + __ARM_ARCH >= 6) || defined(__i386__) psind = m->psind; if (psind > 0 && ((vaddr & (pagesizes[psind] - 1)) != 0 || pidx + OFF_TO_IDX(pagesizes[psind]) - 1 > pager_last || From owner-svn-src-all@freebsd.org Wed Aug 8 17:10:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 893611062AB7; Wed, 8 Aug 2018 17:10:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40A618675F; Wed, 8 Aug 2018 17:10:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21DE65786; Wed, 8 Aug 2018 17:10:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HAWwE086951; Wed, 8 Aug 2018 17:10:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HAW4u086950; Wed, 8 Aug 2018 17:10:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081710.w78HAW4u086950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337464 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 337464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:10:33 -0000 Author: markj Date: Wed Aug 8 17:10:32 2018 New Revision: 337464 URL: https://svnweb.freebsd.org/changeset/base/337464 Log: MFC r337059: Fix some nits in the unix_passfd tests. Modified: stable/11/tests/sys/kern/unix_passfd_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/unix_passfd_test.c ============================================================================== --- stable/11/tests/sys/kern/unix_passfd_test.c Wed Aug 8 16:55:01 2018 (r337463) +++ stable/11/tests/sys/kern/unix_passfd_test.c Wed Aug 8 17:10:32 2018 (r337464) @@ -165,14 +165,15 @@ sendfd(int sockfd, int send_fd) { char ch = 0; - return (sendfd_payload(sockfd, send_fd, &ch, sizeof(ch))); + sendfd_payload(sockfd, send_fd, &ch, sizeof(ch)); } static void recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen) { struct cmsghdr *cmsghdr; - char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)]; + char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + + CMSG_SPACE(sizeof(int))]; struct msghdr msghdr; struct iovec iovec; ssize_t len; @@ -214,7 +215,7 @@ recvfd(int sockfd, int *recv_fd) { char ch = 0; - return (recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch))); + recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch)); } /* From owner-svn-src-all@freebsd.org Wed Aug 8 17:11:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD5161062B3D; Wed, 8 Aug 2018 17:11:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652D586903; Wed, 8 Aug 2018 17:11:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4704257B8; Wed, 8 Aug 2018 17:11:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HB8wY087952; Wed, 8 Aug 2018 17:11:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HB8oB087951; Wed, 8 Aug 2018 17:11:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081711.w78HB8oB087951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337465 - stable/11/sys/security/mac X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/security/mac X-SVN-Commit-Revision: 337465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:11:08 -0000 Author: markj Date: Wed Aug 8 17:11:07 2018 New Revision: 337465 URL: https://svnweb.freebsd.org/changeset/base/337465 Log: MFC r337031: Require that MAC label buffers be able to store a non-empty string. Modified: stable/11/sys/security/mac/mac_framework.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/security/mac/mac_framework.c ============================================================================== --- stable/11/sys/security/mac/mac_framework.c Wed Aug 8 17:10:32 2018 (r337464) +++ stable/11/sys/security/mac/mac_framework.c Wed Aug 8 17:11:07 2018 (r337465) @@ -586,7 +586,9 @@ int mac_check_structmac_consistent(struct mac *mac) { - if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN) + /* Require that labels have a non-zero length. */ + if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN || + mac->m_buflen <= sizeof("")) return (EINVAL); return (0); From owner-svn-src-all@freebsd.org Wed Aug 8 17:12:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40BA31062D62; Wed, 8 Aug 2018 17:12:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB50D86C80; Wed, 8 Aug 2018 17:12:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE04458F0; Wed, 8 Aug 2018 17:12:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HC6n0088786; Wed, 8 Aug 2018 17:12:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HC62C088785; Wed, 8 Aug 2018 17:12:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081712.w78HC62C088785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337466 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/arm64/arm64 X-SVN-Commit-Revision: 337466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:12:07 -0000 Author: markj Date: Wed Aug 8 17:12:06 2018 New Revision: 337466 URL: https://svnweb.freebsd.org/changeset/base/337466 Log: MFC r336714: Simplify the arm64 implementation of pmap_mincore(). Modified: stable/11/sys/arm64/arm64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/pmap.c ============================================================================== --- stable/11/sys/arm64/arm64/pmap.c Wed Aug 8 17:11:07 2018 (r337465) +++ stable/11/sys/arm64/arm64/pmap.c Wed Aug 8 17:12:06 2018 (r337466) @@ -4683,76 +4683,45 @@ pmap_demote_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - pd_entry_t *l1p, l1; - pd_entry_t *l2p, l2; - pt_entry_t *l3p, l3; - vm_paddr_t pa; + pt_entry_t *pte, tpte; + vm_paddr_t mask, pa; + int lvl, val; bool managed; - int val; PMAP_LOCK(pmap); retry: - pa = 0; val = 0; - managed = false; + pte = pmap_pte(pmap, addr, &lvl); + if (pte != NULL) { + tpte = pmap_load(pte); - l1p = pmap_l1(pmap, addr); - if (l1p == NULL) /* No l1 */ - goto done; + switch (lvl) { + case 3: + mask = L3_OFFSET; + break; + case 2: + mask = L2_OFFSET; + break; + case 1: + mask = L1_OFFSET; + break; + default: + panic("pmap_mincore: invalid level %d", lvl); + } - l1 = pmap_load(l1p); - if ((l1 & ATTR_DESCR_MASK) == L1_INVAL) - goto done; - - if ((l1 & ATTR_DESCR_MASK) == L1_BLOCK) { - pa = (l1 & ~ATTR_MASK) | (addr & L1_OFFSET); - managed = (l1 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; - val = MINCORE_SUPER | MINCORE_INCORE; - if (pmap_page_dirty(l1)) - val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - if ((l1 & ATTR_AF) == ATTR_AF) - val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - goto done; - } - - l2p = pmap_l1_to_l2(l1p, addr); - if (l2p == NULL) /* No l2 */ - goto done; - - l2 = pmap_load(l2p); - if ((l2 & ATTR_DESCR_MASK) == L2_INVAL) - goto done; - - if ((l2 & ATTR_DESCR_MASK) == L2_BLOCK) { - pa = (l2 & ~ATTR_MASK) | (addr & L2_OFFSET); - managed = (l2 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; - val = MINCORE_SUPER | MINCORE_INCORE; - if (pmap_page_dirty(l2)) - val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - if ((l2 & ATTR_AF) == ATTR_AF) - val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - goto done; - } - - l3p = pmap_l2_to_l3(l2p, addr); - if (l3p == NULL) /* No l3 */ - goto done; - - l3 = pmap_load(l2p); - if ((l3 & ATTR_DESCR_MASK) == L3_INVAL) - goto done; - - if ((l3 & ATTR_DESCR_MASK) == L3_PAGE) { - pa = (l3 & ~ATTR_MASK) | (addr & L3_OFFSET); - managed = (l3 & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; val = MINCORE_INCORE; - if (pmap_page_dirty(l3)) + if (lvl != 3) + val |= MINCORE_SUPER; + if (pmap_page_dirty(tpte)) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - if ((l3 & ATTR_AF) == ATTR_AF) + if ((tpte & ATTR_AF) == ATTR_AF) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - } -done: + managed = (tpte & ATTR_SW_MANAGED) == ATTR_SW_MANAGED; + pa = (tpte & ~ATTR_MASK) | (addr & mask); + } else + managed = false; + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ From owner-svn-src-all@freebsd.org Wed Aug 8 17:22:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC5C210636B6; Wed, 8 Aug 2018 17:22:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 931F88828A; Wed, 8 Aug 2018 17:22:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75CCC5AB5; Wed, 8 Aug 2018 17:22:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HMfaA096938; Wed, 8 Aug 2018 17:22:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HMf6j096937; Wed, 8 Aug 2018 17:22:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081722.w78HMf6j096937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337467 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 337467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:22:42 -0000 Author: markj Date: Wed Aug 8 17:22:41 2018 New Revision: 337467 URL: https://svnweb.freebsd.org/changeset/base/337467 Log: MFC r337265: Add the required page accounting to kmem_bootstrap_free(). Modified: stable/11/sys/vm/vm_kern.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_kern.c ============================================================================== --- stable/11/sys/vm/vm_kern.c Wed Aug 8 17:12:06 2018 (r337466) +++ stable/11/sys/vm/vm_kern.c Wed Aug 8 17:22:41 2018 (r337467) @@ -549,6 +549,7 @@ void kmem_bootstrap_free(vm_offset_t start, vm_size_t size) { #if defined(__i386__) || defined(__amd64__) + struct vm_domain *vmd; vm_offset_t end, va; vm_paddr_t pa; vm_page_t m; @@ -560,9 +561,14 @@ kmem_bootstrap_free(vm_offset_t start, vm_size_t size) pa = pmap_kextract(va); m = PHYS_TO_VM_PAGE(pa); + vmd = vm_phys_domain(m); mtx_lock(&vm_page_queue_free_mtx); vm_phys_free_pages(m, 0); + vmd->vmd_page_count++; + vm_phys_freecnt_adj(m, 1); mtx_unlock(&vm_page_queue_free_mtx); + + vm_cnt.v_page_count++; } pmap_remove(kernel_pmap, start, end); (void)vmem_add(kernel_arena, start, end - start, M_WAITOK); From owner-svn-src-all@freebsd.org Wed Aug 8 17:26:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4079E1063920; Wed, 8 Aug 2018 17:26:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9D5D8857B; Wed, 8 Aug 2018 17:26:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAFDA5AB8; Wed, 8 Aug 2018 17:26:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HQpO6097162; Wed, 8 Aug 2018 17:26:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HQpXp097161; Wed, 8 Aug 2018 17:26:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808081726.w78HQpXp097161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 17:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337468 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 337468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:26:52 -0000 Author: markj Date: Wed Aug 8 17:26:51 2018 New Revision: 337468 URL: https://svnweb.freebsd.org/changeset/base/337468 Log: Simplify compression code. - Remove the compression suffix macros and move them directly into the compress_type array. - Remove the hardcoded sizes on the suffix and compression args arrays. - Simplify the compression args arrays at the expense of a __DECONST when calling execv(). - Rewrite do_zipwork. The COMPRESS_* macros can directly index the compress_types array, so the outer loop is not needed. Convert fixed-length strings into asprintf or sbuf calls. Submitted by: Dan Nelson Reviewed by: gad MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16518 Modified: head/usr.sbin/newsyslog/Makefile head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/Makefile ============================================================================== --- head/usr.sbin/newsyslog/Makefile Wed Aug 8 17:22:41 2018 (r337467) +++ head/usr.sbin/newsyslog/Makefile Wed Aug 8 17:26:51 2018 (r337468) @@ -5,6 +5,7 @@ PROG= newsyslog MAN= newsyslog.8 newsyslog.conf.5 SRCS= newsyslog.c ptimes.c +LIBADD= sbuf HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Wed Aug 8 17:22:41 2018 (r337467) +++ head/usr.sbin/newsyslog/newsyslog.c Wed Aug 8 17:26:51 2018 (r337468) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -87,27 +88,6 @@ __FBSDID("$FreeBSD$"); #include "extern.h" /* - * Compression suffixes - */ -#ifndef COMPRESS_SUFFIX_GZ -#define COMPRESS_SUFFIX_GZ ".gz" -#endif - -#ifndef COMPRESS_SUFFIX_BZ2 -#define COMPRESS_SUFFIX_BZ2 ".bz2" -#endif - -#ifndef COMPRESS_SUFFIX_XZ -#define COMPRESS_SUFFIX_XZ ".xz" -#endif - -#ifndef COMPRESS_SUFFIX_ZST -#define COMPRESS_SUFFIX_ZST ".zst" -#endif - -#define COMPRESS_SUFFIX_MAXLEN MAX(MAX(MAX(sizeof(COMPRESS_SUFFIX_GZ),sizeof(COMPRESS_SUFFIX_BZ2)),sizeof(COMPRESS_SUFFIX_XZ)),sizeof(COMPRESS_SUFFIX_ZST)) - -/* * Compression types */ #define COMPRESS_TYPES 5 /* Number of supported compression types */ @@ -151,24 +131,21 @@ struct compress_types { const char *flag; /* Flag in configuration file */ const char *suffix; /* Compression suffix */ const char *path; /* Path to compression program */ - char **args; /* Compression program arguments */ - int nargs; /* Program argument count */ + const char **flags; /* Compression program flags */ + int nflags; /* Program flags count */ }; -static char f_arg[] = "-f"; -static char q_arg[] = "-q"; -static char rm_arg[] = "--rm"; -static char *gz_args[] = { NULL, f_arg, NULL, NULL }; -#define bz2_args gz_args -#define xz_args gz_args -static char *zstd_args[] = { NULL, q_arg, rm_arg, NULL, NULL }; +static const char *gzip_flags[] = { "-f" }; +#define bzip2_flags gzip_flags +#define xz_flags gzip_flags +static const char *zstd_flags[] = { "-q", "--rm" }; static const struct compress_types compress_type[COMPRESS_TYPES] = { - { "", "", "", NULL, 0}, - { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args, nitems(gz_args) }, - { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2, bz2_args, nitems(bz2_args) }, - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ, xz_args, nitems(xz_args) }, - { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD, zstd_args, nitems(zstd_args) } + { "", "", "", NULL, 0 }, + { "Z", ".gz", _PATH_GZIP, gzip_flags, nitems(gzip_flags) }, + { "J", ".bz2", _PATH_BZIP2, bzip2_flags, nitems(bzip2_flags) }, + { "X", ".xz", _PATH_XZ, xz_flags, nitems(xz_flags) }, + { "Y", ".zst", _PATH_ZSTD, zstd_flags, nitems(zstd_flags) } }; struct conf_entry { @@ -2020,54 +1997,19 @@ do_sigwork(struct sigwork_entry *swork) static void do_zipwork(struct zipwork_entry *zwork) { - const char *pgm_name, *pgm_path; - int errsav, fcount, zstatus; + const struct compress_types *ct; + struct sbuf *command; pid_t pidzip, wpid; - char zresult[MAXPATHLEN]; - char command[BUFSIZ]; - char **args; - int c, i, nargs; + int c, errsav, fcount, zstatus; + const char **args, *pgm_name, *pgm_path; + char *zresult; + command = NULL; assert(zwork != NULL); - pgm_path = NULL; - strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); - if (zwork->zw_conf != NULL && - zwork->zw_conf->compress > COMPRESS_NONE) - for (c = 1; c < COMPRESS_TYPES; c++) { - if (zwork->zw_conf->compress == c) { - nargs = compress_type[c].nargs; - args = calloc(nargs, sizeof(*args)); - if (args == NULL) - err(1, "calloc()"); - pgm_path = compress_type[c].path; - (void) strlcat(zresult, - compress_type[c].suffix, sizeof(zresult)); - /* the first argument is always NULL, skip it */ - for (i = 1; i < nargs; i++) { - if (compress_type[c].args[i] == NULL) - break; - args[i] = compress_type[c].args[i]; - } - break; - } - } - if (pgm_path == NULL) { - warnx("invalid entry for %s in do_zipwork", zwork->zw_fname); - return; - } - pgm_name = strrchr(pgm_path, '/'); - if (pgm_name == NULL) - pgm_name = pgm_path; - else - pgm_name++; + assert(zwork->zw_conf != NULL); + assert(zwork->zw_conf->compress > COMPRESS_NONE); + assert(zwork->zw_conf->compress < COMPRESS_TYPES); - args[0] = strdup(pgm_name); - if (args[0] == NULL) - err(1, "strdup()"); - for (c = 0; args[c] != NULL; c++) - ; - args[c] = zwork->zw_fname; - if (zwork->zw_swork != NULL && zwork->zw_swork->sw_runcmd == 0 && zwork->zw_swork->sw_pidok <= 0) { warnx( @@ -2077,20 +2019,54 @@ do_zipwork(struct zipwork_entry *zwork) return; } - strlcpy(command, pgm_path, sizeof(command)); + ct = &compress_type[zwork->zw_conf->compress]; + + /* + * execv will be called with the array [ program, flags ... , + * filename, NULL ] so allocate nflags+3 elements for the array. + */ + args = calloc(ct->nflags + 3, sizeof(*args)); + if (args == NULL) + err(1, "calloc"); + + pgm_path = ct->path; + pgm_name = strrchr(pgm_path, '/'); + if (pgm_name == NULL) + pgm_name = pgm_path; + else + pgm_name++; + + /* Build the argument array. */ + args[0] = pgm_name; + for (c = 0; c < ct->nflags; c++) + args[c + 1] = ct->flags[c]; + args[c + 1] = zwork->zw_fname; + + /* Also create a space-delimited version if we need to print it. */ + if ((command = sbuf_new_auto()) == NULL) + errx(1, "sbuf_new"); + sbuf_cpy(command, pgm_path); for (c = 1; args[c] != NULL; c++) { - strlcat(command, " ", sizeof(command)); - strlcat(command, args[c], sizeof(command)); + sbuf_putc(command, ' '); + sbuf_cat(command, args[c]); } + if (sbuf_finish(command) == -1) + err(1, "sbuf_finish"); + + /* Determine the filename of the compressed file. */ + asprintf(&zresult, "%s%s", zwork->zw_fname, ct->suffix); + if (zresult == NULL) + errx(1, "asprintf"); + + if (verbose) + printf("Executing: %s\n", sbuf_data(command)); + if (noaction) { printf("\t%s %s\n", pgm_name, zwork->zw_fname); change_attrs(zresult, zwork->zw_conf); - return; + goto out; } - if (verbose) { - printf("Executing: %s\n", command); - } fcount = 1; pidzip = fork(); while (pidzip < 0) { @@ -2108,34 +2084,34 @@ do_zipwork(struct zipwork_entry *zwork) } if (!pidzip) { /* The child process executes the compression command */ - execv(pgm_path, (char *const*) args); - err(1, "execv(`%s')", command); + execv(pgm_path, __DECONST(char *const*, args)); + err(1, "execv(`%s')", sbuf_data(command)); } wpid = waitpid(pidzip, &zstatus, 0); if (wpid == -1) { /* XXX - should this be a fatal error? */ warn("%s: waitpid(%d)", pgm_path, pidzip); - return; + goto out; } if (!WIFEXITED(zstatus)) { - warnx("`%s' did not terminate normally", command); - free(args[0]); - free(args); - return; + warnx("`%s' did not terminate normally", sbuf_data(command)); + goto out; } if (WEXITSTATUS(zstatus)) { - warnx("`%s' terminated with a non-zero status (%d)", command, - WEXITSTATUS(zstatus)); - free(args[0]); - free(args); - return; + warnx("`%s' terminated with a non-zero status (%d)", + sbuf_data(command), WEXITSTATUS(zstatus)); + goto out; } - free(args[0]); - free(args); /* Compression was successful, set file attributes on the result. */ change_attrs(zresult, zwork->zw_conf); + +out: + if (command != NULL) + sbuf_delete(command); + free(args); + free(zresult); } /* @@ -2442,8 +2418,18 @@ age_old_log(const char *file) { struct stat sb; const char *logfile_suffix; - char tmp[MAXPATHLEN + sizeof(".0") + COMPRESS_SUFFIX_MAXLEN + 1]; + static unsigned int suffix_maxlen = 0; + char *tmp; time_t mtime; + int c; + + if (suffix_maxlen == 0) { + for (c = 0; c < COMPRESS_TYPES; c++) + suffix_maxlen = MAX(suffix_maxlen, + strlen(compress_type[c].suffix)); + } + + tmp = alloca(MAXPATHLEN + sizeof(".0") + suffix_maxlen + 1); if (archtodir) { char *p; From owner-svn-src-all@freebsd.org Wed Aug 8 17:32:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 996D91063F2D; Wed, 8 Aug 2018 17:32:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 506D488C95; Wed, 8 Aug 2018 17:32:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 322785B2C; Wed, 8 Aug 2018 17:32:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HW377002185; Wed, 8 Aug 2018 17:32:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HW3r7002184; Wed, 8 Aug 2018 17:32:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808081732.w78HW3r7002184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 8 Aug 2018 17:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337469 - head/sys/netpfil/ipfw/pmod X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/pmod X-SVN-Commit-Revision: 337469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:32:03 -0000 Author: ae Date: Wed Aug 8 17:32:02 2018 New Revision: 337469 URL: https://svnweb.freebsd.org/changeset/base/337469 Log: Use host byte order when comparing mss values. This fixes tcp-setmss action on little endian machines. PR: 225536 Submitted by: John Zielinski Modified: head/sys/netpfil/ipfw/pmod/tcpmod.c Modified: head/sys/netpfil/ipfw/pmod/tcpmod.c ============================================================================== --- head/sys/netpfil/ipfw/pmod/tcpmod.c Wed Aug 8 17:26:51 2018 (r337468) +++ head/sys/netpfil/ipfw/pmod/tcpmod.c Wed Aug 8 17:32:02 2018 (r337469) @@ -98,7 +98,7 @@ tcpmod_setmss(struct mbuf **mp, struct tcphdr *tcp, in ret = 0; /* report success */ bcopy(cp + 2, &oldmss, sizeof(oldmss)); /* Do not update lower MSS value */ - if (oldmss <= mss) + if (ntohs(oldmss) <= ntohs(mss)) break; bcopy(&mss, cp + 2, sizeof(mss)); /* Update checksum if it is not delayed. */ From owner-svn-src-all@freebsd.org Wed Aug 8 17:47:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C03710649D7; Wed, 8 Aug 2018 17:47:04 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 086D0899BA; Wed, 8 Aug 2018 17:47:03 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 1FDE940872AB; Wed, 8 Aug 2018 20:46:52 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zd8pncVlU6-kqBGZjdX; Wed, 08 Aug 2018 20:46:52 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533750412; bh=Tmmq4hoGtco3fwTSBcvA/Be9KW7s3zcxbngFytA2l1U=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=WRlZlawgQt++GL0zL3m8vLhsRAOoGkAddFAmc9/BiAwBmwN05pWcgu3ViZBWWPP0t p9FE8MO//bxHAwRME/iI7wOxAwozKveLLw7qTQ89DnCVNnLFI5ZXKOfGIIfVmVDUvj XOpcpgqDBCPpKXo9AAKyJMIReaEGsTCnsO0TILsA= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 8n7ZsDTpf7-kpuC8cRf; Wed, 08 Aug 2018 20:46:51 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533750411; bh=Tmmq4hoGtco3fwTSBcvA/Be9KW7s3zcxbngFytA2l1U=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=Ew3GbhWjZpRDV1pBMSjiQONV4jjde5QM29XTtc/rh+gNvGgWKRNfb6e4lsd6SufG5 MLgU1JhRJ9IPU28ubQCeGB8PAyNOc6uPyFzLlEF5rmVgYJaFC4H0aAjjl+2jT5PT1J u/08m6pPmf+hu9T3UpyW8DNNp8vC8QvFVfniSV28= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337462 - in stable/11/sys: net netinet netinet6 To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201808081640.w78Gegho012855@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <99179ee8-9272-08be-f86a-d2ca06deef9f@yandex.ru> Date: Wed, 8 Aug 2018 20:46:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808081640.w78Gegho012855@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TBF9znWahoznHdgldKXQsN4W4xCxrAXCE" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:47:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TBF9znWahoznHdgldKXQsN4W4xCxrAXCE Content-Type: multipart/mixed; boundary="I7CXRGr4YjJrD3o5Kvp0gG6FC3f1Q7ZaO"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Message-ID: <99179ee8-9272-08be-f86a-d2ca06deef9f@yandex.ru> Subject: Re: svn commit: r337462 - in stable/11/sys: net netinet netinet6 References: <201808081640.w78Gegho012855@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808081640.w78Gegho012855@pdx.rh.CN85.dnsmgr.net> --I7CXRGr4YjJrD3o5Kvp0gG6FC3f1Q7ZaO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 08.08.2018 19:40, Rodney W. Grimes wrote: >> Author: ae >> Date: Wed Aug 8 16:17:50 2018 >> New Revision: 337462 >> URL: https://svnweb.freebsd.org/changeset/base/337462 >> >> Log: >> MFC r331098 (by melifaro): >> Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration. >> =20 >> Current arp/nd code relies on the feedback from the datapath indic= ating >> that the entry is still used. This mechanism is incorporated into= the >> arpresolve()/nd6_resolve() routines. After the inpcb route cache >> introduction, the packet path for the locally-originated packets = changed, >> passing cached lle pointer to the ether_output() directly. This r= esulted >> in the arp/ndp entry expire each time exactly after the configure= d max_age >> interval. During the small window between the ARP/NDP request and= reply >> from the router, most of the packets got lost. >> =20 >> Fix this behaviour by plugging datapath notification code to the p= acket >> path used by route cache. Unify the notification code by using si= ngle >> inlined function with the per-AF callbacks. >=20 > Is this worthy of an EN for 11.2? > This is a rather annoying problem for some people. I saw only one report, if you think so, fell free to do that :) --=20 WBR, Andrey V. Elsukov --I7CXRGr4YjJrD3o5Kvp0gG6FC3f1Q7ZaO-- --TBF9znWahoznHdgldKXQsN4W4xCxrAXCE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltrLHcACgkQAcXqBBDI oXpLPgf9FEE70v4j+xX+xifOYg9TsnKjm3M6hnqGZNb0XtXjjHQ2wrGnzEVS4JG3 n2v8kEoDRwvpbdv2pc6uwzRQy43Y1/j+4op39RWZ8NHV6WAYxJNtpVswdpvLGKz+ y15ZfR21SmGFOACPJA01G4TQzgywc5fmYWK7q+UuGji6J8+NDwLHGDLIQWM6FZ+A d0qAFrywgvrRwaa5mnkOrTt6ySnAXHpZDYjBHgA/OD74RtMK7U/li7EpdRJrDZ1S V0l7uQltH6TtrOgqtyX1PmAIjds5gL/YdhT1S4RDWPYtYp2KTelbG98oxOlVM6MG Mak9N1YzCsO56Q56In8S4tfg2DZCAA== =YUhJ -----END PGP SIGNATURE----- --TBF9znWahoznHdgldKXQsN4W4xCxrAXCE-- From owner-svn-src-all@freebsd.org Wed Aug 8 17:48:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFDFE1064A8C; Wed, 8 Aug 2018 17:48:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94F0089AEE; Wed, 8 Aug 2018 17:48:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7279A5E01; Wed, 8 Aug 2018 17:48:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Hm3oJ008267; Wed, 8 Aug 2018 17:48:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Hm3w7008266; Wed, 8 Aug 2018 17:48:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081748.w78Hm3w7008266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337470 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 337470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:48:04 -0000 Author: bdrewery Date: Wed Aug 8 17:48:02 2018 New Revision: 337470 URL: https://svnweb.freebsd.org/changeset/base/337470 Log: MFC r335183: proc0_post: Fix some locking issues Modified: stable/11/sys/kern/init_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/init_main.c ============================================================================== --- stable/11/sys/kern/init_main.c Wed Aug 8 17:32:02 2018 (r337469) +++ stable/11/sys/kern/init_main.c Wed Aug 8 17:48:02 2018 (r337470) @@ -632,17 +632,23 @@ proc0_post(void *dummy __unused) */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + continue; + } microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - PROC_STATUNLOCK(p); p->p_rux.rux_runtime = 0; p->p_rux.rux_uticks = 0; p->p_rux.rux_sticks = 0; p->p_rux.rux_iticks = 0; + PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; } + PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); PCPU_SET(switchtime, cpu_ticks()); From owner-svn-src-all@freebsd.org Wed Aug 8 17:49:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 363C81064BDB; Wed, 8 Aug 2018 17:49:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEDBE89CC2; Wed, 8 Aug 2018 17:49:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF2D5E04; Wed, 8 Aug 2018 17:49:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HnZNT008373; Wed, 8 Aug 2018 17:49:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HnZi4008372; Wed, 8 Aug 2018 17:49:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081749.w78HnZi4008372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337471 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 337471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:49:36 -0000 Author: bdrewery Date: Wed Aug 8 17:49:35 2018 New Revision: 337471 URL: https://svnweb.freebsd.org/changeset/base/337471 Log: MFC r335183: proc0_post: Fix some locking issues Modified: stable/10/sys/kern/init_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/init_main.c ============================================================================== --- stable/10/sys/kern/init_main.c Wed Aug 8 17:48:02 2018 (r337470) +++ stable/10/sys/kern/init_main.c Wed Aug 8 17:49:35 2018 (r337471) @@ -611,17 +611,23 @@ proc0_post(void *dummy __unused) */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); + continue; + } microuptime(&p->p_stats->p_start); PROC_STATLOCK(p); rufetch(p, &ru); /* Clears thread stats */ - PROC_STATUNLOCK(p); p->p_rux.rux_runtime = 0; p->p_rux.rux_uticks = 0; p->p_rux.rux_sticks = 0; p->p_rux.rux_iticks = 0; + PROC_STATUNLOCK(p); FOREACH_THREAD_IN_PROC(p, td) { td->td_runtime = 0; } + PROC_UNLOCK(p); } sx_sunlock(&allproc_lock); PCPU_SET(switchtime, cpu_ticks()); From owner-svn-src-all@freebsd.org Wed Aug 8 17:50:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EBA71064E12; Wed, 8 Aug 2018 17:50:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C296789E76; Wed, 8 Aug 2018 17:50:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A51345E10; Wed, 8 Aug 2018 17:50:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HohZf009281; Wed, 8 Aug 2018 17:50:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Hohlg009280; Wed, 8 Aug 2018 17:50:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081750.w78Hohlg009280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337472 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:50:44 -0000 Author: bdrewery Date: Wed Aug 8 17:50:43 2018 New Revision: 337472 URL: https://svnweb.freebsd.org/changeset/base/337472 Log: MFC r335244: Assert that a build is done before an install. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 17:49:35 2018 (r337471) +++ stable/11/Makefile.inc1 Wed Aug 8 17:50:43 2018 (r337472) @@ -87,7 +87,10 @@ OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} # running CC from bsd.compiler.mk. .if make(installworld) || make(install) .-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk" +.if !defined(_LOADED_COMPILER_METADATA) +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. .endif +.endif # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. .include @@ -188,6 +191,7 @@ compiler-metadata.mk: .PHONY .META @: > ${.TARGET} @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ > ${.TARGET} + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} .for v in ${_COMPILER_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} .endfor From owner-svn-src-all@freebsd.org Wed Aug 8 17:52:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25CB71064F21; Wed, 8 Aug 2018 17:52:16 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 997D88A248; Wed, 8 Aug 2018 17:52:15 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w78HqDU3094060 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Aug 2018 10:52:13 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w78HqD6d094059; Wed, 8 Aug 2018 10:52:13 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 8 Aug 2018 10:52:13 -0700 From: Gleb Smirnoff To: Ed Maste , br@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r336692 - head/sys/sys Message-ID: <20180808175213.GA420@FreeBSD.org> References: <201807250018.w6P0ILvv074365@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201807250018.w6P0ILvv074365@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:52:16 -0000 On Wed, Jul 25, 2018 at 12:18:21AM +0000, Ed Maste wrote: E> Author: emaste E> Date: Wed Jul 25 00:18:21 2018 E> New Revision: 336692 E> URL: https://svnweb.freebsd.org/changeset/base/336692 E> E> Log: E> sockopt.h: remove stale comment E> E> Some old compatibility bits were removed in r227503 but this comment E> was left behind. E> E> Reported by: br, via review D11962 E> Sponsored by: The FreeBSD Foundation E> E> Modified: E> head/sys/sys/sockopt.h E> E> Modified: head/sys/sys/sockopt.h E> ============================================================================== E> --- head/sys/sys/sockopt.h Wed Jul 25 00:06:18 2018 (r336691) E> +++ head/sys/sys/sockopt.h Wed Jul 25 00:18:21 2018 (r336692) E> @@ -62,7 +62,6 @@ int sosetopt(struct socket *so, struct sockopt *sopt); E> int sogetopt(struct socket *so, struct sockopt *sopt); E> int sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen); E> int sooptcopyout(struct sockopt *sopt, const void *buf, size_t len); E> -/* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */ E> int soopt_getm(struct sockopt *sopt, struct mbuf **mp); E> int soopt_mcopyin(struct sockopt *sopt, struct mbuf *m); E> int soopt_mcopyout(struct sockopt *sopt, struct mbuf *m); This comment was a good mark to note that these three functions need to go away. But IPv6 still uses them. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Wed Aug 8 17:57:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D7AE10650AC; Wed, 8 Aug 2018 17:57:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53AA78A4F1; Wed, 8 Aug 2018 17:57:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34C2F5FA0; Wed, 8 Aug 2018 17:57:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HvkZ2013445; Wed, 8 Aug 2018 17:57:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Hvk2L013444; Wed, 8 Aug 2018 17:57:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081757.w78Hvk2L013444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337473 - stable/11/lib/libc/tests/ssp X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/lib/libc/tests/ssp X-SVN-Commit-Revision: 337473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:57:46 -0000 Author: bdrewery Date: Wed Aug 8 17:57:45 2018 New Revision: 337473 URL: https://svnweb.freebsd.org/changeset/base/337473 Log: MFC r335704: Rework check for libclang_rt to see if the needed library exists. Modified: stable/11/lib/libc/tests/ssp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/ssp/Makefile ============================================================================== --- stable/11/lib/libc/tests/ssp/Makefile Wed Aug 8 17:50:43 2018 (r337472) +++ stable/11/lib/libc/tests/ssp/Makefile Wed Aug 8 17:57:45 2018 (r337473) @@ -1,9 +1,5 @@ # $FreeBSD$ -# XXX This is a workaround to allow i386 to cross-compile on an amd64 host. -.include -# XXX --- - .include NO_WERROR= @@ -35,21 +31,16 @@ PROGS+= h_memset # probably needs to be fixed as it's currently hardcoded. # # sanitizer is not tested or supported for ARM right now. sbruno -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -.if ${COMPILER_TYPE} == "clang" && ${MK_TOOLCHAIN} == "yes" -.if ${COMPILER_VERSION} < 30500 || 30700 <= ${COMPILER_VERSION} - -# XXX This is a workaround to allow i386 to cross-compile on an amd64 host. -.if ${MACHINE_CPUARCH} == ${_HOST_ARCH} -# XXX --- - -PROGS+= h_raw - -# XXX This is a workaround to allow i386 to cross-compile on an amd64 host. +.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \ + (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") +.if !defined(_CLANG_RESOURCE_DIR) +_CLANG_RESOURCE_DIR!= ${CC:N${CCACHE_BIN}} -print-resource-dir +.export _CLANG_RESOURCE_DIR .endif -# XXX --- - -.endif +_libclang_rt_arch= ${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/} +_libclang_rt_ubsan= ${_CLANG_RESOURCE_DIR}/lib/freebsd/libclang_rt.ubsan_standalone-${_libclang_rt_arch}.a +.if exists(${_libclang_rt_ubsan}) +PROGS+= h_raw .endif .endif PROGS+= h_read From owner-svn-src-all@freebsd.org Wed Aug 8 17:58:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 566351065188; Wed, 8 Aug 2018 17:58:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D4518A65D; Wed, 8 Aug 2018 17:58:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E33285FA1; Wed, 8 Aug 2018 17:58:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Hwckn013528; Wed, 8 Aug 2018 17:58:38 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Hwcst013527; Wed, 8 Aug 2018 17:58:38 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081758.w78Hwcst013527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337474 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:58:39 -0000 Author: bdrewery Date: Wed Aug 8 17:58:38 2018 New Revision: 337474 URL: https://svnweb.freebsd.org/changeset/base/337474 Log: MFC r335708: tinderbox: Give details about kernel builds. Modified: stable/11/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile ============================================================================== --- stable/11/Makefile Wed Aug 8 17:57:45 2018 (r337473) +++ stable/11/Makefile Wed Aug 8 17:58:38 2018 (r337474) @@ -516,10 +516,13 @@ universe_${target}: universe_${target}_done universe_${target}_done: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor -universe_kernels: universe_kernconfs .PHONY .if !defined(TARGET) TARGET!= uname -m .endif +universe_kernels_prologue: .PHONY + @echo ">> ${TARGET} kernels started on `LC_ALL=C date`" +universe_kernels: universe_kernconfs .PHONY + @echo ">> ${TARGET} kernels completed on `LC_ALL=C date`" .if defined(MAKE_ALL_KERNELS) _THINNER=cat .elif defined(MAKE_LINT_KERNELS) @@ -532,7 +535,7 @@ KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES | \ ${_THINNER} -universe_kernconfs: .PHONY +universe_kernconfs: universe_kernels_prologue .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ @@ -542,6 +545,7 @@ TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/con .endif universe_kernconfs: universe_kernconf_${TARGET}_${kernel} universe_kernconf_${TARGET}_${kernel}: .MAKE + @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ @@ -550,6 +554,7 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE > _.${TARGET}.${kernel} 2>&1 || \ (echo "${TARGET} ${kernel} kernel failed," \ "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) + @echo ">> ${TARGET}.${TARGET_ARCH_${kernel}} ${kernel} kernel completed on `LC_ALL=C date`" .endfor universe: universe_epilogue universe_epilogue: .PHONY From owner-svn-src-all@freebsd.org Wed Aug 8 17:59:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21C8A1065247; Wed, 8 Aug 2018 17:59:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC5788A7FC; Wed, 8 Aug 2018 17:59:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE4345FA6; Wed, 8 Aug 2018 17:59:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78HxX4N013614; Wed, 8 Aug 2018 17:59:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78HxXB7013613; Wed, 8 Aug 2018 17:59:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081759.w78HxXB7013613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 17:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337475 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 337475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 17:59:34 -0000 Author: bdrewery Date: Wed Aug 8 17:59:33 2018 New Revision: 337475 URL: https://svnweb.freebsd.org/changeset/base/337475 Log: MFC r335709: CCACHE_BUILD: Avoid ccache when looking up compiler metadata. Modified: stable/11/share/mk/bsd.compiler.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.compiler.mk ============================================================================== --- stable/11/share/mk/bsd.compiler.mk Wed Aug 8 17:58:38 2018 (r337474) +++ stable/11/share/mk/bsd.compiler.mk Wed Aug 8 17:59:33 2018 (r337475) @@ -138,7 +138,7 @@ ${X_}COMPILER_TYPE= none ${X_}COMPILER_VERSION= 0 ${X_}COMPILER_FREEBSD_VERSION= 0 .elif !defined(${X_}COMPILER_TYPE) || !defined(${X_}COMPILER_VERSION) -_v!= ${${cc}} --version || echo 0.0.0 +_v!= ${${cc}:N${CCACHE_BIN}} --version || echo 0.0.0 .if !defined(${X_}COMPILER_TYPE) . if ${${cc}:T:M*gcc*} @@ -161,7 +161,7 @@ ${X_}COMPILER_VERSION!=echo "${_v:M[1-9].[0-9]*}" | aw .undef _v .endif .if !defined(${X_}COMPILER_FREEBSD_VERSION) -${X_}COMPILER_FREEBSD_VERSION!= { echo "__FreeBSD_cc_version" | ${${cc}} -E - 2>/dev/null || echo __FreeBSD_cc_version; } | sed -n '$$p' +${X_}COMPILER_FREEBSD_VERSION!= { echo "__FreeBSD_cc_version" | ${${cc}:N${CCACHE_BIN}} -E - 2>/dev/null || echo __FreeBSD_cc_version; } | sed -n '$$p' # If we get a literal "__FreeBSD_cc_version" back then the compiler # is a non-FreeBSD build that doesn't support it or some other error # occurred. From owner-svn-src-all@freebsd.org Wed Aug 8 18:03:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BCE3106580A; Wed, 8 Aug 2018 18:03:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6DC88AF1C; Wed, 8 Aug 2018 18:03:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7FDA6134; Wed, 8 Aug 2018 18:03:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78I3v6t018335; Wed, 8 Aug 2018 18:03:57 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78I3vI0018334; Wed, 8 Aug 2018 18:03:57 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081803.w78I3vI0018334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337476 - stable/11/lib/libpam/static_libpam X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/lib/libpam/static_libpam X-SVN-Commit-Revision: 337476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:03:58 -0000 Author: bdrewery Date: Wed Aug 8 18:03:57 2018 New Revision: 337476 URL: https://svnweb.freebsd.org/changeset/base/337476 Log: MFC r310789,r314901: r310789: Use compiler driver to build relocatable object r314901: Use LDFLAGS rather than CFLAGS when linking. Modified: stable/11/lib/libpam/static_libpam/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpam/static_libpam/Makefile ============================================================================== --- stable/11/lib/libpam/static_libpam/Makefile Wed Aug 8 17:59:33 2018 (r337475) +++ stable/11/lib/libpam/static_libpam/Makefile Wed Aug 8 18:03:57 2018 (r337476) @@ -64,6 +64,6 @@ CLEANFILES+= openpam_static.o \ openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} - ${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC} + ${CC} -nostdlib ${LDFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} .include "${.CURDIR:H}/libpam/Makefile" From owner-svn-src-all@freebsd.org Wed Aug 8 18:05:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02880106595B; Wed, 8 Aug 2018 18:05:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7FD98B14F; Wed, 8 Aug 2018 18:05:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87B0D6136; Wed, 8 Aug 2018 18:05:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78I5GM6018464; Wed, 8 Aug 2018 18:05:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78I5ETo018454; Wed, 8 Aug 2018 18:05:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081805.w78I5ETo018454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337477 - in stable/11: bin/csh gnu/usr.bin/cc/cc1 gnu/usr.bin/cc/cc1plus gnu/usr.bin/cc/cc_tools lib/libmagic lib/libpam/static_libpam lib/ncurses/ncurses share/syscons/scrnmaps stand/... X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in stable/11: bin/csh gnu/usr.bin/cc/cc1 gnu/usr.bin/cc/cc1plus gnu/usr.bin/cc/cc_tools lib/libmagic lib/libpam/static_libpam lib/ncurses/ncurses share/syscons/scrnmaps stand/mips/beri/boot2 usr.bin/v... X-SVN-Commit-Revision: 337477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:05:17 -0000 Author: bdrewery Date: Wed Aug 8 18:05:14 2018 New Revision: 337477 URL: https://svnweb.freebsd.org/changeset/base/337477 Log: MFC r335733: Don't use CCACHE for linking. Modified: stable/11/bin/csh/Makefile stable/11/gnu/usr.bin/cc/cc1/Makefile stable/11/gnu/usr.bin/cc/cc1plus/Makefile stable/11/gnu/usr.bin/cc/cc_tools/Makefile stable/11/lib/libmagic/Makefile stable/11/lib/libpam/static_libpam/Makefile stable/11/lib/ncurses/ncurses/Makefile stable/11/share/syscons/scrnmaps/Makefile stable/11/stand/mips/beri/boot2/Makefile stable/11/usr.bin/vi/catalog/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/csh/Makefile ============================================================================== --- stable/11/bin/csh/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/bin/csh/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -113,7 +113,7 @@ build-tools: gethost gethost: gethost.c sh.err.h tc.const.h sh.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} - ${CC} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ + ${CC:N${CCACHE_BIN}} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \ ${TCSHDIR}/gethost.c tc.defs.c: gethost ${TCSHDIR}/host.defs Modified: stable/11/gnu/usr.bin/cc/cc1/Makefile ============================================================================== --- stable/11/gnu/usr.bin/cc/cc1/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/gnu/usr.bin/cc/cc1/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -20,7 +20,7 @@ LDADD= ${LIBBACKEND} ${LIBCPP} ${LIBDECNUMBER} ${LIBIB DOBJS+= ${SRCS:N*.h:R:S/$/.o/g} ${PROG}-dummy: ${DOBJS} - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${DOBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${DOBJS} ${LDADD} CLEANFILES+= ${PROG}-dummy ${PROG}-checksum.c: ${PROG}-dummy Modified: stable/11/gnu/usr.bin/cc/cc1plus/Makefile ============================================================================== --- stable/11/gnu/usr.bin/cc/cc1plus/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/gnu/usr.bin/cc/cc1plus/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -35,7 +35,7 @@ CLEANFILES= cfns.h DOBJS+= ${SRCS:N*.h:R:S/$/.o/g} ${PROG}-dummy: ${DOBJS} - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${DOBJS} ${LDADD} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${DOBJS} ${LDADD} CLEANFILES+= ${PROG}-dummy ${PROG}-checksum.c: ${PROG}-dummy Modified: stable/11/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- stable/11/gnu/usr.bin/cc/cc_tools/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/gnu/usr.bin/cc/cc_tools/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -276,7 +276,7 @@ CLEANFILES+= gengtype-yacc.c gengtype: gengtype.o gengtype-yacc+%DIKED.o gengtype-lex.o errors.o \ ${LIBIBERTY} - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} gtype-desc.h: gengtype ${BTOOLSPATH:U.}/gengtype @@ -292,18 +292,18 @@ CLEANFILES+= gt-*.h gtype-*.h # .for F in check checksum genrtl modes gen$F: gen$F.o errors.o ${LIBIBERTY} - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} .endfor .for F in attr attrtab automata codes conditions config constants emit \ extract flags opinit output peep preds recog gen$F: gen$F.o rtl.o read-rtl.o ggc-none.o vec.o min-insn-modes.o \ gensupport.o print-rtl.o errors.o ${LIBIBERTY} - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lm + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lm .endfor gencondmd: gencondmd.o - ${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + ${CC:N${CCACHE_BIN}} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} # # Generated .md files. Modified: stable/11/lib/libmagic/Makefile ============================================================================== --- stable/11/lib/libmagic/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/lib/libmagic/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -43,7 +43,7 @@ magic.mgc: mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic mkmagic: apprentice.c cdf_time.c encoding.c funcs.c magic.c print.c ${INCS} ${BUILD_TOOLS_META} - ${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC:N*.h} \ + ${CC:N${CCACHE_BIN}} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC:N*.h} \ ${LDADD} FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ Modified: stable/11/lib/libpam/static_libpam/Makefile ============================================================================== --- stable/11/lib/libpam/static_libpam/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/lib/libpam/static_libpam/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -64,6 +64,7 @@ CLEANFILES+= openpam_static.o \ openpam_static_modules.o openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} - ${CC} -nostdlib ${LDFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} + ${CC:N${CCACHE_BIN}} -nostdlib ${LDFLAGS} -o ${.TARGET} \ + -r -Wl,--whole-archive ${.ALLSRC} .include "${.CURDIR:H}/libpam/Makefile" Modified: stable/11/lib/ncurses/ncurses/Makefile ============================================================================== --- stable/11/lib/ncurses/ncurses/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/lib/ncurses/ncurses/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -391,10 +391,10 @@ keys.list: MKkeys_list.sh Caps build-tools: make_hash make_keys make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c + ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META} - ${CC} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ + ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ ${NCURSES_DIR}/ncurses/tinfo/make_hash.c # ./configure generated Modified: stable/11/share/syscons/scrnmaps/Makefile ============================================================================== --- stable/11/share/syscons/scrnmaps/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/share/syscons/scrnmaps/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -20,7 +20,7 @@ ${SCRMAPS}: ${.TARGET:R}.mk rm -f ${.TARGET:R}.tmp ${SCRMAPS_MK}: ${.TARGET:R} mkscrfil.c ${BUILD_TOOLS_META} - ${CC} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" ${LDFLAGS} \ - -o ${.TARGET} ${.CURDIR}/mkscrfil.c + ${CC:N${CCACHE_BIN}} ${CFLAGS} -I${.CURDIR} -DFIL=\"${.TARGET:R}\" \ + ${LDFLAGS} -o ${.TARGET} ${.CURDIR}/mkscrfil.c .include Modified: stable/11/stand/mips/beri/boot2/Makefile ============================================================================== --- stable/11/stand/mips/beri/boot2/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/stand/mips/beri/boot2/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -60,16 +60,16 @@ LDFLAGS+= -static \ CFLAGS+= -I${BOOTSRC}/mips/beri/common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o - ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSA} + ${CC:N${CCACHE_BIN}} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript \ + -o ${.TARGET} ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot md5 flashboot > flashboot.md5 jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o - ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSA} + ${CC:N${CCACHE_BIN}} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript \ + -o ${.TARGET} ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 Modified: stable/11/usr.bin/vi/catalog/Makefile ============================================================================== --- stable/11/usr.bin/vi/catalog/Makefile Wed Aug 8 18:03:57 2018 (r337476) +++ stable/11/usr.bin/vi/catalog/Makefile Wed Aug 8 18:05:14 2018 (r337477) @@ -106,7 +106,7 @@ english.base: dump ${SCAN} #Makefile dump: dump.c ${BUILD_TOOLS_META} - ${CC} -o ${.TARGET} ${.ALLSRC} + ${CC:N${CCACHE_BIN}} -o ${.TARGET} ${.ALLSRC} CLEANFILES+= dump ${CAT} english.base *.check __ck1 __ck2 From owner-svn-src-all@freebsd.org Wed Aug 8 18:41:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37350106688A; Wed, 8 Aug 2018 18:41:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E11608C6D2; Wed, 8 Aug 2018 18:41:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3EDA678B; Wed, 8 Aug 2018 18:41:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IfRru037428; Wed, 8 Aug 2018 18:41:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IfRSM037427; Wed, 8 Aug 2018 18:41:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081841.w78IfRSM037427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337478 - stable/11/sys/modules/aic7xxx/ahc X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sys/modules/aic7xxx/ahc X-SVN-Commit-Revision: 337478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:41:28 -0000 Author: bdrewery Date: Wed Aug 8 18:41:27 2018 New Revision: 337478 URL: https://svnweb.freebsd.org/changeset/base/337478 Log: MFC r335923: META_MODE: Fix wanting a meta file in source tree. Modified: stable/11/sys/modules/aic7xxx/ahc/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/aic7xxx/ahc/Makefile ============================================================================== --- stable/11/sys/modules/aic7xxx/ahc/Makefile Wed Aug 8 18:05:14 2018 (r337477) +++ stable/11/sys/modules/aic7xxx/ahc/Makefile Wed Aug 8 18:41:27 2018 (r337478) @@ -40,7 +40,7 @@ ${GENSRCS}: \ # to appear when building the tree from 8.x worlds where fmake is the # default. fmake doens't define .MAKE.LEVEL so key off that to omit it, # while still allowing more-modern makes to theoretically update things. -${GENSRCS}: +${GENSRCS}: .NOMETA @echo "Error: ${.TARGET} is missing. Run 'make ahcfirmware'" .endif From owner-svn-src-all@freebsd.org Wed Aug 8 18:46:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2006A1066BF2; Wed, 8 Aug 2018 18:46:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAEB58CC83; Wed, 8 Aug 2018 18:46:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD68B67F2; Wed, 8 Aug 2018 18:46:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Ik3V3039374; Wed, 8 Aug 2018 18:46:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Ik38i039373; Wed, 8 Aug 2018 18:46:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081846.w78Ik38i039373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337479 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 337479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:46:04 -0000 Author: bdrewery Date: Wed Aug 8 18:46:03 2018 New Revision: 337479 URL: https://svnweb.freebsd.org/changeset/base/337479 Log: MFC r335912: Fix .depend.foo.o tracking for sys/conf/files defined compilations. Modified: stable/11/sys/conf/kern.post.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Wed Aug 8 18:41:27 2018 (r337478) +++ stable/11/sys/conf/kern.post.mk Wed Aug 8 18:46:03 2018 (r337479) @@ -219,6 +219,7 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDFILES= .depend .depend.* DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o +DEPENDOBJS+= ${CLEAN:M*.o} DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP From owner-svn-src-all@freebsd.org Wed Aug 8 18:48:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B66D31066DC1; Wed, 8 Aug 2018 18:48:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2618CEC5; Wed, 8 Aug 2018 18:48:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F74C67F9; Wed, 8 Aug 2018 18:48:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78ImfhM039530; Wed, 8 Aug 2018 18:48:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Imef1039528; Wed, 8 Aug 2018 18:48:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081848.w78Imef1039528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:48:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337480 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 337480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:48:41 -0000 Author: bdrewery Date: Wed Aug 8 18:48:40 2018 New Revision: 337480 URL: https://svnweb.freebsd.org/changeset/base/337480 Log: MFC r335922: Use OBJS_DEPEND_GUESS for forced opt_global.h dependency. Modified: stable/11/sys/conf/kern.post.mk stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Wed Aug 8 18:46:03 2018 (r337479) +++ stable/11/sys/conf/kern.post.mk Wed Aug 8 18:48:40 2018 (r337480) @@ -196,7 +196,8 @@ assym.s: $S/kern/genassym.sh genassym.o genassym.o: $S/$M/$M/genassym.c ${CC} -c ${CFLAGS:N-flto:N-fno-common} $S/$M/$M/genassym.c -${SYSTEM_OBJS} genassym.o vers.o: opt_global.h +OBJS_DEPEND_GUESS+= opt_global.h +genassym.o vers.o: opt_global.h .if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) _meta_filemon= 1 Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Wed Aug 8 18:46:03 2018 (r337479) +++ stable/11/sys/conf/kmod.mk Wed Aug 8 18:48:40 2018 (r337480) @@ -449,9 +449,6 @@ acpi_quirks.h: ${SYSDIR}/tools/acpi_quirks2h.awk ${SYS CLEANFILES+= assym.s genassym.o DEPENDOBJS+= genassym.o assym.s: genassym.o -.if defined(KERNBUILDDIR) -genassym.o: opt_global.h -.endif assym.s: ${SYSDIR}/kern/genassym.sh sh ${SYSDIR}/kern/genassym.sh genassym.o > ${.TARGET} genassym.o: ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c @@ -463,16 +460,15 @@ genassym.o: ${SRCS:Mopt_*.h} lint: ${SRCS} ${LINT} ${LINTKERNFLAGS} ${CFLAGS:M-[DILU]*} ${.ALLSRC:M*.c} -.if defined(KERNBUILDDIR) -${OBJS}: opt_global.h -.endif - CLEANDEPENDFILES+= ${_ILINKS} # .depend needs include links so we remove them only together. cleanilinks: rm -f ${_ILINKS} OBJS_DEPEND_GUESS+= ${SRCS:M*.h} +.if defined(KERNBUILDDIR) +OBJS_DEPEND_GUESS+= opt_global.h +.endif .include .include From owner-svn-src-all@freebsd.org Wed Aug 8 18:50:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E43541066E6D; Wed, 8 Aug 2018 18:50:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 993C18D027; Wed, 8 Aug 2018 18:50:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A81067FE; Wed, 8 Aug 2018 18:50:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IoWnF039693; Wed, 8 Aug 2018 18:50:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IoWVb039692; Wed, 8 Aug 2018 18:50:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081850.w78IoWVb039692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337481 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 337481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:50:33 -0000 Author: bdrewery Date: Wed Aug 8 18:50:32 2018 New Revision: 337481 URL: https://svnweb.freebsd.org/changeset/base/337481 Log: MFC r326552: Fix DPSRCS not getting .depend.* files. Modified: stable/11/share/mk/bsd.dep.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.dep.mk ============================================================================== --- stable/11/share/mk/bsd.dep.mk Wed Aug 8 18:48:40 2018 (r337480) +++ stable/11/share/mk/bsd.dep.mk Wed Aug 8 18:50:32 2018 (r337481) @@ -177,6 +177,7 @@ DEPEND_MP?= -MP # avoid collisions. DEPEND_FILTER= C,/,_,g DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +DEPENDSRCS+= ${DPSRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} .endif @@ -264,13 +265,12 @@ depend: beforedepend ${DEPENDFILE} afterdepend # Tell bmake not to look for generated files via .PATH .NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS} -DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in # beforedepend/_EXTRADEPEND/afterdepend The _EXTRADEPEND target is # ignored if using meta+filemon since it handles all dependencies. The other # targets are kept as they be used for generating something. The target is # kept to allow 'make depend' to generate files. -${DEPENDFILE}: ${DPSRCS} +${DEPENDFILE}: ${SRCS} ${DPSRCS} .if exists(${.OBJDIR}/${DEPENDFILE}) || \ ((commands(beforedepend) || \ (!defined(_meta_filemon) && commands(_EXTRADEPEND)) || \ From owner-svn-src-all@freebsd.org Wed Aug 8 18:50:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E92C81066ECD; Wed, 8 Aug 2018 18:50:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 570118D23E; Wed, 8 Aug 2018 18:50:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39D476808; Wed, 8 Aug 2018 18:50:43 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IohRu040533; Wed, 8 Aug 2018 18:50:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Iohfh040532; Wed, 8 Aug 2018 18:50:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808081850.w78Iohfh040532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 8 Aug 2018 18:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337482 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 337482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:50:44 -0000 Author: asomers Date: Wed Aug 8 18:50:42 2018 New Revision: 337482 URL: https://svnweb.freebsd.org/changeset/base/337482 Log: Bring VOP_LOOKUP(9) up to date * Remove the cn_hash field (removed by r51906) * Add the cn_lkflags field (added by r144285) * Remove duplicate definition of cnp. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16629 Modified: head/share/man/man9/VOP_LOOKUP.9 Modified: head/share/man/man9/VOP_LOOKUP.9 ============================================================================== --- head/share/man/man9/VOP_LOOKUP.9 Wed Aug 8 18:50:32 2018 (r337481) +++ head/share/man/man9/VOP_LOOKUP.9 Wed Aug 8 18:50:42 2018 (r337482) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2017 +.Dd August 8, 2018 .Dt VOP_LOOKUP 9 .Os .Sh NAME @@ -51,10 +51,7 @@ The locked vnode of the directory to search. The address of a variable where the resulting locked vnode should be stored. .It Fa cnp The pathname component to be searched for. -.El -.Pp -.Fa Cnp -is a pointer to a componentname structure defined as follows: +It is a pointer to a componentname structure defined as follows: .Bd -literal struct componentname { /* @@ -64,13 +61,13 @@ struct componentname { u_long cn_flags; /* flags to namei */ struct thread *cn_thread; /* thread requesting lookup */ struct ucred *cn_cred; /* credentials */ + int cn_lkflags; /* Lock flags LK_EXCLUSIVE or LK_SHARED */ /* * Shared between lookup and commit routines. */ char *cn_pnbuf; /* pathname buffer */ char *cn_nameptr; /* pointer to looked up name */ long cn_namelen; /* length of looked up component */ - u_long cn_hash; /* hash value of looked up name */ }; .Ed .Pp From owner-svn-src-all@freebsd.org Wed Aug 8 18:51:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30CDB10670F6; Wed, 8 Aug 2018 18:51:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC4388D4A4; Wed, 8 Aug 2018 18:51:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEFD1694F; Wed, 8 Aug 2018 18:51:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IpdQr043541; Wed, 8 Aug 2018 18:51:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IpdXh043540; Wed, 8 Aug 2018 18:51:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808081851.w78IpdXh043540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Aug 2018 18:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337483 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 337483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:51:40 -0000 Author: kib Date: Wed Aug 8 18:51:39 2018 New Revision: 337483 URL: https://svnweb.freebsd.org/changeset/base/337483 Log: MFC r337055: Avoid assertion in /dev/ufssuspend when the suspend ioctl is (incorrectly) called while another suspension is already active. PR: 230220 Modified: stable/11/sys/ufs/ffs/ffs_suspend.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_suspend.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_suspend.c Wed Aug 8 18:50:42 2018 (r337482) +++ stable/11/sys/ufs/ffs/ffs_suspend.c Wed Aug 8 18:51:39 2018 (r337483) @@ -214,6 +214,31 @@ ffs_susp_suspend(struct mount *mp) } static void +ffs_susp_unsuspend(struct mount *mp) +{ + struct ufsmount *ump; + + sx_assert(&ffs_susp_lock, SA_XLOCKED); + + /* + * XXX: The status is kept per-process; the vfs_write_resume() routine + * asserts that the resuming thread is the same one that called + * vfs_write_suspend(). The cdevpriv data, however, is attached + * to the file descriptor, e.g. is inherited during fork. Thus, + * it's possible that the resuming process will be different from + * the one that started the suspension. + * + * Work around by fooling the check in vfs_write_resume(). + */ + mp->mnt_susp_owner = curthread; + + vfs_write_resume(mp, 0); + ump = VFSTOUFS(mp); + ump->um_writesuspended = 0; + vfs_unbusy(mp); +} + +static void ffs_susp_dtor(void *data) { struct fs *fs; @@ -239,22 +264,7 @@ ffs_susp_dtor(void *data) if (error != 0) panic("failed to unsuspend writes on %s", fs->fs_fsmnt); - /* - * XXX: The status is kept per-process; the vfs_write_resume() routine - * asserts that the resuming thread is the same one that called - * vfs_write_suspend(). The cdevpriv data, however, is attached - * to the file descriptor, e.g. is inherited during fork. Thus, - * it's possible that the resuming process will be different from - * the one that started the suspension. - * - * Work around by fooling the check in vfs_write_resume(). - */ - mp->mnt_susp_owner = curthread; - - vfs_write_resume(mp, 0); - vfs_unbusy(mp); - ump->um_writesuspended = 0; - + ffs_susp_unsuspend(mp); sx_xunlock(&ffs_susp_lock); } @@ -294,7 +304,8 @@ ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t a break; } error = devfs_set_cdevpriv(mp, ffs_susp_dtor); - KASSERT(error == 0, ("devfs_set_cdevpriv failed")); + if (error != 0) + ffs_susp_unsuspend(mp); break; case UFSRESUME: error = devfs_get_cdevpriv((void **)&mp); From owner-svn-src-all@freebsd.org Wed Aug 8 18:52:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68BC310671CD; Wed, 8 Aug 2018 18:52:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D57D8D6BE; Wed, 8 Aug 2018 18:52:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F412B699A; Wed, 8 Aug 2018 18:52:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IqbWn044578; Wed, 8 Aug 2018 18:52:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IqbjF044576; Wed, 8 Aug 2018 18:52:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081852.w78IqbjF044576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337484 - stable/11/lib/libc/locale X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/lib/libc/locale X-SVN-Commit-Revision: 337484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:52:38 -0000 Author: bdrewery Date: Wed Aug 8 18:52:37 2018 New Revision: 337484 URL: https://svnweb.freebsd.org/changeset/base/337484 Log: MFC r324103: __setrunelocale: Fix asprintf(3) failure not returning an error. Modified: stable/11/lib/libc/locale/collate.c stable/11/lib/libc/locale/setrunelocale.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/collate.c ============================================================================== --- stable/11/lib/libc/locale/collate.c Wed Aug 8 18:51:39 2018 (r337483) +++ stable/11/lib/libc/locale/collate.c Wed Aug 8 18:52:37 2018 (r337484) @@ -124,8 +124,7 @@ __collate_load_tables_l(const char *encoding, struct x return (_LDP_CACHE); } - asprintf(&buf, "%s/%s/LC_COLLATE", _PathLocale, encoding); - if (buf == NULL) + if (asprintf(&buf, "%s/%s/LC_COLLATE", _PathLocale, encoding) == -1) return (_LDP_ERROR); if ((fd = _open(buf, O_RDONLY)) < 0) { Modified: stable/11/lib/libc/locale/setrunelocale.c ============================================================================== --- stable/11/lib/libc/locale/setrunelocale.c Wed Aug 8 18:51:39 2018 (r337483) +++ stable/11/lib/libc/locale/setrunelocale.c Wed Aug 8 18:52:37 2018 (r337484) @@ -110,9 +110,8 @@ __setrunelocale(struct xlocale_ctype *l, const char *e } /* Range checking not needed, encoding length already checked before */ - asprintf(&path, "%s/%s/LC_CTYPE", _PathLocale, encoding); - if (path == NULL) - return (0); + if (asprintf(&path, "%s/%s/LC_CTYPE", _PathLocale, encoding) == -1) + return (errno); if ((rl = _Read_RuneMagi(path)) == NULL) { free(path); From owner-svn-src-all@freebsd.org Wed Aug 8 18:53:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C05851067263; Wed, 8 Aug 2018 18:53:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 779968D80B; Wed, 8 Aug 2018 18:53:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A32F699C; Wed, 8 Aug 2018 18:53:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Ira10044675; Wed, 8 Aug 2018 18:53:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IrZKt044670; Wed, 8 Aug 2018 18:53:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081853.w78IrZKt044670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337485 - stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise X-SVN-Commit-Revision: 337485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:53:37 -0000 Author: bdrewery Date: Wed Aug 8 18:53:34 2018 New Revision: 337485 URL: https://svnweb.freebsd.org/changeset/base/337485 Log: MFC r323620: Fix the raise tests. Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Wed Aug 8 18:53:34 2018 (r337485) @@ -35,13 +35,13 @@ main(int argc, char **argv) sigset_t ss; (void) sigemptyset(&ss); - (void) sigaddset(&ss, SIGINT); + (void) sigaddset(&ss, SIGUSR1); (void) sigprocmask(SIG_BLOCK, &ss, NULL); do { (void) getpid(); (void) sigpending(&ss); - } while (!sigismember(&ss, SIGINT)); + } while (!sigismember(&ss, SIGUSR1)); return (0); } Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d Wed Aug 8 18:53:34 2018 (r337485) @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Wed Aug 8 18:53:34 2018 (r337485) @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d Wed Aug 8 18:53:34 2018 (r337485) @@ -47,7 +47,7 @@ syscall::getpid:return /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:return } syscall::exit:entry +/pid == $1/ { exit(0); } Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Wed Aug 8 18:53:34 2018 (r337485) @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); Modified: stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Wed Aug 8 18:52:37 2018 (r337484) +++ stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Wed Aug 8 18:53:34 2018 (r337485) @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } From owner-svn-src-all@freebsd.org Wed Aug 8 18:54:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DCC810672D4; Wed, 8 Aug 2018 18:54:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7ABF8D939; Wed, 8 Aug 2018 18:54:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA4F8699D; Wed, 8 Aug 2018 18:54:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Is6fQ044751; Wed, 8 Aug 2018 18:54:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Is5qJ044746; Wed, 8 Aug 2018 18:54:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081854.w78Is5qJ044746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337486 - stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise X-SVN-Group: stable-10 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise X-SVN-Commit-Revision: 337486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:54:07 -0000 Author: bdrewery Date: Wed Aug 8 18:54:05 2018 New Revision: 337486 URL: https://svnweb.freebsd.org/changeset/base/337486 Log: MFC r323620: Fix the raise tests. Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c Wed Aug 8 18:54:05 2018 (r337486) @@ -35,13 +35,13 @@ main(int argc, char **argv) sigset_t ss; (void) sigemptyset(&ss); - (void) sigaddset(&ss, SIGINT); + (void) sigaddset(&ss, SIGUSR1); (void) sigprocmask(SIG_BLOCK, &ss, NULL); do { (void) getpid(); (void) sigpending(&ss); - } while (!sigismember(&ss, SIGINT)); + } while (!sigismember(&ss, SIGUSR1)); return (0); } Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d Wed Aug 8 18:54:05 2018 (r337486) @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c Wed Aug 8 18:54:05 2018 (r337486) @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d Wed Aug 8 18:54:05 2018 (r337486) @@ -47,7 +47,7 @@ syscall::getpid:return /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:return } syscall::exit:entry +/pid == $1/ { exit(0); } Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c Wed Aug 8 18:54:05 2018 (r337486) @@ -45,7 +45,7 @@ main(int argc, char **argv) sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - (void) sigaction(SIGINT, &sa, NULL); + (void) sigaction(SIGUSR1, &sa, NULL); for (;;) { (void) getpid(); Modified: stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Wed Aug 8 18:53:34 2018 (r337485) +++ stable/10/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d Wed Aug 8 18:54:05 2018 (r337486) @@ -47,7 +47,7 @@ syscall::getpid:entry /pid == $1/ { trace("raised"); - raise(SIGINT); + raise(SIGUSR1); /* * Wait no more than half a second for the process to die. */ @@ -55,6 +55,7 @@ syscall::getpid:entry } syscall::exit:entry +/pid == $1/ { exit(0); } From owner-svn-src-all@freebsd.org Wed Aug 8 18:55:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA7D810673A0; Wed, 8 Aug 2018 18:55:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71A188DAAC; Wed, 8 Aug 2018 18:55:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 537BD699F; Wed, 8 Aug 2018 18:55:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78ItX91044896; Wed, 8 Aug 2018 18:55:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78ItXhK044895; Wed, 8 Aug 2018 18:55:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081855.w78ItXhK044895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337487 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 337487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:55:33 -0000 Author: bdrewery Date: Wed Aug 8 18:55:32 2018 New Revision: 337487 URL: https://svnweb.freebsd.org/changeset/base/337487 Log: MFC r322565,r323323: r322565: Use -S for library installations except for -DNO_ROOT builds. r323323: Tweak comment for install -S usage since it does not impact the build. Modified: stable/11/share/mk/bsd.lib.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.lib.mk ============================================================================== --- stable/11/share/mk/bsd.lib.mk Wed Aug 8 18:54:05 2018 (r337486) +++ stable/11/share/mk/bsd.lib.mk Wed Aug 8 18:55:32 2018 (r337487) @@ -319,6 +319,11 @@ _EXTRADEPEND: .if !defined(NO_FSCHG) SHLINSTALLFLAGS+= -fschg .endif +.endif +# Install libraries with -S to avoid risk of modifying in-use libraries when +# installing to a running system. It is safe to avoid this for NO_ROOT builds +# that are only creating an image. +.if !defined(NO_SAFE_LIBINSTALL) && !defined(NO_ROOT) SHLINSTALLFLAGS+= -S .endif From owner-svn-src-all@freebsd.org Wed Aug 8 18:56:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A373A106756B; Wed, 8 Aug 2018 18:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ABB68DC65; Wed, 8 Aug 2018 18:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B61469A0; Wed, 8 Aug 2018 18:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IuZOU044990; Wed, 8 Aug 2018 18:56:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IuZUh044989; Wed, 8 Aug 2018 18:56:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081856.w78IuZUh044989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337488 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:56:35 -0000 Author: bdrewery Date: Wed Aug 8 18:56:34 2018 New Revision: 337488 URL: https://svnweb.freebsd.org/changeset/base/337488 Log: MFC r321492: Only build libzfs_core in 'make libraries' if needed. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 18:55:32 2018 (r337487) +++ stable/11/Makefile.inc1 Wed Aug 8 18:56:34 2018 (r337488) @@ -2176,10 +2176,12 @@ _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib_libavl= cddl/lib/libavl _cddl_lib_libuutil= cddl/lib/libuutil +.if ${MK_ZFS} != "no" _cddl_lib_libzfs_core= cddl/lib/libzfs_core +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L +.endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib -cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L cddl/lib/libzfs__L: lib/libgeom__L cddl/lib/libctf__L: lib/libz__L .endif From owner-svn-src-all@freebsd.org Wed Aug 8 18:58:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41ED6106764D; Wed, 8 Aug 2018 18:58:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E77108DDC6; Wed, 8 Aug 2018 18:58:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA41A69A4; Wed, 8 Aug 2018 18:58:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Iw930045108; Wed, 8 Aug 2018 18:58:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Iw9W4045107; Wed, 8 Aug 2018 18:58:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081858.w78Iw9W4045107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337489 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:58:10 -0000 Author: bdrewery Date: Wed Aug 8 18:58:09 2018 New Revision: 337489 URL: https://svnweb.freebsd.org/changeset/base/337489 Log: MFC r321491: Remove unneeded dependency for libzfs. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 18:56:34 2018 (r337488) +++ stable/11/Makefile.inc1 Wed Aug 8 18:58:09 2018 (r337489) @@ -2182,7 +2182,6 @@ cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L .endif _cddl_lib_libctf= cddl/lib/libctf _cddl_lib= cddl/lib -cddl/lib/libzfs__L: lib/libgeom__L cddl/lib/libctf__L: lib/libz__L .endif # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built From owner-svn-src-all@freebsd.org Wed Aug 8 18:59:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A27341067742; Wed, 8 Aug 2018 18:59:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 595D38DF92; Wed, 8 Aug 2018 18:59:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BAD669A5; Wed, 8 Aug 2018 18:59:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IxNX3045206; Wed, 8 Aug 2018 18:59:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IxNe7045205; Wed, 8 Aug 2018 18:59:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081859.w78IxNe7045205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337490 - stable/11/lib/libc/tests/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/lib/libc/tests/sys X-SVN-Commit-Revision: 337490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:59:23 -0000 Author: bdrewery Date: Wed Aug 8 18:59:22 2018 New Revision: 337490 URL: https://svnweb.freebsd.org/changeset/base/337490 Log: MFC r321333: Properly set userid for truncate_test. Modified: stable/11/lib/libc/tests/sys/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/sys/Makefile ============================================================================== --- stable/11/lib/libc/tests/sys/Makefile Wed Aug 8 18:58:09 2018 (r337489) +++ stable/11/lib/libc/tests/sys/Makefile Wed Aug 8 18:59:22 2018 (r337490) @@ -87,7 +87,7 @@ FILESGROUPS+= truncate_test_FILES truncate_test_FILES= truncate_test.root_owned truncate_test_FILESDIR= ${TESTSDIR} truncate_test_FILESMODE= 0600 -truncate_test_FILESOWNER= root +truncate_test_FILESOWN= root truncate_test_FILESGRP= wheel truncate_test_FILESPACKAGE= ${PACKAGE} From owner-svn-src-all@freebsd.org Wed Aug 8 18:59:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDED9106775D; Wed, 8 Aug 2018 18:59:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A54B98DF98; Wed, 8 Aug 2018 18:59:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8760369A6; Wed, 8 Aug 2018 18:59:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78IxPxW045252; Wed, 8 Aug 2018 18:59:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78IxPkR045251; Wed, 8 Aug 2018 18:59:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081859.w78IxPkR045251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 18:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337491 - stable/10/lib/libc/tests/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/10/lib/libc/tests/sys X-SVN-Commit-Revision: 337491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 18:59:26 -0000 Author: bdrewery Date: Wed Aug 8 18:59:25 2018 New Revision: 337491 URL: https://svnweb.freebsd.org/changeset/base/337491 Log: MFC r321333: Properly set userid for truncate_test. Modified: stable/10/lib/libc/tests/sys/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/sys/Makefile ============================================================================== --- stable/10/lib/libc/tests/sys/Makefile Wed Aug 8 18:59:22 2018 (r337490) +++ stable/10/lib/libc/tests/sys/Makefile Wed Aug 8 18:59:25 2018 (r337491) @@ -86,7 +86,7 @@ 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_FILESOWN= root truncate_test_FILESGRP= wheel CLEANFILES= truncate_test.root_owned From owner-svn-src-all@freebsd.org Wed Aug 8 19:00:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C24A1067A2A; Wed, 8 Aug 2018 19:00:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 332438E2C4; Wed, 8 Aug 2018 19:00:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1451B69C3; Wed, 8 Aug 2018 19:00:54 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78J0rNJ049252; Wed, 8 Aug 2018 19:00:53 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78J0rfT049251; Wed, 8 Aug 2018 19:00:53 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081900.w78J0rfT049251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337492 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:00:54 -0000 Author: bdrewery Date: Wed Aug 8 19:00:53 2018 New Revision: 337492 URL: https://svnweb.freebsd.org/changeset/base/337492 Log: MFC r320286: compiler-metadata: Properly handle cross-build OBJDIR. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 18:59:25 2018 (r337491) +++ stable/11/Makefile.inc1 Wed Aug 8 19:00:53 2018 (r337492) @@ -783,7 +783,7 @@ _cross-tools: @echo "--------------------------------------------------------------" @echo ">>> stage 3: cross tools" @echo "--------------------------------------------------------------" - @rm -f ${.OBJDIR}/compiler-metadata.mk + @rm -f ${OBJTREE}${.CURDIR}/compiler-metadata.mk ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools _compiler-metadata: From owner-svn-src-all@freebsd.org Wed Aug 8 19:03:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BEA31067B85; Wed, 8 Aug 2018 19:03:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 151938E6D9; Wed, 8 Aug 2018 19:03:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB8476B33; Wed, 8 Aug 2018 19:03:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78J36mb050286; Wed, 8 Aug 2018 19:03:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78J363i050285; Wed, 8 Aug 2018 19:03:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081903.w78J363i050285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337493 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 337493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:03:07 -0000 Author: bdrewery Date: Wed Aug 8 19:03:06 2018 New Revision: 337493 URL: https://svnweb.freebsd.org/changeset/base/337493 Log: MFC r320191: objwarn should be .PHONY. Modified: stable/11/share/mk/bsd.obj.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.obj.mk ============================================================================== --- stable/11/share/mk/bsd.obj.mk Wed Aug 8 19:00:53 2018 (r337492) +++ stable/11/share/mk/bsd.obj.mk Wed Aug 8 19:03:06 2018 (r337493) @@ -102,7 +102,7 @@ OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} # case 2 (using MAKEOBJDIR), don't issue a warning. Otherwise, # issue a warning differentiating between cases 6 and (3 or 4). # -objwarn: +objwarn: .PHONY .if !defined(NO_OBJ) && ${.OBJDIR} != ${CANONICALOBJDIR} && \ !(defined(MAKEOBJDIRPREFIX) && exists(${CANONICALOBJDIR}/)) && \ !(defined(MAKEOBJDIR) && exists(${MAKEOBJDIR}/)) From owner-svn-src-all@freebsd.org Wed Aug 8 19:15:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E6B10680CF; Wed, 8 Aug 2018 19:15:46 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F188D8F0C9; Wed, 8 Aug 2018 19:15:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2A976CCC; Wed, 8 Aug 2018 19:15:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JFjFA056130; Wed, 8 Aug 2018 19:15:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JFj6V056129; Wed, 8 Aug 2018 19:15:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081915.w78JFj6V056129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337494 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:15:46 -0000 Author: bdrewery Date: Wed Aug 8 19:15:45 2018 New Revision: 337494 URL: https://svnweb.freebsd.org/changeset/base/337494 Log: DIRS: Ensure existing directory still has permissions set. Modified: head/share/mk/bsd.dirs.mk Modified: head/share/mk/bsd.dirs.mk ============================================================================== --- head/share/mk/bsd.dirs.mk Wed Aug 8 19:03:06 2018 (r337493) +++ head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:45 2018 (r337494) @@ -28,9 +28,9 @@ ${dir}TAG_ARGS= -T ${${dir}TAGS:[*]:S/ /,/g} installdirs: installdirs-${dir} -installdirs-${dir}: ${DESTDIR}${${dir}} +installdirs-${dir}: installdirs-${DESTDIR}${${dir}} -${DESTDIR}${${dir}}: +installdirs-${DESTDIR}${${dir}}: @${ECHO} installing DIRS ${dir} ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \ -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}} From owner-svn-src-all@freebsd.org Wed Aug 8 19:15:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE68810680EE; Wed, 8 Aug 2018 19:15:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 660E48F0D2; Wed, 8 Aug 2018 19:15:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4877B6CCE; Wed, 8 Aug 2018 19:15:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JFnew056343; Wed, 8 Aug 2018 19:15:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JFnrm056342; Wed, 8 Aug 2018 19:15:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081915.w78JFnrm056342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337495 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:15:49 -0000 Author: bdrewery Date: Wed Aug 8 19:15:48 2018 New Revision: 337495 URL: https://svnweb.freebsd.org/changeset/base/337495 Log: DIRS: Fix duplicate target warnings. Modified: head/share/mk/bsd.dirs.mk Modified: head/share/mk/bsd.dirs.mk ============================================================================== --- head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:45 2018 (r337494) +++ head/share/mk/bsd.dirs.mk Wed Aug 8 19:15:48 2018 (r337495) @@ -30,10 +30,12 @@ installdirs: installdirs-${dir} installdirs-${dir}: installdirs-${DESTDIR}${${dir}} +. if !target(installdirs-${DESTDIR}${${dir}}) installdirs-${DESTDIR}${${dir}}: @${ECHO} installing DIRS ${dir} ${INSTALL} ${${dir}TAG_ARGS} -d -m ${${dir}_MODE} -o ${${dir}_OWN} \ -g ${${dir}_GRP} ${${dir}_FLAG} ${DESTDIR}${${dir}} +. endif . endif realinstall: installdirs-${dir} From owner-svn-src-all@freebsd.org Wed Aug 8 19:21:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79DC7106848F; Wed, 8 Aug 2018 19:21:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 318AC8F6A5; Wed, 8 Aug 2018 19:21:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1436E6D02; Wed, 8 Aug 2018 19:21:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JL8TO057481; Wed, 8 Aug 2018 19:21:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JL8xg057480; Wed, 8 Aug 2018 19:21:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081921.w78JL8xg057480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337496 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:21:09 -0000 Author: bdrewery Date: Wed Aug 8 19:21:08 2018 New Revision: 337496 URL: https://svnweb.freebsd.org/changeset/base/337496 Log: MFC r320274: Set compiler metadata for stageworld/distributeworld. PR: 212877 Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 19:15:48 2018 (r337495) +++ stable/11/Makefile.inc1 Wed Aug 8 19:21:08 2018 (r337496) @@ -85,7 +85,8 @@ OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} # Pull in compiler metadata from buildworld/toolchain if possible to avoid # running CC from bsd.compiler.mk. -.if make(installworld) || make(install) +.if make(installworld) || make(install) || make(distributeworld) || \ + make(stageworld) .-include "${OBJTREE}${.CURDIR}/compiler-metadata.mk" .if !defined(_LOADED_COMPILER_METADATA) .error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. From owner-svn-src-all@freebsd.org Wed Aug 8 19:24:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 875051068605; Wed, 8 Aug 2018 19:24:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CF378FA6F; Wed, 8 Aug 2018 19:24:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 062D26E75; Wed, 8 Aug 2018 19:24:25 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JOPCk061388; Wed, 8 Aug 2018 19:24:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JOKLP061364; Wed, 8 Aug 2018 19:24:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201808081924.w78JOKLP061364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 8 Aug 2018 19:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin... X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin/msgs usr.sbin/freebsd-up... X-SVN-Commit-Revision: 337497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:24:25 -0000 Author: asomers Date: Wed Aug 8 19:24:20 2018 New Revision: 337497 URL: https://svnweb.freebsd.org/changeset/base/337497 Log: Switch the default pager for most commands to less Finally, a pager for the nineties. MFC after: Never Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D13465 Poll: https://reviews.freebsd.org/V7 Modified: head/UPDATING head/contrib/mdocml/apropos.1 head/contrib/mdocml/main.c head/contrib/mdocml/man.1 head/contrib/mdocml/mandoc.1 head/contrib/tnftp/src/ftp_var.h head/etc/root/dot.cshrc head/etc/root/dot.profile head/share/skel/dot.cshrc head/share/skel/dot.mailrc head/share/skel/dot.profile head/tools/tools/nanobsd/pcengines/Files/root/.cshrc head/tools/tools/nanobsd/rescue/Files/root/.cshrc head/usr.bin/mail/cmd1.c head/usr.bin/mail/mail.1 head/usr.bin/mail/pathnames.h head/usr.bin/man/man.1 head/usr.bin/man/man.sh head/usr.bin/msgs/msgs.1 head/usr.bin/msgs/pathnames.h head/usr.sbin/freebsd-update/freebsd-update.sh head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mergemaster/mergemaster.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Aug 8 19:21:08 2018 (r337496) +++ head/UPDATING Wed Aug 8 19:24:20 2018 (r337497) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20180808: + The default pager for most commands has been changed to "less". To + restore the old behavior, set PAGER="more" and MANPAGER="more -s" in + your environment. + 20180731: The jedec_ts(4) driver has been removed. A superset of its functionality is available in the jedec_dimm(4) driver, and the manpage for that Modified: head/contrib/mdocml/apropos.1 ============================================================================== --- head/contrib/mdocml/apropos.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/apropos.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 4 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt APROPOS 1 .Os .Sh NAME @@ -74,7 +74,7 @@ would. If the standard output is a terminal device and .Fl c is not specified, use -.Xr more 1 +.Xr less 1 to paginate them. In .Fl a @@ -334,7 +334,7 @@ Text production: Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 ; +.Xr less 1 ; see .Xr man 1 for details. @@ -357,7 +357,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/mdocml/main.c ============================================================================== --- head/contrib/mdocml/main.c Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/main.c Wed Aug 8 19:24:20 2018 (r337497) @@ -1119,7 +1119,7 @@ spawn_pager(struct tag_files *tag_files) if (pager == NULL || *pager == '\0') pager = getenv("PAGER"); if (pager == NULL || *pager == '\0') - pager = "more -s"; + pager = "less -s"; cp = mandoc_strdup(pager); /* Modified: head/contrib/mdocml/man.1 ============================================================================== --- head/contrib/mdocml/man.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/man.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -31,7 +31,7 @@ .\" .\" @(#)man.1 8.2 (Berkeley) 1/2/94 .\" -.Dd $Mdocdate: May 17 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt MAN 1 .Os .Sh NAME @@ -75,7 +75,7 @@ See for a description of the contents of this file. .It Fl c Copy the manual page to the standard output instead of using -.Xr more 1 +.Xr less 1 to paginate it. This is done by default if the standard output is not a terminal device. .It Fl f @@ -233,7 +233,7 @@ is case insensitive. Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 . +.Xr less 1 . If .Xr less 1 is used, the interactive @@ -282,7 +282,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/mdocml/mandoc.1 ============================================================================== --- head/contrib/mdocml/mandoc.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/mdocml/mandoc.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 20 2017 $ +.Dd $Mdocdate: August 8 2018 $ .Dt MANDOC 1 .Os .Sh NAME @@ -54,13 +54,13 @@ The options are as follows: If the standard output is a terminal device and .Fl c is not specified, use -.Xr more 1 +.Xr less 1 to paginate the output, just like .Xr man 1 would. .It Fl c Copy the formatted manual pages to the standard output without using -.Xr more 1 +.Xr less 1 to paginate them. This is the default. It can be specified to override @@ -578,7 +578,7 @@ Meta data is not available in this case. Any non-empty value of the environment variable .Ev MANPAGER is used instead of the standard pagination program, -.Xr more 1 ; +.Xr less 1 ; see .Xr man 1 for details. @@ -592,7 +592,7 @@ Specifies the pagination program to use when .Ev MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, -.Xr more 1 +.Xr less 1 .Fl s is used. Only used if Modified: head/contrib/tnftp/src/ftp_var.h ============================================================================== --- head/contrib/tnftp/src/ftp_var.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/contrib/tnftp/src/ftp_var.h Wed Aug 8 19:24:20 2018 (r337497) @@ -189,7 +189,7 @@ enum { #define GATE_SERVER "" /* default server */ #endif -#define DEFAULTPAGER "more" /* default pager if $PAGER isn't set */ +#define DEFAULTPAGER "less" /* default pager if $PAGER isn't set */ #define DEFAULTPROMPT "ftp> " /* default prompt if `set prompt' is empty */ #define DEFAULTRPROMPT "" /* default rprompt if `set rprompt' is empty */ Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/etc/root/dot.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER more +setenv PAGER less setenv BLOCKSIZE K if ($?prompt) then Modified: head/etc/root/dot.profile ============================================================================== --- head/etc/root/dot.profile Wed Aug 8 19:21:08 2018 (r337496) +++ head/etc/root/dot.profile Wed Aug 8 19:24:20 2018 (r337497) @@ -6,7 +6,7 @@ HOME=/root export HOME TERM=${TERM:-xterm} export TERM -PAGER=more +PAGER=less export PAGER # Query terminal size; useful for serial lines. Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -20,7 +20,7 @@ alias ll ls -lAF # umask 22 setenv EDITOR vi -setenv PAGER more +setenv PAGER less if ($?prompt) then # An interactive shell -- set some stuff up Modified: head/share/skel/dot.mailrc ============================================================================== --- head/share/skel/dot.mailrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.mailrc Wed Aug 8 19:24:20 2018 (r337497) @@ -7,7 +7,7 @@ set append ask autoprint set indentprefix="> " -set PAGER=more +set PAGER=less set EDITOR=vi set VISUAL=vi set folder=Mail Modified: head/share/skel/dot.profile ============================================================================== --- head/share/skel/dot.profile Wed Aug 8 19:21:08 2018 (r337496) +++ head/share/skel/dot.profile Wed Aug 8 19:24:20 2018 (r337497) @@ -16,7 +16,7 @@ # TERM=xterm; export TERM EDITOR=vi; export EDITOR -PAGER=more; export PAGER +PAGER=less; export PAGER # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV Modified: head/tools/tools/nanobsd/pcengines/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -17,7 +17,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER more +setenv PAGER less setenv BLOCKSIZE K if ($?prompt) then Modified: head/tools/tools/nanobsd/rescue/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/rescue/Files/root/.cshrc Wed Aug 8 19:21:08 2018 (r337496) +++ head/tools/tools/nanobsd/rescue/Files/root/.cshrc Wed Aug 8 19:24:20 2018 (r337497) @@ -8,13 +8,13 @@ a la ls -a a lf ls -FA a ll ls -lA - a lm 'll | more' - a m more + a lm 'll | less' + a m less set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin /usr/local/jdk1.6.0/bin /usr/local/jdk1.5.0/bin $HOME/bin) setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man" -setenv PAGER more +setenv PAGER less setenv EDITOR vi setenv BLOCKSIZE K setenv FTP_PASSIVE_MODE YES Modified: head/usr.bin/mail/cmd1.c ============================================================================== --- head/usr.bin/mail/cmd1.c Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/cmd1.c Wed Aug 8 19:24:20 2018 (r337497) @@ -311,7 +311,7 @@ type1(int *msgvec, int doign, int page) if (page || nlines > (*cp ? atoi(cp) : realscreenheight)) { cp = value("PAGER"); if (cp == NULL || *cp == '\0') - cp = _PATH_MORE; + cp = _PATH_LESS; obuf = Popen(cp, "w"); if (obuf == NULL) { warnx("%s", cp); Modified: head/usr.bin/mail/mail.1 ============================================================================== --- head/usr.bin/mail/mail.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/mail.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -28,7 +28,7 @@ .\" @(#)mail.1 8.8 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd January 5, 2006 +.Dd August 8, 2018 .Dt MAIL 1 .Os .Sh NAME @@ -1188,7 +1188,7 @@ command or when .Va crt variable is set. The default paginator -.Xr more 1 +.Xr less 1 is used if this option is not defined. .It Ev REPLYTO If set, will be used to initialize the Reply-To field for outgoing Modified: head/usr.bin/mail/pathnames.h ============================================================================== --- head/usr.bin/mail/pathnames.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/mail/pathnames.h Wed Aug 8 19:24:20 2018 (r337497) @@ -37,4 +37,4 @@ #define _PATH_HELP "/usr/share/misc/mail.help" #define _PATH_TILDE "/usr/share/misc/mail.tildehelp" #define _PATH_MASTER_RC "/usr/share/misc/mail.rc:/usr/local/etc/mail.rc:/etc/mail.rc" -#define _PATH_MORE "/usr/bin/more" +#define _PATH_LESS "/usr/bin/less" Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/man/man.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2018 +.Dd August 8, 2018 .Dt MAN 1 .Os .Sh NAME @@ -106,7 +106,7 @@ Use specified pager. Defaults to .Dq Li "less -sR" if color support is enabled, or -.Dq Li "more -s" . +.Dq Li "less -s" . Overrides the .Ev MANPAGER environment variable, which in turn overrides the @@ -345,7 +345,7 @@ If unset, and color support is disabled, then .Ev PAGER is used. If that has no value either, -.Dq Li "more -s" +.Dq Li "less -s" is used. .El .Sh FILES Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/man/man.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -901,7 +901,7 @@ setup_pager() { if [ -n "$PAGER" ]; then MANPAGER="$PAGER" else - MANPAGER="more -s" + MANPAGER="less -s" fi fi fi Modified: head/usr.bin/msgs/msgs.1 ============================================================================== --- head/usr.bin/msgs/msgs.1 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/msgs/msgs.1 Wed Aug 8 19:24:20 2018 (r337497) @@ -28,7 +28,7 @@ .\" @(#)msgs.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd April 28, 1995 +.Dd August 8, 2018 .Dt MSGS 1 .Os .Sh NAME @@ -196,7 +196,7 @@ messages back from the one indicated in the file, useful for reviews of recent messages. .It Fl p Pipe long messages through -.Xr more 1 . +.Xr less 1 . .El .Pp Within @@ -222,7 +222,7 @@ number of next message to be presented .El .Sh SEE ALSO .Xr mail 1 , -.Xr more 1 , +.Xr less 1 , .Xr aliases 5 , .Xr periodic 8 .Sh HISTORY Modified: head/usr.bin/msgs/pathnames.h ============================================================================== --- head/usr.bin/msgs/pathnames.h Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.bin/msgs/pathnames.h Wed Aug 8 19:24:20 2018 (r337497) @@ -35,6 +35,6 @@ #define _PATH_MSGS "/var/msgs" #define _PATH_MAIL "/usr/bin/Mail -f %s" -#define _PATH_PAGER "/usr/bin/more -%d" +#define _PATH_PAGER "/usr/bin/less -%d" #undef _PATH_TMP #define _PATH_TMP "/tmp/msgXXXXXX" Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -3300,7 +3300,7 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} # Set a pager if the user doesn't if [ -z "$PAGER" ]; then - PAGER=/usr/bin/more + PAGER=/usr/bin/less fi # Set LC_ALL in order to avoid problems with character ranges like [A-Z]. Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/mergemaster/mergemaster.8 Wed Aug 8 19:24:20 2018 (r337497) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 6, 2017 +.Dd August 8, 2018 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -299,7 +299,7 @@ utility uses the .Ev PAGER environment variable if set. Otherwise it uses -.Xr more 1 . +.Xr less 1 . If .Ev PAGER specifies a program outside @@ -451,7 +451,7 @@ comparison, use: .Sh SEE ALSO .Xr diff 1 , .Xr make 1 , -.Xr more 1 , +.Xr less 1 , .Xr sdiff 1 , .Xr pwd_mkdb 8 .Pp Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Wed Aug 8 19:21:08 2018 (r337496) +++ head/usr.sbin/mergemaster/mergemaster.sh Wed Aug 8 19:24:20 2018 (r337497) @@ -426,19 +426,19 @@ check_pager () { echo '' echo " or you may type an absolute path to PAGER for this run" echo '' - echo " Default is to use plain old 'more' " + echo " Default is to use 'less' " echo '' - echo -n "What should I do? [Use 'more'] " + echo -n "What should I do? [Use 'less'] " read FIXPAGER case "${FIXPAGER}" in [eE]) exit 0 ;; - [lL]) + [lL]|'') PAGER=less ;; - [mM]|'') + [mM]) PAGER=more ;; /*) @@ -458,11 +458,11 @@ check_pager () { esac # If user has a pager defined, or got assigned one above, use it. -# If not, use more. +# If not, use less. # -PAGER=${PAGER:-more} +PAGER=${PAGER:-less} -if [ -n "${VERBOSE}" -a ! "${PAGER}" = "more" ]; then +if [ -n "${VERBOSE}" -a ! "${PAGER}" = "less" ]; then echo " *** You have ${PAGER} defined as your pager so we will use that" echo '' sleep 3 @@ -1127,7 +1127,7 @@ for COMPFILE in `find . -type f | sort`; do else # Ok, the files are different, so show the user where they differ. # Use user's choice of diff methods; and user's pager if they have one. - # Use more if not. + # Use less if not. # Use unified diffs by default. Context diffs give me a headache. :) # # If the user chose the -F option, test for that before proceeding From owner-svn-src-all@freebsd.org Wed Aug 8 19:32:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 907F31068A21; Wed, 8 Aug 2018 19:32:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480A490183; Wed, 8 Aug 2018 19:32:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F0DB7026; Wed, 8 Aug 2018 19:32:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JWSGn067083; Wed, 8 Aug 2018 19:32:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JWSjK067082; Wed, 8 Aug 2018 19:32:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081932.w78JWSjK067082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337498 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:32:29 -0000 Author: bdrewery Date: Wed Aug 8 19:32:28 2018 New Revision: 337498 URL: https://svnweb.freebsd.org/changeset/base/337498 Log: Revert r325808 (MFC r322401) to re-MFC with larger set Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 19:24:20 2018 (r337497) +++ stable/11/Makefile.inc1 Wed Aug 8 19:32:28 2018 (r337498) @@ -1371,24 +1371,20 @@ packagekernel: .PHONY @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz -.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz -.endif .endfor .endif .else @@ -1397,21 +1393,17 @@ packagekernel: .PHONY tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif -.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz -.endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz -.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz -.endif .endfor .endif .endif @@ -1489,10 +1481,7 @@ create-world-packages: _pkgbootstrap .PHONY create-kernel-packages: _pkgbootstrap .PHONY .if exists(${KSTAGEDIR}/kernel.meta) -.if ${MK_DEBUG_FILES} != "no" -_debug=-debug -.endif -.for flavor in "" ${_debug} +.for flavor in "" -debug @cd ${KSTAGEDIR}/${DISTDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ -v kernel=yes -v _kernconf=${INSTALLKERNEL} \ @@ -1522,10 +1511,7 @@ _debug=-debug .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} .if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) -.if ${MK_DEBUG_FILES} != "no" -_debug=-debug -.endif -.for flavor in "" ${_debug} +.for flavor in "" -debug @cd ${KSTAGEDIR}/kernel.${_kernel} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ -v kernel=yes -v _kernconf=${_kernel} \ From owner-svn-src-all@freebsd.org Wed Aug 8 19:36:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D2F41068C48; Wed, 8 Aug 2018 19:36:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE071904DB; Wed, 8 Aug 2018 19:36:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 826BA702B; Wed, 8 Aug 2018 19:36:29 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78JaTpp067515; Wed, 8 Aug 2018 19:36:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78JaSpK067513; Wed, 8 Aug 2018 19:36:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808081936.w78JaSpK067513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 19:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337499 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 337499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 19:36:30 -0000 Author: bdrewery Date: Wed Aug 8 19:36:28 2018 New Revision: 337499 URL: https://svnweb.freebsd.org/changeset/base/337499 Log: MFC r320280,r320281,r320282,r320283,r320284,r320285,r320692,r322362,r322401,r322402,r336181: r320280: packages: Allow stageworld/stagekernel to run with make jobs. r320281: packages: Allow staging world/kernel in parallel. r320282: packages: Allow creating kernel/world packages in parallel. r320283: packages: Allow actually building individual world packages in parallel. r320284: packages: Parallelize individual kernel packaging. r320285: Expose only the create-packages-* targets since they set needed DEST/DIRDIR. r320692: Fix create-kernel-packages with multiple BUILDKERNELS after r320284 r322362: Indent nested conditionals for readability. r322401: Avoid creating kernel-dbg.txz distribution sets and kernel-debug packages when MK_DEBUG_FILES is 'no'. r322402: Fix indentation from r322401. r336181: Fix parsing of create-kernel-packages Modified: stable/11/Makefile stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile ============================================================================== --- stable/11/Makefile Wed Aug 8 19:32:28 2018 (r337498) +++ stable/11/Makefile Wed Aug 8 19:36:28 2018 (r337499) @@ -131,7 +131,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu build32 distribute32 install32 buildsoft distributesoft installsoft \ builddtb xdev xdev-build xdev-install \ xdev-links native-xtools stageworld stagekernel stage-packages \ - create-world-packages create-kernel-packages create-packages \ + create-packages-world create-packages-kernel create-packages \ packages installconfig real-packages sign-packages package-pkg \ print-dir test-system-compiler Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 8 19:32:28 2018 (r337498) +++ stable/11/Makefile.inc1 Wed Aug 8 19:36:28 2018 (r337499) @@ -1371,20 +1371,24 @@ packagekernel: .PHONY @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif +.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz +.endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz +.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --include '*/*/*.debug' \ @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz +.endif .endfor .endif .else @@ -1393,17 +1397,21 @@ packagekernel: .PHONY tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.txz .endif +.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel-dbg.txz +.endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" .for _kernel in ${BUILDKERNELS:[2..-1]} cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --exclude '*.debug' . | \ ${XZ_CMD} > ${PACKAGEDIR}/kernel.${_kernel}.txz +.if ${MK_DEBUG_FILES} != "no" cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ tar cvf - --include '*/*/*.debug' $$(eval find .) | \ ${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}-dbg.txz +.endif .endfor .endif .endif @@ -1439,49 +1447,80 @@ package-pkg: .PHONY real-packages: stage-packages create-packages sign-packages .PHONY -stage-packages: .PHONY - @mkdir -p ${REPODIR} ${WSTAGEDIR} ${KSTAGEDIR} +stage-packages-world: .PHONY + @mkdir -p ${WSTAGEDIR} ${_+_}@cd ${.CURDIR}; \ - ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT -B stageworld ; \ - ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT -B stagekernel + ${MAKE} DESTDIR=${WSTAGEDIR} -DNO_ROOT stageworld -create-packages: _pkgbootstrap .PHONY +stage-packages-kernel: .PHONY + @mkdir -p ${KSTAGEDIR} + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} DESTDIR=${KSTAGEDIR} -DNO_ROOT stagekernel + +stage-packages: .PHONY stage-packages-world stage-packages-kernel + +_repodir: .PHONY @mkdir -p ${REPODIR} + +create-packages-world: _pkgbootstrap _repodir .PHONY ${_+_}@cd ${.CURDIR}; \ - ${MAKE} DESTDIR=${WSTAGEDIR} \ - PKG_VERSION=${PKG_VERSION} create-world-packages ; \ - ${MAKE} DESTDIR=${KSTAGEDIR} \ + ${MAKE} -f Makefile.inc1 \ + DESTDIR=${WSTAGEDIR} \ + PKG_VERSION=${PKG_VERSION} create-world-packages + +create-packages-kernel: _pkgbootstrap _repodir .PHONY + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 \ + DESTDIR=${KSTAGEDIR} \ PKG_VERSION=${PKG_VERSION} DISTDIR=kernel \ create-kernel-packages +create-packages: .PHONY create-packages-world create-packages-kernel + create-world-packages: _pkgbootstrap .PHONY @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : @cd ${WSTAGEDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ ${WSTAGEDIR}/METALOG @for plist in ${WSTAGEDIR}/*.plist; do \ - plist=$${plist##*/} ; \ - pkgname=$${plist%.plist} ; \ - sh ${SRCDIR}/release/packages/generate-ucl.sh -o $${pkgname} \ - -s ${SRCDIR} -u ${WSTAGEDIR}/$${pkgname}.ucl ; \ - done - @for plist in ${WSTAGEDIR}/*.plist; do \ - plist=$${plist##*/} ; \ - pkgname=$${plist%.plist} ; \ - awk -F\" ' \ - /^name/ { printf("===> Creating %s-", $$2); next } \ - /^version/ { print $$2; next } \ - ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ - create -M ${WSTAGEDIR}/$${pkgname}.ucl \ - -p ${WSTAGEDIR}/$${pkgname}.plist \ - -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ - done + plist=$${plist##*/} ; \ + pkgname=$${plist%.plist} ; \ + echo "_PKGS+= $${pkgname}" ; \ + done > ${WSTAGEDIR}/packages.mk + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 create-world-packages-jobs \ + .MAKE.JOB.PREFIX= -create-kernel-packages: _pkgbootstrap .PHONY +.if make(create-world-packages-jobs) +.include "${WSTAGEDIR}/packages.mk" +.endif + +create-world-packages-jobs: .PHONY +.for pkgname in ${_PKGS} +create-world-packages-jobs: create-world-package-${pkgname} +create-world-package-${pkgname}: .PHONY + @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \ + -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl + @awk -F\" ' \ + /^name/ { printf("===> Creating %s-", $$2); next } \ + /^version/ { print $$2; next } \ + ' ${WSTAGEDIR}/${pkgname}.ucl ; \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + create -M ${WSTAGEDIR}/${pkgname}.ucl \ + -p ${WSTAGEDIR}/${pkgname}.plist \ + -r ${WSTAGEDIR} \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +.endfor + +_default_flavor= -default .if exists(${KSTAGEDIR}/kernel.meta) -.for flavor in "" -debug +. if ${MK_DEBUG_FILES} != "no" +_debug=-debug +. endif +create-kernel-packages: .PHONY +. for flavor in "" ${_debug} +create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},} +create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY @cd ${KSTAGEDIR}/${DISTDIR} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ -v kernel=yes -v _kernconf=${INSTALLKERNEL} \ @@ -1506,12 +1545,17 @@ create-kernel-packages: _pkgbootstrap .PHONY -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -.endfor +. endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" -.for _kernel in ${BUILDKERNELS:[2..-1]} -.if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) -.for flavor in "" -debug +. for _kernel in ${BUILDKERNELS:[2..-1]} +. if exists(${KSTAGEDIR}/kernel.${_kernel}.meta) +. if ${MK_DEBUG_FILES} != "no" +_debug=-debug +. endif +. for flavor in "" ${_debug} +create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel} +create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .PHONY @cd ${KSTAGEDIR}/kernel.${_kernel} ; \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ -v kernel=yes -v _kernconf=${_kernel} \ @@ -1536,9 +1580,9 @@ create-kernel-packages: _pkgbootstrap .PHONY -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -.endfor -.endif -.endfor +. endfor +. endif +. endfor .endif sign-packages: _pkgbootstrap .PHONY From owner-svn-src-all@freebsd.org Wed Aug 8 20:15:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A363E1069A24; Wed, 8 Aug 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57ACD91B42; Wed, 8 Aug 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34D7F7696; Wed, 8 Aug 2018 20:15:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78KFe4S088993; Wed, 8 Aug 2018 20:15:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KFeid088992; Wed, 8 Aug 2018 20:15:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808082015.w78KFeid088992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Aug 2018 20:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337500 - head/usr.sbin/route6d X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/route6d X-SVN-Commit-Revision: 337500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 20:15:41 -0000 Author: markj Date: Wed Aug 8 20:15:40 2018 New Revision: 337500 URL: https://svnweb.freebsd.org/changeset/base/337500 Log: Use the right variable when updating interface routes. PR: 229807 Submitted by: John Hay MFC after: 2 weeks Modified: head/usr.sbin/route6d/route6d.c Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Wed Aug 8 19:36:28 2018 (r337499) +++ head/usr.sbin/route6d/route6d.c Wed Aug 8 20:15:40 2018 (r337500) @@ -2223,8 +2223,10 @@ ifrt(struct ifc *ifcp, int again) goto next; } - TAILQ_REMOVE(&riprt_head, rrt, rrt_next); - delroute(&rrt->rrt_info, &rrt->rrt_gw); + TAILQ_REMOVE(&riprt_head, search_rrt, rrt_next); + delroute(&search_rrt->rrt_info, + &search_rrt->rrt_gw); + free(search_rrt); } /* Attach the route to the list */ trace(1, "route: %s/%d: register route (%s)\n", From owner-svn-src-all@freebsd.org Wed Aug 8 20:21:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A8721069D75; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23E4991FA8; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0519A77E3; Wed, 8 Aug 2018 20:21:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78KLjEe090792; Wed, 8 Aug 2018 20:21:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KLjkJ090791; Wed, 8 Aug 2018 20:21:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808082021.w78KLjkJ090791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 8 Aug 2018 20:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337501 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 337501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 20:21:46 -0000 Author: rmacklem Date: Wed Aug 8 20:21:45 2018 New Revision: 337501 URL: https://svnweb.freebsd.org/changeset/base/337501 Log: Assorted fixes to handling of LayoutRecall callbacks, mostly error handling. After a re-read of the appropriate section of RFC5661, I decided that a few things should be changed related to LayoutRecall callback handling. Here are the things fixed by this patch. - For two of the three cases that LayoutRecall is done, I now think setting the clora_changed argument false is correct. - All errors other than NFSERR_DELAY returned by LayoutRecall appear permanent, so don't retry for any of them. (NFSERR_DELAY is retried by newnfs_request(), so it is not affected by this patch.) - Instead of waiting "forever" (actually until the process is SIGTERM'd) for Layouts to be returned during a mirror copy, fail and return ENXIO after about 1minute. Waiting for a C made sense when pnfsdscopymr() was done by itself, but did not make sense when done via find(1). This patch only affects the pNFS server. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Aug 8 20:15:40 2018 (r337500) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Wed Aug 8 20:21:45 2018 (r337501) @@ -220,8 +220,8 @@ static void nfsrv_freealldevids(void); static void nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, NFSPROC_T *p); static int nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *stateidp, - fhandle_t *fhp, struct nfslayout *lyp, struct nfslayouthead *lyheadp, - int laytype, NFSPROC_T *p); + fhandle_t *fhp, struct nfslayout *lyp, int changed, int laytype, + NFSPROC_T *p); static int nfsrv_findlayout(nfsquad_t *clientidp, fhandle_t *fhp, int laytype, NFSPROC_T *, struct nfslayout **lypp); static int nfsrv_fndclid(nfsquad_t *clidvec, nfsquad_t clid, int clidcnt); @@ -4234,6 +4234,8 @@ out: /* * Do a server callback. + * The "trunc" argument is slightly overloaded and refers to different + * boolean arguments for CBRECALL and CBLAYOUTRECALL. */ static int nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, @@ -4337,7 +4339,10 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, n NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(laytype); *tl++ = txdr_unsigned(NFSLAYOUTIOMODE_ANY); - *tl++ = newnfs_true; + if (trunc) + *tl++ = newnfs_true; + else + *tl++ = newnfs_false; *tl = txdr_unsigned(NFSV4LAYOUTRET_FILE); nfsm_fhtom(nd, (uint8_t *)fhp, NFSX_MYFH, 0); NFSM_BUILD(tl, u_int32_t *, 2 * NFSX_HYPER + NFSX_STATEID); @@ -6817,13 +6822,11 @@ nfsrv_flexmirrordel(char *devid, NFSPROC_T *p) /* * The layout stateid.seqid needs to be incremented * before doing a LAYOUT_RECALL callback. - * Set lay_trycnt to UINT16_MAX so it won't set up a retry. */ if (++lyp->lay_stateid.seqid == 0) lyp->lay_stateid.seqid = 1; - lyp->lay_trycnt = UINT16_MAX; nfsrv_recalllayout(lyp->lay_clientid, &lyp->lay_stateid, - &lyp->lay_fh, lyp, &loclyp, lyp->lay_type, p); + &lyp->lay_fh, lyp, 1, lyp->lay_type, p); nfsrv_freelayout(&loclyp, lyp); } } @@ -6833,8 +6836,7 @@ nfsrv_flexmirrordel(char *devid, NFSPROC_T *p) */ static int nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *stateidp, fhandle_t *fhp, - struct nfslayout *lyp, struct nfslayouthead *lyheadp, int laytype, - NFSPROC_T *p) + struct nfslayout *lyp, int changed, int laytype, NFSPROC_T *p) { struct nfsclient *clp; int error; @@ -6843,38 +6845,29 @@ nfsrv_recalllayout(nfsquad_t clid, nfsv4stateid_t *sta error = nfsrv_getclient(clid, 0, &clp, NULL, (nfsquad_t)((u_quad_t)0), 0, NULL, p); NFSD_DEBUG(4, "aft nfsrv_getclient=%d\n", error); - if (error != 0) + if (error != 0) { + printf("nfsrv_recalllayout: getclient err=%d\n", error); return (error); + } if ((clp->lc_flags & LCL_NFSV41) != 0) { error = nfsrv_docallback(clp, NFSV4OP_CBLAYOUTRECALL, - stateidp, 0, fhp, NULL, NULL, laytype, p); + stateidp, changed, fhp, NULL, NULL, laytype, p); /* If lyp != NULL, handle an error return here. */ if (error != 0 && lyp != NULL) { NFSDRECALLLOCK(); - if (error == NFSERR_NOMATCHLAYOUT) { - /* - * Mark it returned, since there is no layout. - */ - if ((lyp->lay_flags & NFSLAY_RECALL) != 0) { - lyp->lay_flags |= NFSLAY_RETURNED; - wakeup(lyp); - } - NFSDRECALLUNLOCK(); - } else if ((lyp->lay_flags & NFSLAY_RETURNED) == 0 && - lyp->lay_trycnt < 10) { - /* - * Clear recall, so it can be tried again - * and put it at the end of the list to - * delay the retry a little longer. - */ - lyp->lay_flags &= ~NFSLAY_RECALL; - lyp->lay_trycnt++; - TAILQ_REMOVE(lyheadp, lyp, lay_list); - TAILQ_INSERT_TAIL(lyheadp, lyp, lay_list); - NFSDRECALLUNLOCK(); - nfs_catnap(PVFS, 0, "nfsrclay"); - } else - NFSDRECALLUNLOCK(); + /* + * Mark it returned, since no layout recall + * has been done. + * All errors seem to be non-recoverable, although + * NFSERR_NOMATCHLAYOUT is a normal event. + */ + if ((lyp->lay_flags & NFSLAY_RECALL) != 0) { + lyp->lay_flags |= NFSLAY_RETURNED; + wakeup(lyp); + } + NFSDRECALLUNLOCK(); + if (error != NFSERR_NOMATCHLAYOUT) + printf("nfsrv_recalllayout: err=%d\n", error); } } else printf("nfsrv_recalllayout: clp not NFSv4.1\n"); @@ -6914,10 +6907,10 @@ nfsrv_recalloldlayout(NFSPROC_T *p) } NFSUNLOCKLAYOUT(lhyp); if (lyp != NULL) { - error = nfsrv_recalllayout(clientid, &stateid, &fh, NULL, NULL, + error = nfsrv_recalllayout(clientid, &stateid, &fh, NULL, 0, laytype, p); if (error != 0 && error != NFSERR_NOMATCHLAYOUT) - printf("recallold=%d\n", error); + NFSD_DEBUG(4, "recallold=%d\n", error); if (error != 0) { NFSLOCKLAYOUT(lhyp); /* @@ -8068,8 +8061,7 @@ tryagain: lyp->lay_stateid.seqid = 1; NFSDRECALLUNLOCK(); nfsrv_recalllayout(lyp->lay_clientid, &lyp->lay_stateid, - &lyp->lay_fh, lyp, &nfsrv_recalllisthead, - lyp->lay_type, p); + &lyp->lay_fh, lyp, 0, lyp->lay_type, p); NFSD_DEBUG(4, "nfsrv_copymr: recalled layout\n"); goto tryagain; } @@ -8086,17 +8078,33 @@ tryagain2: NFSD_DEBUG(4, "nfsrv_copymr: layout returned\n"); } else { + lyp->lay_trycnt++; ret = mtx_sleep(lyp, NFSDRECALLMUTEXPTR, PVFS | PCATCH, "nfsmrl", hz); NFSD_DEBUG(4, "nfsrv_copymr: aft sleep=%d\n", ret); if (ret == EINTR || ret == ERESTART) break; - if ((lyp->lay_flags & NFSLAY_RETURNED) == 0 && - didprintf == 0) { - printf("nfsrv_copymr: layout not " - "returned\n"); - didprintf = 1; + if ((lyp->lay_flags & NFSLAY_RETURNED) == 0) { + /* + * Give up after 60sec and return + * ENXIO, failing the copymr. + * This layout will remain on the + * recalllist. It can only be cleared + * by restarting the nfsd. + * This seems the safe way to handle + * it, since it cannot be safely copied + * with an outstanding RW layout. + */ + if (lyp->lay_trycnt >= 60) { + ret = ENXIO; + break; + } + if (didprintf == 0) { + printf("nfsrv_copymr: layout " + "not returned\n"); + didprintf = 1; + } } } goto tryagain2; From owner-svn-src-all@freebsd.org Wed Aug 8 20:30:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7EB4106A096; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F619927A0; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CA407844; Wed, 8 Aug 2018 20:30:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78KUDUc094660; Wed, 8 Aug 2018 20:30:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78KUDS2094659; Wed, 8 Aug 2018 20:30:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808082030.w78KUDS2094659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 8 Aug 2018 20:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337502 - head/usr.sbin/pnfsdscopymr X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/pnfsdscopymr X-SVN-Commit-Revision: 337502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 20:30:13 -0000 Author: rmacklem Date: Wed Aug 8 20:30:12 2018 New Revision: 337502 URL: https://svnweb.freebsd.org/changeset/base/337502 Log: Fix the err() arguments for a nfssvc(8) failure. argv has been incremented during argument handling, so elements of the array are no longer valid. Change the err() arguments so only the first string pointer in argv is used. Found during code inspection. Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c ============================================================================== --- head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Wed Aug 8 20:21:45 2018 (r337501) +++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c Wed Aug 8 20:30:12 2018 (r337502) @@ -295,7 +295,7 @@ main(int argc, char *argv[]) pnfsdarg.mdspath = *argv; ret = nfssvc(NFSSVC_PNFSDS, &pnfsdarg); if (ret < 0 && errno != EEXIST) - err(1, "Copymr failed args %s, %s", argv[1], argv[2]); + err(1, "Copymr failed for file %s", *argv); exit(0); } From owner-svn-src-all@freebsd.org Wed Aug 8 21:19:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31373106B894; Wed, 8 Aug 2018 21:19:08 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B432794A98; Wed, 8 Aug 2018 21:19:07 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9548D1006A; Wed, 8 Aug 2018 21:19:07 +0000 (UTC) (envelope-from leitao@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LJ7Nk021007; Wed, 8 Aug 2018 21:19:07 GMT (envelope-from leitao@FreeBSD.org) Received: (from leitao@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LJ7Zv021006; Wed, 8 Aug 2018 21:19:07 GMT (envelope-from leitao@FreeBSD.org) Message-Id: <201808082119.w78LJ7Zv021006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leitao set sender to leitao@FreeBSD.org using -f From: Breno Leitao Date: Wed, 8 Aug 2018 21:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337503 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: leitao X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 337503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 21:19:08 -0000 Author: leitao Date: Wed Aug 8 21:19:07 2018 New Revision: 337503 URL: https://svnweb.freebsd.org/changeset/base/337503 Log: powerpc64/powernv: re-read RTC after polling If OPAL_RTC_READ is busy and does not return the information on the first run, as returning OPAL_BUSY_EVENT, the system will crash since ymd and hmsm variable will contain junk values. This is happening because we were not calling OPAL_RTC_READ again after OPAL_POLL_EVENTS' return, which would finally replace the old/junk hmsm and ymd values. The code was also mixing OPAL_RTC_READ and OPAL_POLL_EVENTS return values. This patch fix this logic and guarantee that we call OPAL_RTC_READ after OPAL_POLL_EVENTS return, and guarantee the code will only proceed if OPAL_RTC_READ returns OPAL_SUCCESS. Reviewed by: jhibbits Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D16617 Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Wed Aug 8 20:30:12 2018 (r337502) +++ head/sys/powerpc/powernv/opal_dev.c Wed Aug 8 21:19:07 2018 (r337503) @@ -218,13 +218,12 @@ opal_gettime(device_t dev, struct timespec *ts) uint32_t ymd; uint64_t hmsm; - do { + rv = opal_call(OPAL_RTC_READ, vtophys(&ymd), vtophys(&hmsm)); + while (rv == OPAL_BUSY_EVENT) { + opal_call(OPAL_POLL_EVENTS, 0); + pause("opalrtc", 1); rv = opal_call(OPAL_RTC_READ, vtophys(&ymd), vtophys(&hmsm)); - if (rv == OPAL_BUSY_EVENT) { - rv = opal_call(OPAL_POLL_EVENTS, 0); - pause("opalrtc", 1); - } - } while (rv == OPAL_BUSY_EVENT); + } if (rv != OPAL_SUCCESS) return (ENXIO); From owner-svn-src-all@freebsd.org Wed Aug 8 21:21:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FCC5106BA0D; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5692694D22; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37A6A100B8; Wed, 8 Aug 2018 21:21:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LLTaI021887; Wed, 8 Aug 2018 21:21:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LLTwb021886; Wed, 8 Aug 2018 21:21:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082121.w78LLTwb021886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337504 - head/usr.bin/apply X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/apply X-SVN-Commit-Revision: 337504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 21:21:30 -0000 Author: kevans Date: Wed Aug 8 21:21:28 2018 New Revision: 337504 URL: https://svnweb.freebsd.org/changeset/base/337504 Log: apply(1): Fix magic number substitution with magic character ' ' Using a space as the magic character would result in problems if the command started with a number: - For a 'valid' number n, n < size of argv, it would erroneously get replaced with that argument; e.g. `apply -a ' ' -d 1rm x => `execxrm x` - For an 'invalid' number n, n >= size of argv, it would segfault. e.g. `apply -a ' ' 2to3 test.py` would try to access argv[2] This problem occurred because apply(1) would prepend "exec " to the command string before doing the actual magic number replacements, so it would come across "exec 2to3 1" and assume that the " 2" is also a magic number to be replaced. Re-work this to instead just append "exec " to the command sbuf and workaround the ugliness. This also simplifies stuff in the process. PR: 226948 Submitted by: Tobias Stoeckmann MFC after: 1 week Modified: head/usr.bin/apply/apply.c Modified: head/usr.bin/apply/apply.c ============================================================================== --- head/usr.bin/apply/apply.c Wed Aug 8 21:19:07 2018 (r337503) +++ head/usr.bin/apply/apply.c Wed Aug 8 21:21:28 2018 (r337504) @@ -55,7 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define EXEC "exec " +#define ISMAGICNO(p) \ + (p)[0] == magic && isdigit((unsigned char)(p)[1]) && (p)[1] != '0' static int exec_shell(const char *, const char *, const char *); static void usage(void); @@ -65,8 +66,9 @@ main(int argc, char *argv[]) { struct sbuf *cmdbuf; long arg_max; - int ch, debug, i, magic, n, nargs, offset, rval; + int ch, debug, i, magic, n, nargs, rval; size_t cmdsize; + char buf[4]; char *cmd, *name, *p, *shell, *slashp, *tmpshell; debug = 0; @@ -75,7 +77,7 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) switch (ch) { case 'a': - if (optarg[1] != '\0') + if (optarg[0] == '\0' || optarg[1] != '\0') errx(1, "illegal magic character specification"); magic = optarg[0]; @@ -105,7 +107,7 @@ main(int argc, char *argv[]) * largest one. */ for (n = 0, p = argv[0]; *p != '\0'; ++p) - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { ++p; if (p[0] - '0' > n) n = p[0] - '0'; @@ -134,28 +136,19 @@ main(int argc, char *argv[]) * Allocate enough space to hold the maximum command. Save the * size to pass to snprintf(). */ - cmdsize = sizeof(EXEC) - 1 + strlen(argv[0]) - + 9 * (sizeof(" %1") - 1) + 1; - if ((cmd = malloc(cmdsize)) == NULL) - err(1, NULL); - if (n == 0) { + cmdsize = strlen(argv[0]) + 9 * (sizeof(" %1") - 1) + 1; + if ((cmd = malloc(cmdsize)) == NULL) + err(1, NULL); + strlcpy(cmd, argv[0], cmdsize); + /* If nargs not set, default to a single argument. */ if (nargs == -1) nargs = 1; - p = cmd; - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; for (i = 1; i <= nargs; i++) { - offset = snprintf(p, cmdsize, " %c%d", magic, i); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); - p += offset; - cmdsize -= offset; + snprintf(buf, sizeof(buf), " %c%d", magic, i); + strlcat(cmd, buf, cmdsize); } /* @@ -165,9 +158,8 @@ main(int argc, char *argv[]) if (nargs == 0) nargs = 1; } else { - offset = snprintf(cmd, cmdsize, EXEC "%s", argv[0]); - if ((size_t)offset >= cmdsize) - errx(1, "snprintf() failed"); + if ((cmd = strdup(argv[0])) == NULL) + err(1, NULL); nargs = n; } @@ -184,9 +176,10 @@ main(int argc, char *argv[]) */ for (rval = 0; argc > nargs; argc -= nargs, argv += nargs) { sbuf_clear(cmdbuf); + sbuf_cat(cmdbuf, "exec "); /* Expand command argv references. */ for (p = cmd; *p != '\0'; ++p) { - if (p[0] == magic && isdigit(p[1]) && p[1] != '0') { + if (ISMAGICNO(p)) { if (sbuf_cat(cmdbuf, argv[(++p)[0] - '0']) == -1) errc(1, ENOMEM, "sbuf"); From owner-svn-src-all@freebsd.org Wed Aug 8 21:37:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59872106C444; Wed, 8 Aug 2018 21:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E351959B0; Wed, 8 Aug 2018 21:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D825810391; Wed, 8 Aug 2018 21:37:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Lb3Bb031977; Wed, 8 Aug 2018 21:37:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Lb2B5031967; Wed, 8 Aug 2018 21:37:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082137.w78Lb2B5031967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337505 - head/bin/dd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/dd X-SVN-Commit-Revision: 337505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 21:37:04 -0000 Author: kevans Date: Wed Aug 8 21:37:02 2018 New Revision: 337505 URL: https://svnweb.freebsd.org/changeset/base/337505 Log: dd: add status=progress support This reports the current status on a single line every second, mirroring similar functionality in GNU dd, and carefully interacts with SIGINFO. PR: 229615 Submitted by: Thomas Hurst (modified for style(9) nits by me) MFC after: 1 week Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/args.c Wed Aug 8 21:37:02 2018 (r337505) @@ -306,6 +306,8 @@ f_status(char *arg) ddflags |= C_NOINFO; else if (strcmp(arg, "noxfer") == 0) ddflags |= C_NOXFER; + else if (strcmp(arg, "progress") == 0) + ddflags |= C_PROGRESS; else errx(1, "unknown status %s", arg); } Modified: head/bin/dd/dd.1 ============================================================================== --- head/bin/dd/dd.1 Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.1 Wed Aug 8 21:37:02 2018 (r337505) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd April 2, 2017 +.Dd August 8, 2018 .Dt DD 1 .Os .Sh NAME @@ -164,12 +164,14 @@ bytes per second. Where .Cm value is one of the symbols from the following list. -.Bl -tag -width "noxfer" +.Bl -tag -width "progress" .It Cm noxfer Do not print the transfer statistics as the last line of status output. .It Cm none Do not print the status output. Error messages are shown; informational messages are not. +.It Cm progress +Print basic transfer statistics once per second. .El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.c Wed Aug 8 21:37:02 2018 (r337505) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -89,6 +90,7 @@ const u_char *ctab; /* conversion table */ char fill_char; /* Character to fill with if defined */ size_t speed = 0; /* maximum speed, in bytes per second */ volatile sig_atomic_t need_summary; +volatile sig_atomic_t need_progress; int main(int argc __unused, char *argv[]) @@ -102,6 +104,7 @@ main(int argc __unused, char *argv[]) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); + (void)signal(SIGALRM, sigalrm_handler); (void)signal(SIGINT, terminate); atexit(summary); @@ -281,6 +284,14 @@ setup(void) ctab = casetab; } + if ((ddflags & C_PROGRESS)) { + struct itimerval timer = { + .it_interval = { .tv_sec = 1, .tv_usec = 0 }, + .it_value = { .tv_sec = 1, .tv_usec = 0 }, + }; + setitimer(ITIMER_REAL, &timer, NULL); + } + if (clock_gettime(CLOCK_MONOTONIC, &st.start)) err(1, "clock_gettime"); } @@ -460,6 +471,9 @@ dd_in(void) (*cfunc)(); if (need_summary) { summary(); + } + if (need_progress) { + progress(); } } } Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/dd.h Wed Aug 8 21:37:02 2018 (r337505) @@ -100,5 +100,6 @@ typedef struct { #define C_STATUS 0x08000000 #define C_NOXFER 0x10000000 #define C_NOINFO 0x20000000 +#define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/extern.h Wed Aug 8 21:37:02 2018 (r337505) @@ -46,7 +46,9 @@ void pos_in(void); void pos_out(void); double secs_elapsed(void); void summary(void); +void progress(void); void siginfo_handler(int); +void sigalrm_handler(int); void terminate(int); void unblock(void); void unblock_close(void); @@ -66,3 +68,4 @@ extern const u_char a2ibm_32V[], a2ibm_POSIX[]; extern u_char casetab[]; extern char fill_char; extern volatile sig_atomic_t need_summary; +extern volatile sig_atomic_t need_progress; Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Wed Aug 8 21:21:28 2018 (r337504) +++ head/bin/dd/misc.c Wed Aug 8 21:37:02 2018 (r337505) @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include "dd.h" #include "extern.h" +static int need_newline; + double secs_elapsed(void) { @@ -83,6 +85,9 @@ summary(void) if (ddflags & C_NOINFO) return; + if (need_newline && !need_summary) + fprintf(stderr, "\n"); + secs = secs_elapsed(); (void)fprintf(stderr, @@ -102,12 +107,42 @@ summary(void) need_summary = 0; } +void +progress(void) +{ + double secs; + static int lastlen; + int len; + + secs = secs_elapsed(); + len = fprintf(stderr, + "\r%ju bytes transferred in %.0f secs (%.0f bytes/sec)", + st.bytes, secs, st.bytes / secs); + + if (len > 0) { + if (len < lastlen) + (void)fprintf(stderr, "%*s", len - lastlen, ""); + lastlen = len; + } + + need_newline = 1; + need_progress = 0; +} + /* ARGSUSED */ void siginfo_handler(int signo __unused) { need_summary = 1; +} + +/* ARGSUSED */ +void +sigalrm_handler(int signo __unused) +{ + + need_progress = 1; } /* ARGSUSED */ From owner-svn-src-all@freebsd.org Wed Aug 8 21:51:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA510106CAED; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70E2A964AE; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5173E1058D; Wed, 8 Aug 2018 21:51:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78LpKA5040825; Wed, 8 Aug 2018 21:51:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78LpJ63040823; Wed, 8 Aug 2018 21:51:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808082151.w78LpJ63040823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Aug 2018 21:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337506 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 337506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 21:51:21 -0000 Author: kevans Date: Wed Aug 8 21:51:19 2018 New Revision: 337506 URL: https://svnweb.freebsd.org/changeset/base/337506 Log: ls(1): Enable colors with COLORTERM is set in the environment COLORTERM is the de facto standard, while CLICOLOR is generally specific to FreeBSD and ls(1). PR: 230101 Submitted by: D Green (with manpage additions by myself) Reviewed by: cem ("LGTM" in PR; pre-manpage changes) MFC after: 1 week Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Wed Aug 8 21:37:02 2018 (r337505) +++ head/bin/ls/ls.1 Wed Aug 8 21:51:19 2018 (r337506) @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd January 17, 2018 +.Dd August 8, 2018 .Dt LS 1 .Os .Sh NAME @@ -132,6 +132,8 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR +or +.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -628,6 +630,10 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. +.It Ev COLORTERM +See description for +.Ev CLICOLOR +above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -652,7 +658,9 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR . +.Ev CLICOLOR +or +.Ev COLORTERM . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -759,6 +767,8 @@ option for more details. .It Ev TERM The .Ev CLICOLOR +and +.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Aug 8 21:37:02 2018 (r337505) +++ head/bin/ls/ls.c Wed Aug 8 21:51:19 2018 (r337506) @@ -368,7 +368,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if (getenv("CLICOLOR") && + if ((getenv("CLICOLOR") || getenv("COLORTERM")) && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { From owner-svn-src-all@freebsd.org Wed Aug 8 22:42:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2CF0106E196; Wed, 8 Aug 2018 22:42:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96B237024F; Wed, 8 Aug 2018 22:42:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756AF10DB9; Wed, 8 Aug 2018 22:42:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78Mg395064618; Wed, 8 Aug 2018 22:42:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78Mg3jJ064617; Wed, 8 Aug 2018 22:42:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201808082242.w78Mg3jJ064617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Aug 2018 22:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337507 - stable/11/sys/modules/vmm X-SVN-Group: stable-11 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/11/sys/modules/vmm X-SVN-Commit-Revision: 337507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 22:42:04 -0000 Author: bdrewery Date: Wed Aug 8 22:42:03 2018 New Revision: 337507 URL: https://svnweb.freebsd.org/changeset/base/337507 Log: MFC r326569: Fix cyclic dependency after r326552. Modified: stable/11/sys/modules/vmm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/vmm/Makefile ============================================================================== --- stable/11/sys/modules/vmm/Makefile Wed Aug 8 21:51:19 2018 (r337506) +++ stable/11/sys/modules/vmm/Makefile Wed Aug 8 22:42:03 2018 (r337507) @@ -3,8 +3,8 @@ KMOD= vmm SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h -SRCS+= vmx_assym.h svm_assym.h -DPSRCS= vmx_genassym.c svm_genassym.c +DPSRCS+= vmx_assym.h svm_assym.h +DPSRCS+= vmx_genassym.c svm_genassym.c CFLAGS+= -DVMM_KEEP_STATS -DSMP CFLAGS+= -I${SRCTOP}/sys/amd64/vmm @@ -55,6 +55,9 @@ SRCS+= vmcb.c \ svm_msr.c CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o + +OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h +OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h vmx_assym.h: vmx_genassym.o sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET} From owner-svn-src-all@freebsd.org Wed Aug 8 22:45:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFAD106E3BA; Wed, 8 Aug 2018 22:45:31 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE93470564; Wed, 8 Aug 2018 22:45:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B567210EE3; Wed, 8 Aug 2018 22:45:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w78MjUe8067229; Wed, 8 Aug 2018 22:45:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w78MjUlA067228; Wed, 8 Aug 2018 22:45:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201808082245.w78MjUlA067228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 8 Aug 2018 22:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337508 - head/contrib/flex X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/contrib/flex X-SVN-Commit-Revision: 337508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 22:45:31 -0000 Author: brooks Date: Wed Aug 8 22:45:30 2018 New Revision: 337508 URL: https://svnweb.freebsd.org/changeset/base/337508 Log: Terminate filter_create_ext() args with NULL, not 0. filter_create_ext() is documented to take a NULL terminated set of arguments. 0 is promoted to an int so this would fail on 64-bit systems if the value was not passed in a register. On all currently supported 64-bit architectures it is. Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: head/contrib/flex/main.c Modified: head/contrib/flex/main.c ============================================================================== --- head/contrib/flex/main.c Wed Aug 8 22:42:03 2018 (r337507) +++ head/contrib/flex/main.c Wed Aug 8 22:45:30 2018 (r337508) @@ -364,7 +364,7 @@ void check_options () output_chain = filter_create_int(NULL, filter_tee_header, headerfilename); if ( !(m4 = getenv("M4"))) m4 = M4; - filter_create_ext(output_chain, m4, "-gP", 0); + filter_create_ext(output_chain, m4, "-gP", NULL); filter_create_int(output_chain, filter_fix_linedirs, NULL); /* For debugging, only run the requested number of filters. */ From owner-svn-src-all@freebsd.org Thu Aug 9 00:15:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D585010707AC; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC6E7414A; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 690F911DA8; Thu, 9 Aug 2018 00:15:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790FT0l015823; Thu, 9 Aug 2018 00:15:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790FTAW015822; Thu, 9 Aug 2018 00:15:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201808090015.w790FTAW015822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 9 Aug 2018 00:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337509 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 337509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:15:30 -0000 Author: rmacklem Date: Thu Aug 9 00:15:28 2018 New Revision: 337509 URL: https://svnweb.freebsd.org/changeset/base/337509 Log: Fix a typo plus add a couple of sentences to pnfsserver.4. This is a content change. Modified: head/usr.sbin/nfsd/pnfsserver.4 Modified: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- head/usr.sbin/nfsd/pnfsserver.4 Wed Aug 8 22:45:30 2018 (r337508) +++ head/usr.sbin/nfsd/pnfsserver.4 Thu Aug 9 00:15:28 2018 (r337509) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd August 8, 2018 .Dt PNFSSERVER 4 .Os .Sh NAME @@ -366,8 +366,17 @@ have the .Xr pnfsdscopymr 8 command done on them to complete the recovery. .Bd -literal -offset -# pnfsdscopymr -r /data3 +# pnfsdscopymr -r /data3 .Ed +.sp +If this commmand fails with the error +.br +.Dq pnfsdscopymr: Copymr failed for file : Device not configured +.br +repeatedly, this may be caused by a Read/Write layout that has not +been returned. +The only way to get rid of such a layout is to restart the +.Xr nfsd 8 . .sp All of these commands are designed to be done while the pNFS service is running and can be re-run safely. From owner-svn-src-all@freebsd.org Thu Aug 9 00:39:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D651310710FB; Thu, 9 Aug 2018 00:39:40 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B36D74DC7; Thu, 9 Aug 2018 00:39:40 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68847120DB; Thu, 9 Aug 2018 00:39:40 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790deSZ026683; Thu, 9 Aug 2018 00:39:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790deEA026682; Thu, 9 Aug 2018 00:39:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090039.w790deEA026682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337510 - stable/11/sys/dev/bxe X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/11/sys/dev/bxe X-SVN-Commit-Revision: 337510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:39:41 -0000 Author: davidcs Date: Thu Aug 9 00:39:39 2018 New Revision: 337510 URL: https://svnweb.freebsd.org/changeset/base/337510 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by: Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Thu Aug 9 00:15:28 2018 (r337509) +++ stable/11/sys/dev/bxe/bxe.c Thu Aug 9 00:39:39 2018 (r337510) @@ -4392,6 +4392,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4437,30 +4439,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = if_getsoftc(ifp); + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7034,7 +7045,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9123,11 +9134,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, NULL)) taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); From owner-svn-src-all@freebsd.org Thu Aug 9 00:48:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48474107148D; Thu, 9 Aug 2018 00:48:56 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E798375309; Thu, 9 Aug 2018 00:48:55 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C47601226C; Thu, 9 Aug 2018 00:48:55 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790mtu9031656; Thu, 9 Aug 2018 00:48:55 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790mtsB031655; Thu, 9 Aug 2018 00:48:55 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090048.w790mtsB031655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337511 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/10/sys/dev/bxe X-SVN-Commit-Revision: 337511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:48:56 -0000 Author: davidcs Date: Thu Aug 9 00:48:55 2018 New Revision: 337511 URL: https://svnweb.freebsd.org/changeset/base/337511 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Thu Aug 9 00:39:39 2018 (r337510) +++ stable/10/sys/dev/bxe/bxe.c Thu Aug 9 00:48:55 2018 (r337511) @@ -4404,6 +4404,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4449,30 +4451,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7041,7 +7052,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9130,11 +9141,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, NULL)) taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); From owner-svn-src-all@freebsd.org Thu Aug 9 00:52:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B40961071693; Thu, 9 Aug 2018 00:52:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 693E0756FB; Thu, 9 Aug 2018 00:52:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A4F4123F8; Thu, 9 Aug 2018 00:52:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790qdCN036519; Thu, 9 Aug 2018 00:52:39 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790qd5A036518; Thu, 9 Aug 2018 00:52:39 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090052.w790qd5A036518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r337512 - stable/9/sys/dev/bxe X-SVN-Group: stable-9 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/9/sys/dev/bxe X-SVN-Commit-Revision: 337512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:52:39 -0000 Author: davidcs Date: Thu Aug 9 00:52:38 2018 New Revision: 337512 URL: https://svnweb.freebsd.org/changeset/base/337512 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c ============================================================================== --- stable/9/sys/dev/bxe/bxe.c Thu Aug 9 00:48:55 2018 (r337511) +++ stable/9/sys/dev/bxe/bxe.c Thu Aug 9 00:52:38 2018 (r337512) @@ -4398,6 +4398,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4443,30 +4445,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7043,7 +7054,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9132,11 +9143,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, NULL)) taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); From owner-svn-src-all@freebsd.org Thu Aug 9 00:56:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE9E1071769; Thu, 9 Aug 2018 00:56:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D62175873; Thu, 9 Aug 2018 00:56:41 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8874123FB; Thu, 9 Aug 2018 00:56:40 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790ueN8036752; Thu, 9 Aug 2018 00:56:40 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790ueMG036751; Thu, 9 Aug 2018 00:56:40 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090056.w790ueMG036751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r337513 - stable/8/sys/dev/bxe X-SVN-Group: stable-8 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/8/sys/dev/bxe X-SVN-Commit-Revision: 337513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:56:41 -0000 Author: davidcs Date: Thu Aug 9 00:56:40 2018 New Revision: 337513 URL: https://svnweb.freebsd.org/changeset/base/337513 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/8/sys/dev/bxe/bxe.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/bxe/bxe.c ============================================================================== --- stable/8/sys/dev/bxe/bxe.c Thu Aug 9 00:52:38 2018 (r337512) +++ stable/8/sys/dev/bxe/bxe.c Thu Aug 9 00:56:40 2018 (r337513) @@ -4396,6 +4396,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4441,30 +4443,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7018,7 +7029,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9097,11 +9108,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) fp = &sc->fp[i]; if (fp->tq) { taskqueue_drain(fp->tq, &fp->tq_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); From owner-svn-src-all@freebsd.org Thu Aug 9 00:58:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1737010717FF for ; Thu, 9 Aug 2018 00:58:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw1-xc31.google.com (mail-yw1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95796759C5 for ; Thu, 9 Aug 2018 00:58:29 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw1-xc31.google.com with SMTP id z143-v6so3029837ywa.7 for ; Wed, 08 Aug 2018 17:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hz636VAPE0iP+D1GXx5e4Z0ZE5A5lBR92o+y9eTsg7A=; b=VpDpxNIZg6N/u9rkdLgn+Q3JM9EBvl3ln7AIesIV/z1UAIJER+eOnBC1ErEF4XxBs1 6I2iKrGm/+c84PTXtFUxNwRUE+RU7ahMfAnodrVFdj/APM1dL/VdL56hKN2g55FZCUMW /cBhykOl7i5Ev27+LRFBalDjFRDiTEaZsOrus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hz636VAPE0iP+D1GXx5e4Z0ZE5A5lBR92o+y9eTsg7A=; b=P8S5A3NzDNqvDSWPnSEUcVA8X6gO2iBbQ5cQzPETuGATG7SSPZTupmbYUu7aOKo01t Rm2HSfCLJcE2BlEGKBbWTulVrjK6THjY9WZ1RwwW4VCnFDEX4PxPa/Fl4yG01s3v3IbZ +LcC0DSHCK4gBpMXo70EShs9Ilk2GLjquoHGacf9byfomT76H7qi4K3oQq6j4eV6s2Ip QPW+Fnb/xeTDJwXKAHJeC69sMuQ6h+U/7vSErskXINkveBJxdzykTFfCR7Oby54ntyJm 1dei72ab57FiXJbo8qEbfWPuBwuMXWPKRSra+pQjYH+ceDPLXwOh/bJ1i/Ka+pJK26/r 31jw== X-Gm-Message-State: AOUpUlFTqcyvVoNQlpPU48mFm+m6fYAqS9/itHnmr7b9Ju8gA77DG8cb QAjKBl0vQf92YKn0x+mm+cKnE2greT9XK7Jy224fz33A+mg= X-Google-Smtp-Source: AA+uWPwNOfpF9goR+r/187Z8F+jeQ3DE01dpMik0neLHZYMsbI+aqK2eb0oxxA/Sia4Bkmd9SZcMi507coxb4SYJYSQ= X-Received: by 2002:a25:7c1:: with SMTP id 184-v6mr1702ybh.338.1533776308849; Wed, 08 Aug 2018 17:58:28 -0700 (PDT) MIME-Version: 1.0 References: <201808082137.w78Lb2B5031967@repo.freebsd.org> In-Reply-To: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Eitan Adler Date: Wed, 8 Aug 2018 17:58:02 -0700 Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:58:30 -0000 On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: > +/* ARGSUSED */ We've been slowly delintifying system utilities. Why do we still keep these comments? > +void > +sigalrm_handler(int signo __unused) > +{ > + > + need_progress = 1; > } -- Eitan Adler From owner-svn-src-all@freebsd.org Thu Aug 9 00:59:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B2EC10718FC; Thu, 9 Aug 2018 00:59:58 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F232375BB4; Thu, 9 Aug 2018 00:59:57 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE8C1123FC; Thu, 9 Aug 2018 00:59:57 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w790xvgQ036930; Thu, 9 Aug 2018 00:59:57 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w790xv0I036929; Thu, 9 Aug 2018 00:59:57 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090059.w790xv0I036929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 00:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r337514 - stable/7/sys/dev/bxe X-SVN-Group: stable-7 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/7/sys/dev/bxe X-SVN-Commit-Revision: 337514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 00:59:58 -0000 Author: davidcs Date: Thu Aug 9 00:59:57 2018 New Revision: 337514 URL: https://svnweb.freebsd.org/changeset/base/337514 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:Vaishali.Kulkarni@cavium.com and Anand.Khoje@cavium.com Modified: stable/7/sys/dev/bxe/bxe.c Directory Properties: stable/7/ (props changed) stable/7/sys/ (props changed) Modified: stable/7/sys/dev/bxe/bxe.c ============================================================================== --- stable/7/sys/dev/bxe/bxe.c Thu Aug 9 00:56:40 2018 (r337513) +++ stable/7/sys/dev/bxe/bxe.c Thu Aug 9 00:59:57 2018 (r337514) @@ -4394,6 +4394,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); + bxe_link_report(sc); + return (0); } @@ -4439,30 +4441,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; + /* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. + */ + ifmr->ifm_status = IFM_AVALID; + + /* Setup the default interface info. */ + ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); + BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", + __func__, sc->link_vars.link_up); return; } - /* Setup the default interface info. */ - ifmr->ifm_status = IFM_AVALID; - ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; + ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; + BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", + __func__); return; } ifmr->ifm_active |= sc->media; - - if (sc->link_vars.duplex == DUPLEX_FULL) { - ifmr->ifm_active |= IFM_FDX; - } else { - ifmr->ifm_active |= IFM_HDX; - } + return; } static void @@ -7016,7 +7027,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); + BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9095,11 +9106,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) fp = &sc->fp[i]; if (fp->tq) { taskqueue_drain(fp->tq, &fp->tq_task); - taskqueue_free(fp->tq); - fp->tq = NULL; } - } + for (i = 0; i < sc->num_queues; i++) { + fp = &sc->fp[i]; + if (fp->tq != NULL) { + taskqueue_free(fp->tq); + fp->tq = NULL; + } + } + } if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); From owner-svn-src-all@freebsd.org Thu Aug 9 01:01:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD611071A34; Thu, 9 Aug 2018 01:01:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0B275DFA; Thu, 9 Aug 2018 01:01:37 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id E441221231; Thu, 9 Aug 2018 01:01:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f175.google.com with SMTP id r13-v6so3127865ljg.10; Wed, 08 Aug 2018 18:01:36 -0700 (PDT) X-Gm-Message-State: AOUpUlEfzy4/QAZkOPl1fSyMl30eRJfHLtq5Bcy3+ycMtE25F56DEjaB ypM0KtPxlbZjJCsDn8JMdUXJJ9gfx8sJnCSGrl4= X-Google-Smtp-Source: AA+uWPyQenUrKOVVY+ufzugdiX1Iti3mWisEST/ttCbw3Q4m2oqgoP2ukTcBgGjhIvW+JmECQRXZ5qm0FWNKgzzkFsc= X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr4327ljf.27.1533776495590; Wed, 08 Aug 2018 18:01:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 18:01:14 -0700 (PDT) In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 20:01:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:01:37 -0000 On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: >> +/* ARGSUSED */ > > We've been slowly delintifying system utilities. Why do we still keep > these comments? > This is consistent with the style of the file, so I didn't object. I'd rather do another pass later to de-lintify the whole thing rather than nitpick at this patch for some otherwise harmless and matching comments. =) Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Aug 9 01:03:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 357101071C22; Thu, 9 Aug 2018 01:03:54 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBF3C76143; Thu, 9 Aug 2018 01:03:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A87611258A; Thu, 9 Aug 2018 01:03:53 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7913r1j041814; Thu, 9 Aug 2018 01:03:53 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7913rUu041813; Thu, 9 Aug 2018 01:03:53 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090103.w7913rUu041813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 01:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337515 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 337515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:03:54 -0000 Author: davidcs Date: Thu Aug 9 01:03:53 2018 New Revision: 337515 URL: https://svnweb.freebsd.org/changeset/base/337515 Log: MFC r336680 Update man page with support for 41000 Series adapters Modified: stable/11/share/man/man4/qlnxe.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/qlnxe.4 ============================================================================== --- stable/11/share/man/man4/qlnxe.4 Thu Aug 9 00:59:57 2018 (r337514) +++ stable/11/share/man/man4/qlnxe.4 Thu Aug 9 01:03:53 2018 (r337515) @@ -63,6 +63,8 @@ chipsets: .Bl -bullet -compact .It QLogic 45000 series +.It +QLogic 41000 series .El .Sh SUPPORT For support questions please contact your Cavium approved reseller or From owner-svn-src-all@freebsd.org Thu Aug 9 01:05:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BEE91071CA5; Thu, 9 Aug 2018 01:05:26 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5C507629A; Thu, 9 Aug 2018 01:05:25 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C170C1258C; Thu, 9 Aug 2018 01:05:25 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7915P6b041947; Thu, 9 Aug 2018 01:05:25 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7915P94041946; Thu, 9 Aug 2018 01:05:25 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090105.w7915P94041946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 01:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337516 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 337516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:05:26 -0000 Author: davidcs Date: Thu Aug 9 01:05:25 2018 New Revision: 337516 URL: https://svnweb.freebsd.org/changeset/base/337516 Log: MFC r336680 Update man page with support for 41000 Series adapters Modified: stable/10/share/man/man4/qlnxe.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/qlnxe.4 ============================================================================== --- stable/10/share/man/man4/qlnxe.4 Thu Aug 9 01:03:53 2018 (r337515) +++ stable/10/share/man/man4/qlnxe.4 Thu Aug 9 01:05:25 2018 (r337516) @@ -63,6 +63,8 @@ chipsets: .Bl -bullet -compact .It QLogic 45000 series +.It +QLogic 41000 series .El .Sh SUPPORT For support questions please contact your Cavium approved reseller or From owner-svn-src-all@freebsd.org Thu Aug 9 01:15:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A889107223F for ; Thu, 9 Aug 2018 01:15:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E06B768C3 for ; Thu, 9 Aug 2018 01:15:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id q19-v6so3418443ioh.11 for ; Wed, 08 Aug 2018 18:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4OmLy8XtdfSbqSbrCftETJqRK/iF5pk0DRFkIWknc0A=; b=O5zj3Hozp2geSzUFu/TdcMqzu7QZ1EsFPTB87mOTUTgyi6d1TR7fPLqCYXilgq/Vc3 gMI3YqedEkalmFOqxS3h5XLAQ0gbvnDMEysGvQNS55rTJMKhpjvNW0hzZxarWR+EPcy6 ffBzDHcvw60umNYPe+HTWB3FFv/ZyELx14if3fbbjfzKcatBx0WPIDTE7wK2wKXn7yTr 8JzY7DNpiCnwu2TQOCizfKfI9EQUZMwWjHtzrLCzw/F8OuKdWyRU/aFDYWK2Ym0BjPkm Eg75WMsM2MOwQ1NTaZChtjVfZuW4RkhFfHIjiVjBIKkb468ssAJ6yE+xYyonmzFe06As c0AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4OmLy8XtdfSbqSbrCftETJqRK/iF5pk0DRFkIWknc0A=; b=IICQMIuri6NE7ZhRbwxd4/Gkd43JiQu805nBYnRZK3TKLrXBxQmPvZJKwBFhskpJoo XT/KDkAxazZ7e/wBM2NpH9DTS7fuyQMZXNzSx/2PMlQZ+johxtMR3XtZY8oM2FTUL/F/ T1bEnCFhcyFaOK+dQbAHqBhPZOwRDK0Ve1pO61kbKLa+wikYmZ/4iLvCJEukD75U1m3b Nvy9haRLUt/uqt/1zn1pyEhzRn/49k9eEaoDoK0nncyx6rN/1WXB57Uyzt28rKNoCMg0 LVN2H/gVhIupbfqwNKX8ayUEHvH2MU3SzntRlWa0DNAm+EEXgiI67xRSbA2XA61FMrAl uyGw== X-Gm-Message-State: AOUpUlECccxFDvBBPFCDfc9T/lpc8hG1qB+nJ6SqXI8sj+PVsTUeIfN/ la9g/oDNlejv01F3zTmJ4um1Ol1tGT+BaQn10wyoww== X-Google-Smtp-Source: AA+uWPxYGSwVyYKlmuGSAhKWKEhBdwyn6HugtbBIWloSs9CQlW5diKZ931350n4vcRnNSLSXymPSQYDcrtL679NLqlM= X-Received: by 2002:a6b:f70f:: with SMTP id k15-v6mr37755iog.37.1533777333810; Wed, 08 Aug 2018 18:15:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 18:15:33 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Warner Losh Date: Wed, 8 Aug 2018 19:15:33 -0600 X-Google-Sender-Auth: jdGdFqdz13MkbxNAiTntpJ6kl74 Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Kyle Evans Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:15:35 -0000 On Wed, Aug 8, 2018 at 7:01 PM, Kyle Evans wrote: > On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: > > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: > >> +/* ARGSUSED */ > > > > We've been slowly delintifying system utilities. Why do we still keep > > these comments? > > > > This is consistent with the style of the file, so I didn't object. > I'd rather do another pass later to de-lintify the whole thing rather > than nitpick at this patch for some otherwise harmless and matching > comments. =) > It appears to be from NetBSD upstream, so removing it would be pointless churn that makes things harder to merge. Warner From owner-svn-src-all@freebsd.org Thu Aug 9 01:17:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21FE310723A9; Thu, 9 Aug 2018 01:17:37 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2F2776AAF; Thu, 9 Aug 2018 01:17:36 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A545A12767; Thu, 9 Aug 2018 01:17:36 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w791HaxQ047179; Thu, 9 Aug 2018 01:17:36 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w791Haqr047176; Thu, 9 Aug 2018 01:17:36 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090117.w791Haqr047176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 01:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337517 - in stable/11/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxev X-SVN-Group: stable-11 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: in stable/11/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxev X-SVN-Commit-Revision: 337517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:17:37 -0000 Author: davidcs Date: Thu Aug 9 01:17:35 2018 New Revision: 337517 URL: https://svnweb.freebsd.org/changeset/base/337517 Log: MFC r336695 Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ. Added support for LLDP passthru Upgrade ECORE to version 8.33.5.0 Upgrade STORMFW to version 8.33.7.0 Added support for SRIOV Added: stable/11/sys/dev/qlnx/qlnxe/ecore_iwarp.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_iwarp.h stable/11/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c stable/11/sys/dev/qlnx/qlnxe/ecore_rdma.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_rdma.h stable/11/sys/dev/qlnx/qlnxe/ecore_rdma_api.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_rdma_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_sriov.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_sriov.c stable/11/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h stable/11/sys/dev/qlnx/qlnxe/ecore_vf.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_vf.c stable/11/sys/modules/qlnx/qlnxev/ - copied from r336695, head/sys/modules/qlnx/qlnxev/ Modified: stable/11/sys/dev/qlnx/qlnxe/bcm_osal.h stable/11/sys/dev/qlnx/qlnxe/common_hsi.h stable/11/sys/dev/qlnx/qlnxe/ecore.h stable/11/sys/dev/qlnx/qlnxe/ecore_chain.h stable/11/sys/dev/qlnx/qlnxe/ecore_cxt.c stable/11/sys/dev/qlnx/qlnxe/ecore_cxt.h stable/11/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c stable/11/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h stable/11/sys/dev/qlnx/qlnxe/ecore_dbg_values.h stable/11/sys/dev/qlnx/qlnxe/ecore_dcbx.c stable/11/sys/dev/qlnx/qlnxe/ecore_dcbx.h stable/11/sys/dev/qlnx/qlnxe/ecore_dcbx_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_dev.c stable/11/sys/dev/qlnx/qlnxe/ecore_dev_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_fcoe.h stable/11/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_common.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_init_func.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_init_tool.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h stable/11/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h stable/11/sys/dev/qlnx/qlnxe/ecore_hw.c stable/11/sys/dev/qlnx/qlnxe/ecore_hw.h stable/11/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c stable/11/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h stable/11/sys/dev/qlnx/qlnxe/ecore_init_ops.c stable/11/sys/dev/qlnx/qlnxe/ecore_init_values.h stable/11/sys/dev/qlnx/qlnxe/ecore_int.c stable/11/sys/dev/qlnx/qlnxe/ecore_int.h stable/11/sys/dev/qlnx/qlnxe/ecore_int_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_iov_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_iro.h stable/11/sys/dev/qlnx/qlnxe/ecore_iro_values.h stable/11/sys/dev/qlnx/qlnxe/ecore_iscsi.h stable/11/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_l2.c stable/11/sys/dev/qlnx/qlnxe/ecore_l2.h stable/11/sys/dev/qlnx/qlnxe/ecore_l2_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_ll2.h stable/11/sys/dev/qlnx/qlnxe/ecore_ll2_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_mcp.c stable/11/sys/dev/qlnx/qlnxe/ecore_mcp.h stable/11/sys/dev/qlnx/qlnxe/ecore_mcp_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_ooo.h stable/11/sys/dev/qlnx/qlnxe/ecore_proto_if.h stable/11/sys/dev/qlnx/qlnxe/ecore_roce.h stable/11/sys/dev/qlnx/qlnxe/ecore_roce_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_rt_defs.h stable/11/sys/dev/qlnx/qlnxe/ecore_sp_commands.c stable/11/sys/dev/qlnx/qlnxe/ecore_sp_commands.h stable/11/sys/dev/qlnx/qlnxe/ecore_spq.c stable/11/sys/dev/qlnx/qlnxe/ecore_spq.h stable/11/sys/dev/qlnx/qlnxe/ecore_sriov.h stable/11/sys/dev/qlnx/qlnxe/ecore_utils.h stable/11/sys/dev/qlnx/qlnxe/ecore_vf.h stable/11/sys/dev/qlnx/qlnxe/ecore_vf_api.h stable/11/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h stable/11/sys/dev/qlnx/qlnxe/eth_common.h stable/11/sys/dev/qlnx/qlnxe/fcoe_common.h stable/11/sys/dev/qlnx/qlnxe/iscsi_common.h stable/11/sys/dev/qlnx/qlnxe/mcp_private.h stable/11/sys/dev/qlnx/qlnxe/mcp_public.h stable/11/sys/dev/qlnx/qlnxe/nvm_cfg.h stable/11/sys/dev/qlnx/qlnxe/nvm_map.h stable/11/sys/dev/qlnx/qlnxe/qlnx_def.h stable/11/sys/dev/qlnx/qlnxe/qlnx_ioctl.c stable/11/sys/dev/qlnx/qlnxe/qlnx_ioctl.h stable/11/sys/dev/qlnx/qlnxe/qlnx_os.c stable/11/sys/dev/qlnx/qlnxe/qlnx_os.h stable/11/sys/dev/qlnx/qlnxe/qlnx_ver.h stable/11/sys/dev/qlnx/qlnxe/rdma_common.h stable/11/sys/dev/qlnx/qlnxe/reg_addr.h stable/11/sys/dev/qlnx/qlnxe/roce_common.h stable/11/sys/dev/qlnx/qlnxe/spad_layout.h stable/11/sys/dev/qlnx/qlnxe/storage_common.h stable/11/sys/dev/qlnx/qlnxe/tcp_common.h stable/11/sys/modules/qlnx/Makefile stable/11/sys/modules/qlnx/qlnxe/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- stable/11/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Aug 9 01:05:25 2018 (r337516) +++ stable/11/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Aug 9 01:17:35 2018 (r337517) @@ -34,7 +34,7 @@ #include "ecore_status.h" #include -#if __FreeBSD_version >= 1200000 +#if __FreeBSD_version >= 1200032 #include #else #if __FreeBSD_version >= 1100090 @@ -62,6 +62,7 @@ extern void qlnx_pci_write_config_word(void *ecore_dev extern void qlnx_pci_write_config_dword(void *ecore_dev, uint32_t pci_reg, uint32_t reg_value); extern int qlnx_pci_find_capability(void *ecore_dev, int cap); +extern int qlnx_pci_find_ext_capability(void *ecore_dev, int ext_cap); extern uint32_t qlnx_direct_reg_rd32(void *p_hwfn, uint32_t *reg_addr); extern void qlnx_direct_reg_wr32(void *p_hwfn, void *reg_addr, uint32_t value); @@ -72,6 +73,7 @@ extern void qlnx_reg_wr32(void *p_hwfn, uint32_t reg_a extern void qlnx_reg_wr16(void *p_hwfn, uint32_t reg_addr, uint16_t value); extern void qlnx_dbell_wr32(void *p_hwfn, uint32_t reg_addr, uint32_t value); +extern void qlnx_dbell_wr32_db(void *p_hwfn, void *reg_addr, uint32_t value); extern void *qlnx_dma_alloc_coherent(void *ecore_dev, bus_addr_t *phys, uint32_t size); @@ -89,6 +91,16 @@ extern void qlnx_get_protocol_stats(void *cdev, int pr extern void qlnx_sp_isr(void *arg); +extern void qlnx_osal_vf_fill_acquire_resc_req(void *p_hwfn, void *p_resc_req, + void *p_sw_info); +extern void qlnx_osal_iov_vf_cleanup(void *p_hwfn, uint8_t relative_vf_id); +extern int qlnx_iov_chk_ucast(void *p_hwfn, int vfid, void *params); +extern int qlnx_iov_update_vport(void *p_hwfn, uint8_t vfid, void *params, + uint16_t *tlvs); +extern int qlnx_pf_vf_msg(void *p_hwfn, uint16_t relative_vf_id); +extern void qlnx_vf_flr_update(void *p_hwfn); + +#define nothing do {} while(0) #ifdef ECORE_PACKAGE /* Memory Types */ @@ -130,7 +142,6 @@ rounddown_pow_of_two(unsigned long x) ((type)(val1) < (type)(val2) ? (type)(val1) : (val2)) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) -#define nothing do {} while(0) #define BUILD_BUG_ON(cond) nothing #endif /* #ifndef QLNX_RDMA */ @@ -209,6 +220,7 @@ typedef struct osal_list_t #define DIRECT_REG_WR(p_hwfn, addr, value) qlnx_direct_reg_wr32(p_hwfn, addr, value) #define DIRECT_REG_WR64(p_hwfn, addr, value) \ qlnx_direct_reg_wr64(p_hwfn, addr, value) +#define DIRECT_REG_WR_DB(p_hwfn, addr, value) qlnx_dbell_wr32_db(p_hwfn, addr, value) #define DIRECT_REG_RD(p_hwfn, addr) qlnx_direct_reg_rd32(p_hwfn, addr) #define REG_RD(hwfn, addr) qlnx_reg_rd32(hwfn, addr) #define DOORBELL(hwfn, addr, value) \ @@ -238,7 +250,8 @@ typedef struct osal_list_t #define OSAL_DPC_ALLOC(hwfn) malloc(PAGE_SIZE, M_QLNXBUF, M_NOWAIT) #define OSAL_DPC_INIT(dpc, hwfn) nothing -#define OSAL_SCHEDULE_RECOVERY_HANDLER(x) nothing +extern void qlnx_schedule_recovery(void *p_hwfn); +#define OSAL_SCHEDULE_RECOVERY_HANDLER(x) do {qlnx_schedule_recovery(x);} while(0) #define OSAL_HW_ERROR_OCCURRED(hwfn, err_type) nothing #define OSAL_DPC_SYNC(hwfn) nothing @@ -371,7 +384,9 @@ do { \ #define OSAL_PCI_WRITE_CONFIG_DWORD(dev, reg, value) \ qlnx_pci_write_config_dword(dev, reg, value); -#define OSAL_PCI_FIND_CAPABILITY(dev, cap) qlnx_pci_find_capability(dev, cap); +#define OSAL_PCI_FIND_CAPABILITY(dev, cap) qlnx_pci_find_capability(dev, cap) +#define OSAL_PCI_FIND_EXT_CAPABILITY(dev, ext_cap) \ + qlnx_pci_find_ext_capability(dev, ext_cap) #define OSAL_MMIOWB(dev) qlnx_barrier(dev) #define OSAL_BARRIER(dev) qlnx_barrier(dev) @@ -390,8 +405,7 @@ do { \ #define OSAL_FIND_FIRST_ZERO_BIT(bitmap, length) \ find_first_zero_bit(bitmap, length) -#define OSAL_LINK_UPDATE(hwfn) qlnx_link_update(hwfn) -#define OSAL_VF_FLR_UPDATE(hwfn) +#define OSAL_LINK_UPDATE(hwfn, ptt) qlnx_link_update(hwfn) #define QLNX_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define QLNX_ROUNDUP(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) @@ -536,8 +550,36 @@ OSAL_CRC8(u8 * cdu_crc8_table, u8 * data_to_crc, int d #define OSAL_HW_INFO_CHANGE(p_hwfn, offset) #define OSAL_MFW_TLV_REQ(p_hwfn) -#define OSAL_VF_FILL_ACQUIRE_RESC_REQ(p_hwfn, req, vf_sw_info) {}; +#define OSAL_LLDP_RX_TLVS(p_hwfn, buffer, len) +#define OSAL_MFW_CMD_PREEMPT(p_hwfn) +#define OSAL_TRANSCEIVER_UPDATE(p_hwfn) +#define OSAL_MFW_FILL_TLV_DATA(p_hwfn, group, data) (0) + #define OSAL_VF_UPDATE_ACQUIRE_RESC_RESP(p_hwfn, res) (0) + +#define OSAL_VF_FILL_ACQUIRE_RESC_REQ(p_hwfn, req, vf_sw_info) \ + qlnx_osal_vf_fill_acquire_resc_req(p_hwfn, req, vf_sw_info) + +#define OSAL_IOV_PF_RESP_TYPE(p_hwfn, relative_vf_id, status) +#define OSAL_IOV_VF_CLEANUP(p_hwfn, relative_vf_id) \ + qlnx_osal_iov_vf_cleanup(p_hwfn, relative_vf_id) + +#define OSAL_IOV_VF_ACQUIRE(p_hwfn, relative_vf_id) ECORE_SUCCESS +#define OSAL_IOV_GET_OS_TYPE() VFPF_ACQUIRE_OS_FREEBSD +#define OSAL_IOV_PRE_START_VPORT(p_hwfn, relative_vf_id, params) ECORE_SUCCESS +#define OSAL_IOV_POST_START_VPORT(p_hwfn, relative_vf_id, vport_id, opaque_fid) +#define OSAL_PF_VALIDATE_MODIFY_TUNN_CONFIG(p_hwfn, x, y, z) ECORE_SUCCESS +#define OSAL_IOV_CHK_UCAST(p_hwfn, vfid, params) \ + qlnx_iov_chk_ucast(p_hwfn, vfid, params); +#define OSAL_PF_VF_MALICIOUS(p_hwfn, relative_vf_id) +#define OSAL_IOV_VF_MSG_TYPE(p_hwfn, relative_vf_id, type) +#define OSAL_IOV_VF_VPORT_UPDATE(p_hwfn, vfid, params, tlvs) \ + qlnx_iov_update_vport(p_hwfn, vfid, params, tlvs) +#define OSAL_PF_VF_MSG(p_hwfn, relative_vf_id) \ + qlnx_pf_vf_msg(p_hwfn, relative_vf_id) + +#define OSAL_VF_FLR_UPDATE(p_hwfn) qlnx_vf_flr_update(p_hwfn) +#define OSAL_IOV_VF_VPORT_STOP(p_hwfn, vf) #endif /* #ifdef ECORE_PACKAGE */ Modified: stable/11/sys/dev/qlnx/qlnxe/common_hsi.h ============================================================================== --- stable/11/sys/dev/qlnx/qlnxe/common_hsi.h Thu Aug 9 01:05:25 2018 (r337516) +++ stable/11/sys/dev/qlnx/qlnxe/common_hsi.h Thu Aug 9 01:17:35 2018 (r337517) @@ -104,8 +104,8 @@ #define FW_MAJOR_VERSION 8 -#define FW_MINOR_VERSION 30 -#define FW_REVISION_VERSION 0 +#define FW_MINOR_VERSION 33 +#define FW_REVISION_VERSION 7 #define FW_ENGINEERING_VERSION 0 /***********************/ @@ -113,76 +113,69 @@ /***********************/ /* PCI functions */ -#define MAX_NUM_PORTS_BB (2) -#define MAX_NUM_PORTS_K2 (4) -#define MAX_NUM_PORTS_E5 (MAX_NUM_PORTS_K2) -#define MAX_NUM_PORTS (MAX_NUM_PORTS_E5) +#define MAX_NUM_PORTS_BB (2) +#define MAX_NUM_PORTS_K2 (4) +#define MAX_NUM_PORTS_E5 (4) +#define MAX_NUM_PORTS (MAX_NUM_PORTS_E5) -#define MAX_NUM_PFS_BB (8) -#define MAX_NUM_PFS_K2 (16) -#define MAX_NUM_PFS_E5 (MAX_NUM_PFS_K2) -#define MAX_NUM_PFS (MAX_NUM_PFS_E5) -#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */ +#define MAX_NUM_PFS_BB (8) +#define MAX_NUM_PFS_K2 (16) +#define MAX_NUM_PFS_E5 (16) +#define MAX_NUM_PFS (MAX_NUM_PFS_E5) +#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */ -#define MAX_NUM_VFS_BB (120) -#define MAX_NUM_VFS_K2 (192) -#define MAX_NUM_VFS_E4 (MAX_NUM_VFS_K2) -#define MAX_NUM_VFS_E5 (240) -#define COMMON_MAX_NUM_VFS (MAX_NUM_VFS_E5) +#define MAX_NUM_VFS_BB (120) +#define MAX_NUM_VFS_K2 (192) +#define MAX_NUM_VFS_E4 (MAX_NUM_VFS_K2) +#define MAX_NUM_VFS_E5 (240) +#define COMMON_MAX_NUM_VFS (MAX_NUM_VFS_E5) -#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB) -#define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2) -#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS_E4) +#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB) +#define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2) +#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS_E4) /* in both BB and K2, the VF number starts from 16. so for arrays containing all */ /* possible PFs and VFs - we need a constant for this size */ -#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB) -#define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2) -#define MAX_FUNCTION_NUMBER_E4 (MAX_NUM_PFS + MAX_NUM_VFS_E4) -#define MAX_FUNCTION_NUMBER_E5 (MAX_NUM_PFS + MAX_NUM_VFS_E5) -#define COMMON_MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS_E5) +#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB) +#define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2) +#define MAX_FUNCTION_NUMBER_E4 (MAX_NUM_PFS + MAX_NUM_VFS_E4) +#define MAX_FUNCTION_NUMBER_E5 (MAX_NUM_PFS + MAX_NUM_VFS_E5) +#define COMMON_MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS_E5) -#define MAX_NUM_VPORTS_K2 (208) -#define MAX_NUM_VPORTS_BB (160) -#define MAX_NUM_VPORTS_E4 (MAX_NUM_VPORTS_K2) -#define MAX_NUM_VPORTS_E5 (256) -#define COMMON_MAX_NUM_VPORTS (MAX_NUM_VPORTS_E5) +#define MAX_NUM_VPORTS_K2 (208) +#define MAX_NUM_VPORTS_BB (160) +#define MAX_NUM_VPORTS_E4 (MAX_NUM_VPORTS_K2) +#define MAX_NUM_VPORTS_E5 (256) +#define COMMON_MAX_NUM_VPORTS (MAX_NUM_VPORTS_E5) -#define MAX_NUM_L2_QUEUES_K2 (320) #define MAX_NUM_L2_QUEUES_BB (256) -#define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_K2) +#define MAX_NUM_L2_QUEUES_K2 (320) +#define MAX_NUM_L2_QUEUES_E5 (320) /* TODO_E5_VITALY - fix to 512 */ +#define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_E5) /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */ -#define NUM_PHYS_TCS_4PORT_K2 (4) -#define NUM_PHYS_TCS_4PORT_E5 (6) -#define NUM_OF_PHYS_TCS (8) -#define PURE_LB_TC NUM_OF_PHYS_TCS -#define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1) -#define NUM_TCS_4PORT_E5 (NUM_PHYS_TCS_4PORT_E5 + 1) -#define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1) +#define NUM_PHYS_TCS_4PORT_K2 4 +#define NUM_PHYS_TCS_4PORT_TX_E5 6 +#define NUM_PHYS_TCS_4PORT_RX_E5 4 +#define NUM_OF_PHYS_TCS 8 +#define PURE_LB_TC NUM_OF_PHYS_TCS +#define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1) +#define NUM_TCS_4PORT_TX_E5 (NUM_PHYS_TCS_4PORT_TX_E5 + 1) +#define NUM_TCS_4PORT_RX_E5 (NUM_PHYS_TCS_4PORT_RX_E5 + 1) +#define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1) -/* Num of possible traffic priority values */ -#define NUM_OF_PRIO (8) - /* CIDs */ #define NUM_OF_CONNECTION_TYPES_E4 (8) #define NUM_OF_CONNECTION_TYPES_E5 (16) -#define NUM_OF_TASK_TYPES (8) -#define NUM_OF_LCIDS (320) -#define NUM_OF_LTIDS (320) +#define NUM_OF_TASK_TYPES (8) +#define NUM_OF_LCIDS (320) +#define NUM_OF_LTIDS (320) -/* Clock values */ -#define MASTER_CLK_FREQ_E4 (375e6) -#define STORM_CLK_FREQ_E4 (1000e6) -#define CLK25M_CLK_FREQ_E4 (25e6) - -#define STORM_CLK_DUAL_CORE_FREQ_E5 (3000e6) - /* Global PXP windows (GTT) */ -#define NUM_OF_GTT 19 -#define GTT_DWORD_SIZE_BITS 10 -#define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2) -#define GTT_DWORD_SIZE (1 << GTT_DWORD_SIZE_BITS) +#define NUM_OF_GTT 19 +#define GTT_DWORD_SIZE_BITS 10 +#define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2) +#define GTT_DWORD_SIZE (1 << GTT_DWORD_SIZE_BITS) /* Tools Version */ #define TOOLS_VERSION 10 @@ -417,7 +410,7 @@ /* Number of Protocol Indices per Status Block */ #define PIS_PER_SB_E4 12 #define PIS_PER_SB_E5 8 -#define MAX_PIS_PER_SB OSAL_MAX_T(u8, PIS_PER_SB_E4, PIS_PER_SB_E5) +#define MAX_PIS_PER_SB OSAL_MAX_T(PIS_PER_SB_E4,PIS_PER_SB_E5) #define CAU_HC_STOPPED_STATE 3 /* fsm is stopped or not valid for this sb */ @@ -548,10 +541,6 @@ /* VF BAR */ #define PXP_VF_BAR0 0 -#define PXP_VF_BAR0_START_GRC 0x3E00 -#define PXP_VF_BAR0_GRC_LENGTH 0x200 -#define PXP_VF_BAR0_END_GRC (PXP_VF_BAR0_START_GRC + PXP_VF_BAR0_GRC_LENGTH - 1) - #define PXP_VF_BAR0_START_IGU 0 #define PXP_VF_BAR0_IGU_LENGTH 0x3000 #define PXP_VF_BAR0_END_IGU (PXP_VF_BAR0_START_IGU + PXP_VF_BAR0_IGU_LENGTH - 1) @@ -582,9 +571,17 @@ #define PXP_VF_BAR0_START_PSDM_ZONE_B 0x3c00 #define PXP_VF_BAR0_END_PSDM_ZONE_B (PXP_VF_BAR0_START_PSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1) +#define PXP_VF_BAR0_START_GRC 0x3E00 +#define PXP_VF_BAR0_GRC_LENGTH 0x200 +#define PXP_VF_BAR0_END_GRC (PXP_VF_BAR0_START_GRC + PXP_VF_BAR0_GRC_LENGTH - 1) + #define PXP_VF_BAR0_START_SDM_ZONE_A 0x4000 #define PXP_VF_BAR0_END_SDM_ZONE_A 0x10000 +#define PXP_VF_BAR0_START_IGU2 0x10000 +#define PXP_VF_BAR0_IGU2_LENGTH 0xD000 +#define PXP_VF_BAR0_END_IGU2 (PXP_VF_BAR0_START_IGU2 + PXP_VF_BAR0_IGU2_LENGTH - 1) + #define PXP_VF_BAR0_GRC_WINDOW_LENGTH 32 #define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN 12 @@ -593,15 +590,16 @@ // ILT Records #define PXP_NUM_ILT_RECORDS_BB 7600 #define PXP_NUM_ILT_RECORDS_K2 11000 -#define MAX_NUM_ILT_RECORDS OSAL_MAX_T(u16, PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) +#define MAX_NUM_ILT_RECORDS OSAL_MAX_T(PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) +#define PXP_NUM_ILT_RECORDS_E5 13664 + // Host Interface -#define PXP_QUEUES_ZONE_MAX_NUM 320 +#define PXP_QUEUES_ZONE_MAX_NUM_E4 320 +#define PXP_QUEUES_ZONE_MAX_NUM_E5 512 - - /*****************/ /* PRM CONSTANTS */ /*****************/ @@ -651,18 +649,6 @@ #define PRS_GFT_CAM_LINES_NO_MATCH 31 /* - * Async data KCQ CQE - */ -struct async_data -{ - __le32 cid /* Context ID of the connection */; - __le16 itid /* Task Id of the task (for error that happened on a a task) */; - u8 error_code /* error code - relevant only if the opcode indicates its an error */; - u8 fw_debug_param /* internal fw debug parameter */; -}; - - -/* * Interrupt coalescing TimeSet */ struct coalescing_timeset @@ -692,24 +678,30 @@ struct eth_rx_prod_data }; -struct regpair +struct tcp_ulp_connect_done_params { - __le32 lo /* low word for reg-pair */; - __le32 hi /* high word for reg-pair */; + __le16 mss; + u8 snd_wnd_scale; + u8 flags; +#define TCP_ULP_CONNECT_DONE_PARAMS_TS_EN_MASK 0x1 +#define TCP_ULP_CONNECT_DONE_PARAMS_TS_EN_SHIFT 0 +#define TCP_ULP_CONNECT_DONE_PARAMS_RESERVED_MASK 0x7F +#define TCP_ULP_CONNECT_DONE_PARAMS_RESERVED_SHIFT 1 }; -/* - * Event Ring VF-PF Channel data - */ -struct vf_pf_channel_eqe_data +struct iscsi_connect_done_results { - struct regpair msg_addr /* VF-PF message address */; + __le16 icid /* Context ID of the connection */; + __le16 conn_id /* Driver connection ID */; + struct tcp_ulp_connect_done_params params /* decided tcp params after connect done */; }; + struct iscsi_eqe_data { - __le32 cid /* Context ID of the connection */; - __le16 conn_id /* Task Id of the task (for error that happened on a a task) */; + __le16 icid /* Context ID of the connection */; + __le16 conn_id /* Driver connection ID */; + __le16 reserved; u8 error_code /* error code - relevant only if the opcode indicates its an error */; u8 error_pdu_opcode_reserved; #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_MASK 0x3F /* The processed PDUs opcode on which happened the error - updated for specific error codes, by defualt=0xFF */ @@ -720,80 +712,8 @@ struct iscsi_eqe_data #define ISCSI_EQE_DATA_RESERVED0_SHIFT 7 }; -/* - * RoCE Destroy Event Data - */ -struct rdma_eqe_destroy_qp -{ - __le32 cid /* Dedicated field RoCE destroy QP event */; - u8 reserved[4]; -}; /* - * RDMA Event Data Union - */ -union rdma_eqe_data -{ - struct regpair async_handle /* Host handle for the Async Completions */; - struct rdma_eqe_destroy_qp rdma_destroy_qp_data /* RoCE Destroy Event Data */; -}; - -/* - * Event Ring malicious VF data - */ -struct malicious_vf_eqe_data -{ - u8 vf_id /* Malicious VF ID */; - u8 err_id /* Malicious VF error */; - __le16 reserved[3]; -}; - -/* - * Event Ring initial cleanup data - */ -struct initial_cleanup_eqe_data -{ - u8 vf_id /* VF ID */; - u8 reserved[7]; -}; - -/* - * Event Data Union - */ -union event_ring_data -{ - u8 bytes[8] /* Byte Array */; - struct vf_pf_channel_eqe_data vf_pf_channel /* VF-PF Channel data */; - struct iscsi_eqe_data iscsi_info /* Dedicated fields to iscsi data */; - union rdma_eqe_data rdma_data /* Dedicated field for RDMA data */; - struct malicious_vf_eqe_data malicious_vf /* Malicious VF data */; - struct initial_cleanup_eqe_data vf_init_cleanup /* VF Initial Cleanup data */; -}; - - -/* - * Event Ring Entry - */ -struct event_ring_entry -{ - u8 protocol_id /* Event Protocol ID */; - u8 opcode /* Event Opcode */; - __le16 reserved0 /* Reserved */; - __le16 echo /* Echo value from ramrod data on the host */; - u8 fw_return_code /* FW return code for SP ramrods */; - u8 flags; -#define EVENT_RING_ENTRY_ASYNC_MASK 0x1 /* 0: synchronous EQE - a completion of SP message. 1: asynchronous EQE */ -#define EVENT_RING_ENTRY_ASYNC_SHIFT 0 -#define EVENT_RING_ENTRY_RESERVED1_MASK 0x7F -#define EVENT_RING_ENTRY_RESERVED1_SHIFT 1 - union event_ring_data data; -}; - - - - - -/* * Multi function mode */ enum mf_mode @@ -824,9 +744,34 @@ enum protocol_type }; +struct regpair +{ + __le32 lo /* low word for reg-pair */; + __le32 hi /* high word for reg-pair */; +}; +/* + * RoCE Destroy Event Data + */ +struct rdma_eqe_destroy_qp +{ + __le32 cid /* Dedicated field RoCE destroy QP event */; + u8 reserved[4]; +}; /* + * RDMA Event Data Union + */ +union rdma_eqe_data +{ + struct regpair async_handle /* Host handle for the Async Completions */; + struct rdma_eqe_destroy_qp rdma_destroy_qp_data /* RoCE Destroy Event Data */; +}; + + + + +/* * Ustorm Queue Zone */ struct ustorm_eth_queue_zone @@ -843,7 +788,6 @@ struct ustorm_queue_zone }; - /* * status block structure */ @@ -894,6 +838,17 @@ struct cau_sb_entry /* + * Igu cleanup bit values to distinguish between clean or producer consumer update. + */ +enum command_type_bit +{ + IGU_COMMAND_TYPE_NOP=0, + IGU_COMMAND_TYPE_SET=1, + MAX_COMMAND_TYPE_BIT +}; + + +/* * core doorbell data */ struct core_db_data @@ -1339,90 +1294,74 @@ struct pxp_vf_zone_a_permission */ struct rdif_task_context { - __le32 initialRefTag; - __le16 appTagValue; - __le16 appTagMask; + __le32 initial_ref_tag; + __le16 app_tag_value; + __le16 app_tag_mask; u8 flags0; -#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0 -#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1 -#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1 -#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ -#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2 -#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1 -#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3 -#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3 /* 1/2/3 - Protection Type */ -#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4 -#define RDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ -#define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 -#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1 /* Keep reference tag constant */ -#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 7 - u8 partialDifData[7]; - __le16 partialCrcValue; - __le16 partialChecksumValue; - __le32 offsetInIO; +#define RDIF_TASK_CONTEXT_IGNORE_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_IGNORE_APP_TAG_SHIFT 0 +#define RDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_MASK 0x1 +#define RDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_SHIFT 1 +#define RDIF_TASK_CONTEXT_HOST_GUARD_TYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ +#define RDIF_TASK_CONTEXT_HOST_GUARD_TYPE_SHIFT 2 +#define RDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_MASK 0x1 +#define RDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_SHIFT 3 +#define RDIF_TASK_CONTEXT_PROTECTION_TYPE_MASK 0x3 /* 1/2/3 - Protection Type */ +#define RDIF_TASK_CONTEXT_PROTECTION_TYPE_SHIFT 4 +#define RDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ +#define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 +#define RDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_MASK 0x1 /* Keep reference tag constant */ +#define RDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_SHIFT 7 + u8 partial_dif_data[7]; + __le16 partial_crc_value; + __le16 partial_checksum_value; + __le32 offset_in_io; __le16 flags1; -#define RDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0 -#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1 -#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2 -#define RDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4 -#define RDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5 -#define RDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ -#define RDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6 -#define RDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ -#define RDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9 -#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ -#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11 -#define RDIF_TASK_CONTEXT_RESERVED0_MASK 0x1 -#define RDIF_TASK_CONTEXT_RESERVED0_SHIFT 12 -#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1 /* 0=None, 1=DIF */ -#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1 /* Forward application tag with mask */ -#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 14 -#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1 /* Forward reference tag with mask */ -#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 15 +#define RDIF_TASK_CONTEXT_VALIDATE_GUARD_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_GUARD_SHIFT 0 +#define RDIF_TASK_CONTEXT_VALIDATE_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_APP_TAG_SHIFT 1 +#define RDIF_TASK_CONTEXT_VALIDATE_REF_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_REF_TAG_SHIFT 2 +#define RDIF_TASK_CONTEXT_FORWARD_GUARD_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_GUARD_SHIFT 3 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_SHIFT 4 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_SHIFT 5 +#define RDIF_TASK_CONTEXT_INTERVAL_SIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ +#define RDIF_TASK_CONTEXT_INTERVAL_SIZE_SHIFT 6 +#define RDIF_TASK_CONTEXT_HOST_INTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ +#define RDIF_TASK_CONTEXT_HOST_INTERFACE_SHIFT 9 +#define RDIF_TASK_CONTEXT_DIF_BEFORE_DATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ +#define RDIF_TASK_CONTEXT_DIF_BEFORE_DATA_SHIFT 11 +#define RDIF_TASK_CONTEXT_RESERVED0_MASK 0x1 +#define RDIF_TASK_CONTEXT_RESERVED0_SHIFT 12 +#define RDIF_TASK_CONTEXT_NETWORK_INTERFACE_MASK 0x1 /* 0=None, 1=DIF */ +#define RDIF_TASK_CONTEXT_NETWORK_INTERFACE_SHIFT 13 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 /* Forward application tag with mask */ +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_SHIFT 14 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 /* Forward reference tag with mask */ +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_SHIFT 15 __le16 state; -#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_MASK 0xF -#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_SHIFT 0 -#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_MASK 0xF -#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_SHIFT 4 -#define RDIF_TASK_CONTEXT_ERRORINIO_MASK 0x1 -#define RDIF_TASK_CONTEXT_ERRORINIO_SHIFT 8 -#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1 -#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9 -#define RDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF /* mask for refernce tag handling */ -#define RDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 10 -#define RDIF_TASK_CONTEXT_RESERVED1_MASK 0x3 -#define RDIF_TASK_CONTEXT_RESERVED1_SHIFT 14 +#define RDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_MASK 0xF +#define RDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_SHIFT 0 +#define RDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_MASK 0xF +#define RDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_SHIFT 4 +#define RDIF_TASK_CONTEXT_ERROR_IN_IO_MASK 0x1 +#define RDIF_TASK_CONTEXT_ERROR_IN_IO_SHIFT 8 +#define RDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_MASK 0x1 +#define RDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_SHIFT 9 +#define RDIF_TASK_CONTEXT_REF_TAG_MASK_MASK 0xF /* mask for refernce tag handling */ +#define RDIF_TASK_CONTEXT_REF_TAG_MASK_SHIFT 10 +#define RDIF_TASK_CONTEXT_RESERVED1_MASK 0x3 +#define RDIF_TASK_CONTEXT_RESERVED1_SHIFT 14 __le32 reserved2; }; /* - * RSS hash type - */ -enum rss_hash_type -{ - RSS_HASH_TYPE_DEFAULT=0, - RSS_HASH_TYPE_IPV4=1, - RSS_HASH_TYPE_TCP_IPV4=2, - RSS_HASH_TYPE_IPV6=3, - RSS_HASH_TYPE_TCP_IPV6=4, - RSS_HASH_TYPE_UDP_IPV4=5, - RSS_HASH_TYPE_UDP_IPV6=6, - MAX_RSS_HASH_TYPE -}; - - -/* * status block structure */ struct status_block_e4 @@ -1469,85 +1408,85 @@ struct status_block_e5 */ struct tdif_task_context { - __le32 initialRefTag; - __le16 appTagValue; - __le16 appTagMask; - __le16 partialCrcValueB; - __le16 partialChecksumValueB; + __le32 initial_ref_tag; + __le16 app_tag_value; + __le16 app_tag_mask; + __le16 partial_crc_value_b; + __le16 partial_checksum_value_b; __le16 stateB; -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_MASK 0xF -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_SHIFT 0 -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_MASK 0xF -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_SHIFT 4 -#define TDIF_TASK_CONTEXT_ERRORINIOB_MASK 0x1 -#define TDIF_TASK_CONTEXT_ERRORINIOB_SHIFT 8 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9 -#define TDIF_TASK_CONTEXT_RESERVED0_MASK 0x3F -#define TDIF_TASK_CONTEXT_RESERVED0_SHIFT 10 +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_B_MASK 0xF +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_B_SHIFT 0 +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_B_MASK 0xF +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_B_SHIFT 4 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_B_MASK 0x1 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_B_SHIFT 8 +#define TDIF_TASK_CONTEXT_CHECKSUM_VERFLOW_MASK 0x1 +#define TDIF_TASK_CONTEXT_CHECKSUM_VERFLOW_SHIFT 9 +#define TDIF_TASK_CONTEXT_RESERVED0_MASK 0x3F +#define TDIF_TASK_CONTEXT_RESERVED0_SHIFT 10 u8 reserved1; u8 flags0; -#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0 -#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1 -#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1 -#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ -#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2 -#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1 -#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3 -#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3 /* 1/2/3 - Protection Type */ -#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4 -#define TDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ -#define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 -#define TDIF_TASK_CONTEXT_RESERVED2_MASK 0x1 -#define TDIF_TASK_CONTEXT_RESERVED2_SHIFT 7 +#define TDIF_TASK_CONTEXT_IGNORE_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_IGNORE_APP_TAG_SHIFT 0 +#define TDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_MASK 0x1 +#define TDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_SHIFT 1 +#define TDIF_TASK_CONTEXT_HOST_GUARD_TYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ +#define TDIF_TASK_CONTEXT_HOST_GUARD_TYPE_SHIFT 2 +#define TDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_MASK 0x1 +#define TDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_SHIFT 3 +#define TDIF_TASK_CONTEXT_PROTECTION_TYPE_MASK 0x3 /* 1/2/3 - Protection Type */ +#define TDIF_TASK_CONTEXT_PROTECTION_TYPE_SHIFT 4 +#define TDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ +#define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 +#define TDIF_TASK_CONTEXT_RESERVED2_MASK 0x1 +#define TDIF_TASK_CONTEXT_RESERVED2_SHIFT 7 __le32 flags1; -#define TDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0 -#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1 -#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2 -#define TDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4 -#define TDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5 -#define TDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ -#define TDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6 -#define TDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ -#define TDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9 -#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ -#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11 -#define TDIF_TASK_CONTEXT_RESERVED3_MASK 0x1 /* reserved */ -#define TDIF_TASK_CONTEXT_RESERVED3_SHIFT 12 -#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1 /* 0=None, 1=DIF */ -#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13 -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_MASK 0xF -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_SHIFT 14 -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_MASK 0xF -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_SHIFT 18 -#define TDIF_TASK_CONTEXT_ERRORINIOA_MASK 0x1 -#define TDIF_TASK_CONTEXT_ERRORINIOA_SHIFT 22 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_MASK 0x1 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_SHIFT 23 -#define TDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF /* mask for refernce tag handling */ -#define TDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 24 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1 /* Forward application tag with mask */ -#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 28 -#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1 /* Forward reference tag with mask */ -#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 29 -#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1 /* Keep reference tag constant */ -#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 30 -#define TDIF_TASK_CONTEXT_RESERVED4_MASK 0x1 -#define TDIF_TASK_CONTEXT_RESERVED4_SHIFT 31 - __le32 offsetInIOB; - __le16 partialCrcValueA; - __le16 partialChecksumValueA; - __le32 offsetInIOA; - u8 partialDifDataA[8]; - u8 partialDifDataB[8]; +#define TDIF_TASK_CONTEXT_VALIDATE_GUARD_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_GUARD_SHIFT 0 +#define TDIF_TASK_CONTEXT_VALIDATE_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_APP_TAG_SHIFT 1 +#define TDIF_TASK_CONTEXT_VALIDATE_REF_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_REF_TAG_SHIFT 2 +#define TDIF_TASK_CONTEXT_FORWARD_GUARD_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_GUARD_SHIFT 3 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_SHIFT 4 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_SHIFT 5 +#define TDIF_TASK_CONTEXT_INTERVAL_SIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ +#define TDIF_TASK_CONTEXT_INTERVAL_SIZE_SHIFT 6 +#define TDIF_TASK_CONTEXT_HOST_INTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ +#define TDIF_TASK_CONTEXT_HOST_INTERFACE_SHIFT 9 +#define TDIF_TASK_CONTEXT_DIF_BEFORE_DATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ +#define TDIF_TASK_CONTEXT_DIF_BEFORE_DATA_SHIFT 11 +#define TDIF_TASK_CONTEXT_RESERVED3_MASK 0x1 /* reserved */ +#define TDIF_TASK_CONTEXT_RESERVED3_SHIFT 12 +#define TDIF_TASK_CONTEXT_NETWORK_INTERFACE_MASK 0x1 /* 0=None, 1=DIF */ +#define TDIF_TASK_CONTEXT_NETWORK_INTERFACE_SHIFT 13 +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_A_MASK 0xF +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_A_SHIFT 14 +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_A_MASK 0xF +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_A_SHIFT 18 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_A_MASK 0x1 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_A_SHIFT 22 +#define TDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_A_MASK 0x1 +#define TDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_A_SHIFT 23 +#define TDIF_TASK_CONTEXT_REF_TAG_MASK_MASK 0xF /* mask for refernce tag handling */ +#define TDIF_TASK_CONTEXT_REF_TAG_MASK_SHIFT 24 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 /* Forward application tag with mask */ +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_SHIFT 28 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 /* Forward reference tag with mask */ +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_SHIFT 29 +#define TDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_MASK 0x1 /* Keep reference tag constant */ +#define TDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_SHIFT 30 +#define TDIF_TASK_CONTEXT_RESERVED4_MASK 0x1 +#define TDIF_TASK_CONTEXT_RESERVED4_SHIFT 31 + __le32 offset_in_io_b; + __le16 partial_crc_value_a; + __le16 partial_checksum_value_a; + __le32 offset_in_io_a; + u8 partial_dif_data_a[8]; + u8 partial_dif_data_b[8]; }; @@ -1602,7 +1541,7 @@ struct timers_context /* - * Enum for next_protocol field of tunnel_parsing_flags + * Enum for next_protocol field of tunnel_parsing_flags / tunnelTypeDesc */ enum tunnel_next_protocol { Modified: stable/11/sys/dev/qlnx/qlnxe/ecore.h ============================================================================== --- stable/11/sys/dev/qlnx/qlnxe/ecore.h Thu Aug 9 01:05:25 2018 (r337516) +++ stable/11/sys/dev/qlnx/qlnxe/ecore.h Thu Aug 9 01:17:35 2018 (r337517) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Cavium, Inc. + * Copyright (c) 2017-2018 Cavium, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ #ifndef __ECORE_H #define __ECORE_H +#include "ecore_status.h" #include "ecore_hsi_common.h" #include "ecore_hsi_debug_tools.h" #include "ecore_hsi_init_func.h" @@ -39,8 +40,8 @@ #include "mcp_public.h" #define ECORE_MAJOR_VERSION 8 -#define ECORE_MINOR_VERSION 30 -#define ECORE_REVISION_VERSION 0 +#define ECORE_MINOR_VERSION 33 +#define ECORE_REVISION_VERSION 5 #define ECORE_ENGINEERING_VERSION 0 #define ECORE_VERSION \ @@ -58,6 +59,7 @@ /* Constants */ #define ECORE_WID_SIZE (1024) +#define ECORE_MIN_WIDS (4) /* Configurable */ #define ECORE_PF_DEMS_SIZE (4) @@ -80,11 +82,14 @@ enum ecore_nvm_cmd { ECORE_PHY_RAW_WRITE = DRV_MSG_CODE_PHY_RAW_WRITE, ECORE_PHY_CORE_READ = DRV_MSG_CODE_PHY_CORE_READ, ECORE_PHY_CORE_WRITE = DRV_MSG_CODE_PHY_CORE_WRITE, + ECORE_ENCRYPT_PASSWORD = DRV_MSG_CODE_ENCRYPT_PASSWORD, ECORE_GET_MCP_NVM_RESP = 0xFFFFFF00 }; +#ifndef LINUX_REMOVE #if !defined(CONFIG_ECORE_L2) && !defined(CONFIG_ECORE_ROCE) && \ - !defined(CONFIG_ECORE_FCOE) && !defined(CONFIG_ECORE_ISCSI) + !defined(CONFIG_ECORE_FCOE) && !defined(CONFIG_ECORE_ISCSI) && \ + !defined(CONFIG_ECORE_IWARP) #define CONFIG_ECORE_L2 #define CONFIG_ECORE_SRIOV #define CONFIG_ECORE_ROCE @@ -93,8 +98,10 @@ enum ecore_nvm_cmd { #define CONFIG_ECORE_ISCSI #define CONFIG_ECORE_LL2 #endif +#endif /* helpers */ +#ifndef __EXTRACT__LINUX__IF__ #define MASK_FIELD(_name, _value) \ ((_value) &= (_name##_MASK)) @@ -115,9 +122,10 @@ do { \ #define SET_MFW_FIELD(name, field, value) \ do { \ - (name) &= ~((field ## _MASK) << (field ## _OFFSET)); \ + (name) &= ~(field ## _MASK); \ (name) |= (((value) << (field ## _OFFSET)) & (field ## _MASK)); \ } while (0) +#endif static OSAL_INLINE u32 DB_ADDR(u32 cid, u32 DEMS) { @@ -139,6 +147,7 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS) ((sizeof(type_name) + (u32)(1<<(p_hwfn->p_dev->cache_shift))-1) & \ ~((1<<(p_hwfn->p_dev->cache_shift))-1)) +#ifndef LINUX_REMOVE #ifndef U64_HI #define U64_HI(val) ((u32)(((u64)(val)) >> 32)) #endif @@ -146,7 +155,9 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS) #ifndef U64_LO #define U64_LO(val) ((u32)(((u64)(val)) & 0xffffffff)) #endif +#endif +#ifndef __EXTRACT__LINUX__IF__ #ifndef UEFI /* Debug print definitions */ #define DP_ERR(p_dev, fmt, ...) \ @@ -203,6 +214,7 @@ enum DP_LEVEL { #define ECORE_LOG_NOTICE_MASK (0x80000000) enum DP_MODULE { +#ifndef LINUX_REMOVE ECORE_MSG_DRV = 0x0001, ECORE_MSG_PROBE = 0x0002, ECORE_MSG_LINK = 0x0004, @@ -218,6 +230,7 @@ enum DP_MODULE { ECORE_MSG_PKTDATA = 0x1000, ECORE_MSG_HW = 0x2000, ECORE_MSG_WOL = 0x4000, +#endif ECORE_MSG_SPQ = 0x10000, ECORE_MSG_STATS = 0x20000, ECORE_MSG_DCB = 0x40000, @@ -232,6 +245,7 @@ enum DP_MODULE { ECORE_MSG_DEBUG = 0x8000000, /* to be added...up to 0x8000000 */ }; +#endif #define for_each_hwfn(p_dev, i) for (i = 0; i < p_dev->num_hwfns; i++) @@ -252,6 +266,7 @@ struct ecore_l2_info; struct ecore_igu_info; struct ecore_mcp_info; struct ecore_dcbx_info; +struct ecore_llh_info; struct ecore_rt_data { u32 *init_val; @@ -321,6 +336,15 @@ struct ecore_qm_iids { u32 tids; }; +/* The PCI relax ordering is either taken care by management FW or can be + * enable/disable by ecore client. + */ +enum ecore_pci_rlx_odr { + ECORE_DEFAULT_RLX_ODR, + ECORE_ENABLE_RLX_ODR, + ECORE_DISABLE_RLX_ODR +}; + #define MAX_PF_PER_PORT 8 /* HW / FW resources, output of features supported below, most information @@ -387,6 +411,7 @@ enum ecore_dev_cap { ECORE_DEV_CAP_IWARP }; +#ifndef __EXTRACT__LINUX__IF__ enum ecore_hw_err_type { ECORE_HW_ERR_FAN_FAIL, ECORE_HW_ERR_MFW_RESP_FAIL, @@ -395,6 +420,7 @@ enum ecore_hw_err_type { ECORE_HW_ERR_RAMROD_FAIL, ECORE_HW_ERR_FW_ASSERT, }; +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 9 01:32:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB791073010; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 751B277663; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5752812AB5; Thu, 9 Aug 2018 01:32:10 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w791WAWt057201; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w791WAQm057199; Thu, 9 Aug 2018 01:32:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090132.w791WAQm057199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 01:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337518 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 337518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:32:10 -0000 Author: kevans Date: Thu Aug 9 01:32:09 2018 New Revision: 337518 URL: https://svnweb.freebsd.org/changeset/base/337518 Log: kern: Add a BOOT_TAG marker at the beginning of boot dmesg From the "newly licensed to drive" PR department, add a BOOT_TAG marker (by default, --<>--, to the beginning of each boot's dmesg. This makes it easier to do textproc magic to locate the start of each boot and, of particular interest to some, the dmesg of the current boot. The PR has a dmesg(8) component as well that I've opted not to include for the moment- it was the more contentious part of this PR. bde@ also made the statement that this boot tag should be written with an ordinary printf, which I've- for the moment- declined to change about this patch to keep it more transparent to observer of the boot process. PR: 43434 Submitted by: dak (basically rewritten) MFC after: maybe never Modified: head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) cp = (char *)ptr; msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = 1; Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 01:17:35 2018 (r337517) +++ head/sys/sys/msgbuf.h Thu Aug 9 01:32:09 2018 (r337518) @@ -60,6 +60,9 @@ struct msgbuf { /* Subtract sequence numbers. Note that only positive values result. */ #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<>---" + #ifdef _KERNEL extern int msgbufsize; extern int msgbuftrigger; From owner-svn-src-all@freebsd.org Thu Aug 9 01:39:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6091F1073893; Thu, 9 Aug 2018 01:39:49 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1544B77BD5; Thu, 9 Aug 2018 01:39:49 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EACCC12B10; Thu, 9 Aug 2018 01:39:48 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w791dmRV057582; Thu, 9 Aug 2018 01:39:48 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w791dmN7057579; Thu, 9 Aug 2018 01:39:48 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201808090139.w791dmN7057579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 9 Aug 2018 01:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337519 - in stable/10/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxev X-SVN-Group: stable-10 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: in stable/10/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxev X-SVN-Commit-Revision: 337519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 01:39:49 -0000 Author: davidcs Date: Thu Aug 9 01:39:47 2018 New Revision: 337519 URL: https://svnweb.freebsd.org/changeset/base/337519 Log: MFC r336695 Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ. Added support for LLDP passthru Upgrade ECORE to version 8.33.5.0 Upgrade STORMFW to version 8.33.7.0 Added: stable/10/sys/dev/qlnx/qlnxe/ecore_iwarp.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_iwarp.h stable/10/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c stable/10/sys/dev/qlnx/qlnxe/ecore_rdma.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_rdma.h stable/10/sys/dev/qlnx/qlnxe/ecore_rdma_api.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_rdma_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_sriov.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_sriov.c stable/10/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h stable/10/sys/dev/qlnx/qlnxe/ecore_vf.c - copied unchanged from r336695, head/sys/dev/qlnx/qlnxe/ecore_vf.c stable/10/sys/modules/qlnx/qlnxev/ - copied from r336695, head/sys/modules/qlnx/qlnxev/ Modified: stable/10/sys/dev/qlnx/qlnxe/bcm_osal.h stable/10/sys/dev/qlnx/qlnxe/common_hsi.h stable/10/sys/dev/qlnx/qlnxe/ecore.h stable/10/sys/dev/qlnx/qlnxe/ecore_chain.h stable/10/sys/dev/qlnx/qlnxe/ecore_cxt.c stable/10/sys/dev/qlnx/qlnxe/ecore_cxt.h stable/10/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c stable/10/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h stable/10/sys/dev/qlnx/qlnxe/ecore_dbg_values.h stable/10/sys/dev/qlnx/qlnxe/ecore_dcbx.c stable/10/sys/dev/qlnx/qlnxe/ecore_dcbx.h stable/10/sys/dev/qlnx/qlnxe/ecore_dcbx_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_dev.c stable/10/sys/dev/qlnx/qlnxe/ecore_dev_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_fcoe.h stable/10/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_common.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_init_func.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_init_tool.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h stable/10/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h stable/10/sys/dev/qlnx/qlnxe/ecore_hw.c stable/10/sys/dev/qlnx/qlnxe/ecore_hw.h stable/10/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c stable/10/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h stable/10/sys/dev/qlnx/qlnxe/ecore_init_ops.c stable/10/sys/dev/qlnx/qlnxe/ecore_init_values.h stable/10/sys/dev/qlnx/qlnxe/ecore_int.c stable/10/sys/dev/qlnx/qlnxe/ecore_int.h stable/10/sys/dev/qlnx/qlnxe/ecore_int_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_iov_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_iro.h stable/10/sys/dev/qlnx/qlnxe/ecore_iro_values.h stable/10/sys/dev/qlnx/qlnxe/ecore_iscsi.h stable/10/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_l2.c stable/10/sys/dev/qlnx/qlnxe/ecore_l2.h stable/10/sys/dev/qlnx/qlnxe/ecore_l2_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_ll2.h stable/10/sys/dev/qlnx/qlnxe/ecore_ll2_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_mcp.c stable/10/sys/dev/qlnx/qlnxe/ecore_mcp.h stable/10/sys/dev/qlnx/qlnxe/ecore_mcp_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_ooo.h stable/10/sys/dev/qlnx/qlnxe/ecore_proto_if.h stable/10/sys/dev/qlnx/qlnxe/ecore_roce.h stable/10/sys/dev/qlnx/qlnxe/ecore_roce_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_rt_defs.h stable/10/sys/dev/qlnx/qlnxe/ecore_sp_commands.c stable/10/sys/dev/qlnx/qlnxe/ecore_sp_commands.h stable/10/sys/dev/qlnx/qlnxe/ecore_spq.c stable/10/sys/dev/qlnx/qlnxe/ecore_spq.h stable/10/sys/dev/qlnx/qlnxe/ecore_sriov.h stable/10/sys/dev/qlnx/qlnxe/ecore_utils.h stable/10/sys/dev/qlnx/qlnxe/ecore_vf.h stable/10/sys/dev/qlnx/qlnxe/ecore_vf_api.h stable/10/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h stable/10/sys/dev/qlnx/qlnxe/eth_common.h stable/10/sys/dev/qlnx/qlnxe/fcoe_common.h stable/10/sys/dev/qlnx/qlnxe/iscsi_common.h stable/10/sys/dev/qlnx/qlnxe/mcp_private.h stable/10/sys/dev/qlnx/qlnxe/mcp_public.h stable/10/sys/dev/qlnx/qlnxe/nvm_cfg.h stable/10/sys/dev/qlnx/qlnxe/nvm_map.h stable/10/sys/dev/qlnx/qlnxe/qlnx_def.h stable/10/sys/dev/qlnx/qlnxe/qlnx_ioctl.c stable/10/sys/dev/qlnx/qlnxe/qlnx_ioctl.h stable/10/sys/dev/qlnx/qlnxe/qlnx_os.c stable/10/sys/dev/qlnx/qlnxe/qlnx_os.h stable/10/sys/dev/qlnx/qlnxe/qlnx_ver.h stable/10/sys/dev/qlnx/qlnxe/rdma_common.h stable/10/sys/dev/qlnx/qlnxe/reg_addr.h stable/10/sys/dev/qlnx/qlnxe/roce_common.h stable/10/sys/dev/qlnx/qlnxe/spad_layout.h stable/10/sys/dev/qlnx/qlnxe/storage_common.h stable/10/sys/dev/qlnx/qlnxe/tcp_common.h stable/10/sys/modules/qlnx/Makefile stable/10/sys/modules/qlnx/qlnxe/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- stable/10/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Aug 9 01:32:09 2018 (r337518) +++ stable/10/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Aug 9 01:39:47 2018 (r337519) @@ -34,7 +34,7 @@ #include "ecore_status.h" #include -#if __FreeBSD_version >= 1200000 +#if __FreeBSD_version >= 1200032 #include #else #if __FreeBSD_version >= 1100090 @@ -62,6 +62,7 @@ extern void qlnx_pci_write_config_word(void *ecore_dev extern void qlnx_pci_write_config_dword(void *ecore_dev, uint32_t pci_reg, uint32_t reg_value); extern int qlnx_pci_find_capability(void *ecore_dev, int cap); +extern int qlnx_pci_find_ext_capability(void *ecore_dev, int ext_cap); extern uint32_t qlnx_direct_reg_rd32(void *p_hwfn, uint32_t *reg_addr); extern void qlnx_direct_reg_wr32(void *p_hwfn, void *reg_addr, uint32_t value); @@ -72,6 +73,7 @@ extern void qlnx_reg_wr32(void *p_hwfn, uint32_t reg_a extern void qlnx_reg_wr16(void *p_hwfn, uint32_t reg_addr, uint16_t value); extern void qlnx_dbell_wr32(void *p_hwfn, uint32_t reg_addr, uint32_t value); +extern void qlnx_dbell_wr32_db(void *p_hwfn, void *reg_addr, uint32_t value); extern void *qlnx_dma_alloc_coherent(void *ecore_dev, bus_addr_t *phys, uint32_t size); @@ -89,6 +91,16 @@ extern void qlnx_get_protocol_stats(void *cdev, int pr extern void qlnx_sp_isr(void *arg); +extern void qlnx_osal_vf_fill_acquire_resc_req(void *p_hwfn, void *p_resc_req, + void *p_sw_info); +extern void qlnx_osal_iov_vf_cleanup(void *p_hwfn, uint8_t relative_vf_id); +extern int qlnx_iov_chk_ucast(void *p_hwfn, int vfid, void *params); +extern int qlnx_iov_update_vport(void *p_hwfn, uint8_t vfid, void *params, + uint16_t *tlvs); +extern int qlnx_pf_vf_msg(void *p_hwfn, uint16_t relative_vf_id); +extern void qlnx_vf_flr_update(void *p_hwfn); + +#define nothing do {} while(0) #ifdef ECORE_PACKAGE /* Memory Types */ @@ -130,7 +142,6 @@ rounddown_pow_of_two(unsigned long x) ((type)(val1) < (type)(val2) ? (type)(val1) : (val2)) #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0])) -#define nothing do {} while(0) #define BUILD_BUG_ON(cond) nothing #endif /* #ifndef QLNX_RDMA */ @@ -209,6 +220,7 @@ typedef struct osal_list_t #define DIRECT_REG_WR(p_hwfn, addr, value) qlnx_direct_reg_wr32(p_hwfn, addr, value) #define DIRECT_REG_WR64(p_hwfn, addr, value) \ qlnx_direct_reg_wr64(p_hwfn, addr, value) +#define DIRECT_REG_WR_DB(p_hwfn, addr, value) qlnx_dbell_wr32_db(p_hwfn, addr, value) #define DIRECT_REG_RD(p_hwfn, addr) qlnx_direct_reg_rd32(p_hwfn, addr) #define REG_RD(hwfn, addr) qlnx_reg_rd32(hwfn, addr) #define DOORBELL(hwfn, addr, value) \ @@ -238,7 +250,8 @@ typedef struct osal_list_t #define OSAL_DPC_ALLOC(hwfn) malloc(PAGE_SIZE, M_QLNXBUF, M_NOWAIT) #define OSAL_DPC_INIT(dpc, hwfn) nothing -#define OSAL_SCHEDULE_RECOVERY_HANDLER(x) nothing +extern void qlnx_schedule_recovery(void *p_hwfn); +#define OSAL_SCHEDULE_RECOVERY_HANDLER(x) do {qlnx_schedule_recovery(x);} while(0) #define OSAL_HW_ERROR_OCCURRED(hwfn, err_type) nothing #define OSAL_DPC_SYNC(hwfn) nothing @@ -371,7 +384,9 @@ do { \ #define OSAL_PCI_WRITE_CONFIG_DWORD(dev, reg, value) \ qlnx_pci_write_config_dword(dev, reg, value); -#define OSAL_PCI_FIND_CAPABILITY(dev, cap) qlnx_pci_find_capability(dev, cap); +#define OSAL_PCI_FIND_CAPABILITY(dev, cap) qlnx_pci_find_capability(dev, cap) +#define OSAL_PCI_FIND_EXT_CAPABILITY(dev, ext_cap) \ + qlnx_pci_find_ext_capability(dev, ext_cap) #define OSAL_MMIOWB(dev) qlnx_barrier(dev) #define OSAL_BARRIER(dev) qlnx_barrier(dev) @@ -390,8 +405,7 @@ do { \ #define OSAL_FIND_FIRST_ZERO_BIT(bitmap, length) \ find_first_zero_bit(bitmap, length) -#define OSAL_LINK_UPDATE(hwfn) qlnx_link_update(hwfn) -#define OSAL_VF_FLR_UPDATE(hwfn) +#define OSAL_LINK_UPDATE(hwfn, ptt) qlnx_link_update(hwfn) #define QLNX_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define QLNX_ROUNDUP(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) @@ -536,8 +550,36 @@ OSAL_CRC8(u8 * cdu_crc8_table, u8 * data_to_crc, int d #define OSAL_HW_INFO_CHANGE(p_hwfn, offset) #define OSAL_MFW_TLV_REQ(p_hwfn) -#define OSAL_VF_FILL_ACQUIRE_RESC_REQ(p_hwfn, req, vf_sw_info) {}; +#define OSAL_LLDP_RX_TLVS(p_hwfn, buffer, len) +#define OSAL_MFW_CMD_PREEMPT(p_hwfn) +#define OSAL_TRANSCEIVER_UPDATE(p_hwfn) +#define OSAL_MFW_FILL_TLV_DATA(p_hwfn, group, data) (0) + #define OSAL_VF_UPDATE_ACQUIRE_RESC_RESP(p_hwfn, res) (0) + +#define OSAL_VF_FILL_ACQUIRE_RESC_REQ(p_hwfn, req, vf_sw_info) \ + qlnx_osal_vf_fill_acquire_resc_req(p_hwfn, req, vf_sw_info) + +#define OSAL_IOV_PF_RESP_TYPE(p_hwfn, relative_vf_id, status) +#define OSAL_IOV_VF_CLEANUP(p_hwfn, relative_vf_id) \ + qlnx_osal_iov_vf_cleanup(p_hwfn, relative_vf_id) + +#define OSAL_IOV_VF_ACQUIRE(p_hwfn, relative_vf_id) ECORE_SUCCESS +#define OSAL_IOV_GET_OS_TYPE() VFPF_ACQUIRE_OS_FREEBSD +#define OSAL_IOV_PRE_START_VPORT(p_hwfn, relative_vf_id, params) ECORE_SUCCESS +#define OSAL_IOV_POST_START_VPORT(p_hwfn, relative_vf_id, vport_id, opaque_fid) +#define OSAL_PF_VALIDATE_MODIFY_TUNN_CONFIG(p_hwfn, x, y, z) ECORE_SUCCESS +#define OSAL_IOV_CHK_UCAST(p_hwfn, vfid, params) \ + qlnx_iov_chk_ucast(p_hwfn, vfid, params); +#define OSAL_PF_VF_MALICIOUS(p_hwfn, relative_vf_id) +#define OSAL_IOV_VF_MSG_TYPE(p_hwfn, relative_vf_id, type) +#define OSAL_IOV_VF_VPORT_UPDATE(p_hwfn, vfid, params, tlvs) \ + qlnx_iov_update_vport(p_hwfn, vfid, params, tlvs) +#define OSAL_PF_VF_MSG(p_hwfn, relative_vf_id) \ + qlnx_pf_vf_msg(p_hwfn, relative_vf_id) + +#define OSAL_VF_FLR_UPDATE(p_hwfn) qlnx_vf_flr_update(p_hwfn) +#define OSAL_IOV_VF_VPORT_STOP(p_hwfn, vf) #endif /* #ifdef ECORE_PACKAGE */ Modified: stable/10/sys/dev/qlnx/qlnxe/common_hsi.h ============================================================================== --- stable/10/sys/dev/qlnx/qlnxe/common_hsi.h Thu Aug 9 01:32:09 2018 (r337518) +++ stable/10/sys/dev/qlnx/qlnxe/common_hsi.h Thu Aug 9 01:39:47 2018 (r337519) @@ -104,8 +104,8 @@ #define FW_MAJOR_VERSION 8 -#define FW_MINOR_VERSION 30 -#define FW_REVISION_VERSION 0 +#define FW_MINOR_VERSION 33 +#define FW_REVISION_VERSION 7 #define FW_ENGINEERING_VERSION 0 /***********************/ @@ -113,76 +113,69 @@ /***********************/ /* PCI functions */ -#define MAX_NUM_PORTS_BB (2) -#define MAX_NUM_PORTS_K2 (4) -#define MAX_NUM_PORTS_E5 (MAX_NUM_PORTS_K2) -#define MAX_NUM_PORTS (MAX_NUM_PORTS_E5) +#define MAX_NUM_PORTS_BB (2) +#define MAX_NUM_PORTS_K2 (4) +#define MAX_NUM_PORTS_E5 (4) +#define MAX_NUM_PORTS (MAX_NUM_PORTS_E5) -#define MAX_NUM_PFS_BB (8) -#define MAX_NUM_PFS_K2 (16) -#define MAX_NUM_PFS_E5 (MAX_NUM_PFS_K2) -#define MAX_NUM_PFS (MAX_NUM_PFS_E5) -#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */ +#define MAX_NUM_PFS_BB (8) +#define MAX_NUM_PFS_K2 (16) +#define MAX_NUM_PFS_E5 (16) +#define MAX_NUM_PFS (MAX_NUM_PFS_E5) +#define MAX_NUM_OF_PFS_IN_CHIP (16) /* On both engines */ -#define MAX_NUM_VFS_BB (120) -#define MAX_NUM_VFS_K2 (192) -#define MAX_NUM_VFS_E4 (MAX_NUM_VFS_K2) -#define MAX_NUM_VFS_E5 (240) -#define COMMON_MAX_NUM_VFS (MAX_NUM_VFS_E5) +#define MAX_NUM_VFS_BB (120) +#define MAX_NUM_VFS_K2 (192) +#define MAX_NUM_VFS_E4 (MAX_NUM_VFS_K2) +#define MAX_NUM_VFS_E5 (240) +#define COMMON_MAX_NUM_VFS (MAX_NUM_VFS_E5) -#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB) -#define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2) -#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS_E4) +#define MAX_NUM_FUNCTIONS_BB (MAX_NUM_PFS_BB + MAX_NUM_VFS_BB) +#define MAX_NUM_FUNCTIONS_K2 (MAX_NUM_PFS_K2 + MAX_NUM_VFS_K2) +#define MAX_NUM_FUNCTIONS (MAX_NUM_PFS + MAX_NUM_VFS_E4) /* in both BB and K2, the VF number starts from 16. so for arrays containing all */ /* possible PFs and VFs - we need a constant for this size */ -#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB) -#define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2) -#define MAX_FUNCTION_NUMBER_E4 (MAX_NUM_PFS + MAX_NUM_VFS_E4) -#define MAX_FUNCTION_NUMBER_E5 (MAX_NUM_PFS + MAX_NUM_VFS_E5) -#define COMMON_MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS_E5) +#define MAX_FUNCTION_NUMBER_BB (MAX_NUM_PFS + MAX_NUM_VFS_BB) +#define MAX_FUNCTION_NUMBER_K2 (MAX_NUM_PFS + MAX_NUM_VFS_K2) +#define MAX_FUNCTION_NUMBER_E4 (MAX_NUM_PFS + MAX_NUM_VFS_E4) +#define MAX_FUNCTION_NUMBER_E5 (MAX_NUM_PFS + MAX_NUM_VFS_E5) +#define COMMON_MAX_FUNCTION_NUMBER (MAX_NUM_PFS + MAX_NUM_VFS_E5) -#define MAX_NUM_VPORTS_K2 (208) -#define MAX_NUM_VPORTS_BB (160) -#define MAX_NUM_VPORTS_E4 (MAX_NUM_VPORTS_K2) -#define MAX_NUM_VPORTS_E5 (256) -#define COMMON_MAX_NUM_VPORTS (MAX_NUM_VPORTS_E5) +#define MAX_NUM_VPORTS_K2 (208) +#define MAX_NUM_VPORTS_BB (160) +#define MAX_NUM_VPORTS_E4 (MAX_NUM_VPORTS_K2) +#define MAX_NUM_VPORTS_E5 (256) +#define COMMON_MAX_NUM_VPORTS (MAX_NUM_VPORTS_E5) -#define MAX_NUM_L2_QUEUES_K2 (320) #define MAX_NUM_L2_QUEUES_BB (256) -#define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_K2) +#define MAX_NUM_L2_QUEUES_K2 (320) +#define MAX_NUM_L2_QUEUES_E5 (320) /* TODO_E5_VITALY - fix to 512 */ +#define MAX_NUM_L2_QUEUES (MAX_NUM_L2_QUEUES_E5) /* Traffic classes in network-facing blocks (PBF, BTB, NIG, BRB, PRS and QM) */ -#define NUM_PHYS_TCS_4PORT_K2 (4) -#define NUM_PHYS_TCS_4PORT_E5 (6) -#define NUM_OF_PHYS_TCS (8) -#define PURE_LB_TC NUM_OF_PHYS_TCS -#define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1) -#define NUM_TCS_4PORT_E5 (NUM_PHYS_TCS_4PORT_E5 + 1) -#define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1) +#define NUM_PHYS_TCS_4PORT_K2 4 +#define NUM_PHYS_TCS_4PORT_TX_E5 6 +#define NUM_PHYS_TCS_4PORT_RX_E5 4 +#define NUM_OF_PHYS_TCS 8 +#define PURE_LB_TC NUM_OF_PHYS_TCS +#define NUM_TCS_4PORT_K2 (NUM_PHYS_TCS_4PORT_K2 + 1) +#define NUM_TCS_4PORT_TX_E5 (NUM_PHYS_TCS_4PORT_TX_E5 + 1) +#define NUM_TCS_4PORT_RX_E5 (NUM_PHYS_TCS_4PORT_RX_E5 + 1) +#define NUM_OF_TCS (NUM_OF_PHYS_TCS + 1) -/* Num of possible traffic priority values */ -#define NUM_OF_PRIO (8) - /* CIDs */ #define NUM_OF_CONNECTION_TYPES_E4 (8) #define NUM_OF_CONNECTION_TYPES_E5 (16) -#define NUM_OF_TASK_TYPES (8) -#define NUM_OF_LCIDS (320) -#define NUM_OF_LTIDS (320) +#define NUM_OF_TASK_TYPES (8) +#define NUM_OF_LCIDS (320) +#define NUM_OF_LTIDS (320) -/* Clock values */ -#define MASTER_CLK_FREQ_E4 (375e6) -#define STORM_CLK_FREQ_E4 (1000e6) -#define CLK25M_CLK_FREQ_E4 (25e6) - -#define STORM_CLK_DUAL_CORE_FREQ_E5 (3000e6) - /* Global PXP windows (GTT) */ -#define NUM_OF_GTT 19 -#define GTT_DWORD_SIZE_BITS 10 -#define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2) -#define GTT_DWORD_SIZE (1 << GTT_DWORD_SIZE_BITS) +#define NUM_OF_GTT 19 +#define GTT_DWORD_SIZE_BITS 10 +#define GTT_BYTE_SIZE_BITS (GTT_DWORD_SIZE_BITS + 2) +#define GTT_DWORD_SIZE (1 << GTT_DWORD_SIZE_BITS) /* Tools Version */ #define TOOLS_VERSION 10 @@ -417,7 +410,7 @@ /* Number of Protocol Indices per Status Block */ #define PIS_PER_SB_E4 12 #define PIS_PER_SB_E5 8 -#define MAX_PIS_PER_SB OSAL_MAX_T(u8, PIS_PER_SB_E4, PIS_PER_SB_E5) +#define MAX_PIS_PER_SB OSAL_MAX_T(PIS_PER_SB_E4,PIS_PER_SB_E5) #define CAU_HC_STOPPED_STATE 3 /* fsm is stopped or not valid for this sb */ @@ -548,10 +541,6 @@ /* VF BAR */ #define PXP_VF_BAR0 0 -#define PXP_VF_BAR0_START_GRC 0x3E00 -#define PXP_VF_BAR0_GRC_LENGTH 0x200 -#define PXP_VF_BAR0_END_GRC (PXP_VF_BAR0_START_GRC + PXP_VF_BAR0_GRC_LENGTH - 1) - #define PXP_VF_BAR0_START_IGU 0 #define PXP_VF_BAR0_IGU_LENGTH 0x3000 #define PXP_VF_BAR0_END_IGU (PXP_VF_BAR0_START_IGU + PXP_VF_BAR0_IGU_LENGTH - 1) @@ -582,9 +571,17 @@ #define PXP_VF_BAR0_START_PSDM_ZONE_B 0x3c00 #define PXP_VF_BAR0_END_PSDM_ZONE_B (PXP_VF_BAR0_START_PSDM_ZONE_B + PXP_VF_BAR0_SDM_LENGTH_ZONE_B - 1) +#define PXP_VF_BAR0_START_GRC 0x3E00 +#define PXP_VF_BAR0_GRC_LENGTH 0x200 +#define PXP_VF_BAR0_END_GRC (PXP_VF_BAR0_START_GRC + PXP_VF_BAR0_GRC_LENGTH - 1) + #define PXP_VF_BAR0_START_SDM_ZONE_A 0x4000 #define PXP_VF_BAR0_END_SDM_ZONE_A 0x10000 +#define PXP_VF_BAR0_START_IGU2 0x10000 +#define PXP_VF_BAR0_IGU2_LENGTH 0xD000 +#define PXP_VF_BAR0_END_IGU2 (PXP_VF_BAR0_START_IGU2 + PXP_VF_BAR0_IGU2_LENGTH - 1) + #define PXP_VF_BAR0_GRC_WINDOW_LENGTH 32 #define PXP_ILT_PAGE_SIZE_NUM_BITS_MIN 12 @@ -593,15 +590,16 @@ // ILT Records #define PXP_NUM_ILT_RECORDS_BB 7600 #define PXP_NUM_ILT_RECORDS_K2 11000 -#define MAX_NUM_ILT_RECORDS OSAL_MAX_T(u16, PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) +#define MAX_NUM_ILT_RECORDS OSAL_MAX_T(PXP_NUM_ILT_RECORDS_BB,PXP_NUM_ILT_RECORDS_K2) +#define PXP_NUM_ILT_RECORDS_E5 13664 + // Host Interface -#define PXP_QUEUES_ZONE_MAX_NUM 320 +#define PXP_QUEUES_ZONE_MAX_NUM_E4 320 +#define PXP_QUEUES_ZONE_MAX_NUM_E5 512 - - /*****************/ /* PRM CONSTANTS */ /*****************/ @@ -651,18 +649,6 @@ #define PRS_GFT_CAM_LINES_NO_MATCH 31 /* - * Async data KCQ CQE - */ -struct async_data -{ - __le32 cid /* Context ID of the connection */; - __le16 itid /* Task Id of the task (for error that happened on a a task) */; - u8 error_code /* error code - relevant only if the opcode indicates its an error */; - u8 fw_debug_param /* internal fw debug parameter */; -}; - - -/* * Interrupt coalescing TimeSet */ struct coalescing_timeset @@ -692,24 +678,30 @@ struct eth_rx_prod_data }; -struct regpair +struct tcp_ulp_connect_done_params { - __le32 lo /* low word for reg-pair */; - __le32 hi /* high word for reg-pair */; + __le16 mss; + u8 snd_wnd_scale; + u8 flags; +#define TCP_ULP_CONNECT_DONE_PARAMS_TS_EN_MASK 0x1 +#define TCP_ULP_CONNECT_DONE_PARAMS_TS_EN_SHIFT 0 +#define TCP_ULP_CONNECT_DONE_PARAMS_RESERVED_MASK 0x7F +#define TCP_ULP_CONNECT_DONE_PARAMS_RESERVED_SHIFT 1 }; -/* - * Event Ring VF-PF Channel data - */ -struct vf_pf_channel_eqe_data +struct iscsi_connect_done_results { - struct regpair msg_addr /* VF-PF message address */; + __le16 icid /* Context ID of the connection */; + __le16 conn_id /* Driver connection ID */; + struct tcp_ulp_connect_done_params params /* decided tcp params after connect done */; }; + struct iscsi_eqe_data { - __le32 cid /* Context ID of the connection */; - __le16 conn_id /* Task Id of the task (for error that happened on a a task) */; + __le16 icid /* Context ID of the connection */; + __le16 conn_id /* Driver connection ID */; + __le16 reserved; u8 error_code /* error code - relevant only if the opcode indicates its an error */; u8 error_pdu_opcode_reserved; #define ISCSI_EQE_DATA_ERROR_PDU_OPCODE_MASK 0x3F /* The processed PDUs opcode on which happened the error - updated for specific error codes, by defualt=0xFF */ @@ -720,80 +712,8 @@ struct iscsi_eqe_data #define ISCSI_EQE_DATA_RESERVED0_SHIFT 7 }; -/* - * RoCE Destroy Event Data - */ -struct rdma_eqe_destroy_qp -{ - __le32 cid /* Dedicated field RoCE destroy QP event */; - u8 reserved[4]; -}; /* - * RDMA Event Data Union - */ -union rdma_eqe_data -{ - struct regpair async_handle /* Host handle for the Async Completions */; - struct rdma_eqe_destroy_qp rdma_destroy_qp_data /* RoCE Destroy Event Data */; -}; - -/* - * Event Ring malicious VF data - */ -struct malicious_vf_eqe_data -{ - u8 vf_id /* Malicious VF ID */; - u8 err_id /* Malicious VF error */; - __le16 reserved[3]; -}; - -/* - * Event Ring initial cleanup data - */ -struct initial_cleanup_eqe_data -{ - u8 vf_id /* VF ID */; - u8 reserved[7]; -}; - -/* - * Event Data Union - */ -union event_ring_data -{ - u8 bytes[8] /* Byte Array */; - struct vf_pf_channel_eqe_data vf_pf_channel /* VF-PF Channel data */; - struct iscsi_eqe_data iscsi_info /* Dedicated fields to iscsi data */; - union rdma_eqe_data rdma_data /* Dedicated field for RDMA data */; - struct malicious_vf_eqe_data malicious_vf /* Malicious VF data */; - struct initial_cleanup_eqe_data vf_init_cleanup /* VF Initial Cleanup data */; -}; - - -/* - * Event Ring Entry - */ -struct event_ring_entry -{ - u8 protocol_id /* Event Protocol ID */; - u8 opcode /* Event Opcode */; - __le16 reserved0 /* Reserved */; - __le16 echo /* Echo value from ramrod data on the host */; - u8 fw_return_code /* FW return code for SP ramrods */; - u8 flags; -#define EVENT_RING_ENTRY_ASYNC_MASK 0x1 /* 0: synchronous EQE - a completion of SP message. 1: asynchronous EQE */ -#define EVENT_RING_ENTRY_ASYNC_SHIFT 0 -#define EVENT_RING_ENTRY_RESERVED1_MASK 0x7F -#define EVENT_RING_ENTRY_RESERVED1_SHIFT 1 - union event_ring_data data; -}; - - - - - -/* * Multi function mode */ enum mf_mode @@ -824,9 +744,34 @@ enum protocol_type }; +struct regpair +{ + __le32 lo /* low word for reg-pair */; + __le32 hi /* high word for reg-pair */; +}; +/* + * RoCE Destroy Event Data + */ +struct rdma_eqe_destroy_qp +{ + __le32 cid /* Dedicated field RoCE destroy QP event */; + u8 reserved[4]; +}; /* + * RDMA Event Data Union + */ +union rdma_eqe_data +{ + struct regpair async_handle /* Host handle for the Async Completions */; + struct rdma_eqe_destroy_qp rdma_destroy_qp_data /* RoCE Destroy Event Data */; +}; + + + + +/* * Ustorm Queue Zone */ struct ustorm_eth_queue_zone @@ -843,7 +788,6 @@ struct ustorm_queue_zone }; - /* * status block structure */ @@ -894,6 +838,17 @@ struct cau_sb_entry /* + * Igu cleanup bit values to distinguish between clean or producer consumer update. + */ +enum command_type_bit +{ + IGU_COMMAND_TYPE_NOP=0, + IGU_COMMAND_TYPE_SET=1, + MAX_COMMAND_TYPE_BIT +}; + + +/* * core doorbell data */ struct core_db_data @@ -1339,90 +1294,74 @@ struct pxp_vf_zone_a_permission */ struct rdif_task_context { - __le32 initialRefTag; - __le16 appTagValue; - __le16 appTagMask; + __le32 initial_ref_tag; + __le16 app_tag_value; + __le16 app_tag_mask; u8 flags0; -#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0 -#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1 -#define RDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1 -#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ -#define RDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2 -#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1 -#define RDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3 -#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3 /* 1/2/3 - Protection Type */ -#define RDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4 -#define RDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ -#define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 -#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1 /* Keep reference tag constant */ -#define RDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 7 - u8 partialDifData[7]; - __le16 partialCrcValue; - __le16 partialChecksumValue; - __le32 offsetInIO; +#define RDIF_TASK_CONTEXT_IGNORE_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_IGNORE_APP_TAG_SHIFT 0 +#define RDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_MASK 0x1 +#define RDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_SHIFT 1 +#define RDIF_TASK_CONTEXT_HOST_GUARD_TYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ +#define RDIF_TASK_CONTEXT_HOST_GUARD_TYPE_SHIFT 2 +#define RDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_MASK 0x1 +#define RDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_SHIFT 3 +#define RDIF_TASK_CONTEXT_PROTECTION_TYPE_MASK 0x3 /* 1/2/3 - Protection Type */ +#define RDIF_TASK_CONTEXT_PROTECTION_TYPE_SHIFT 4 +#define RDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ +#define RDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 +#define RDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_MASK 0x1 /* Keep reference tag constant */ +#define RDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_SHIFT 7 + u8 partial_dif_data[7]; + __le16 partial_crc_value; + __le16 partial_checksum_value; + __le32 offset_in_io; __le16 flags1; -#define RDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0 -#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1 -#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2 -#define RDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4 -#define RDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1 -#define RDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5 -#define RDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ -#define RDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6 -#define RDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ -#define RDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9 -#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ -#define RDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11 -#define RDIF_TASK_CONTEXT_RESERVED0_MASK 0x1 -#define RDIF_TASK_CONTEXT_RESERVED0_SHIFT 12 -#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1 /* 0=None, 1=DIF */ -#define RDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13 -#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1 /* Forward application tag with mask */ -#define RDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 14 -#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1 /* Forward reference tag with mask */ -#define RDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 15 +#define RDIF_TASK_CONTEXT_VALIDATE_GUARD_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_GUARD_SHIFT 0 +#define RDIF_TASK_CONTEXT_VALIDATE_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_APP_TAG_SHIFT 1 +#define RDIF_TASK_CONTEXT_VALIDATE_REF_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_VALIDATE_REF_TAG_SHIFT 2 +#define RDIF_TASK_CONTEXT_FORWARD_GUARD_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_GUARD_SHIFT 3 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_SHIFT 4 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_MASK 0x1 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_SHIFT 5 +#define RDIF_TASK_CONTEXT_INTERVAL_SIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ +#define RDIF_TASK_CONTEXT_INTERVAL_SIZE_SHIFT 6 +#define RDIF_TASK_CONTEXT_HOST_INTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ +#define RDIF_TASK_CONTEXT_HOST_INTERFACE_SHIFT 9 +#define RDIF_TASK_CONTEXT_DIF_BEFORE_DATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ +#define RDIF_TASK_CONTEXT_DIF_BEFORE_DATA_SHIFT 11 +#define RDIF_TASK_CONTEXT_RESERVED0_MASK 0x1 +#define RDIF_TASK_CONTEXT_RESERVED0_SHIFT 12 +#define RDIF_TASK_CONTEXT_NETWORK_INTERFACE_MASK 0x1 /* 0=None, 1=DIF */ +#define RDIF_TASK_CONTEXT_NETWORK_INTERFACE_SHIFT 13 +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 /* Forward application tag with mask */ +#define RDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_SHIFT 14 +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 /* Forward reference tag with mask */ +#define RDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_SHIFT 15 __le16 state; -#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_MASK 0xF -#define RDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFT_SHIFT 0 -#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_MASK 0xF -#define RDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFT_SHIFT 4 -#define RDIF_TASK_CONTEXT_ERRORINIO_MASK 0x1 -#define RDIF_TASK_CONTEXT_ERRORINIO_SHIFT 8 -#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1 -#define RDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9 -#define RDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF /* mask for refernce tag handling */ -#define RDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 10 -#define RDIF_TASK_CONTEXT_RESERVED1_MASK 0x3 -#define RDIF_TASK_CONTEXT_RESERVED1_SHIFT 14 +#define RDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_MASK 0xF +#define RDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_SHIFT 0 +#define RDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_MASK 0xF +#define RDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_SHIFT 4 +#define RDIF_TASK_CONTEXT_ERROR_IN_IO_MASK 0x1 +#define RDIF_TASK_CONTEXT_ERROR_IN_IO_SHIFT 8 +#define RDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_MASK 0x1 +#define RDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_SHIFT 9 +#define RDIF_TASK_CONTEXT_REF_TAG_MASK_MASK 0xF /* mask for refernce tag handling */ +#define RDIF_TASK_CONTEXT_REF_TAG_MASK_SHIFT 10 +#define RDIF_TASK_CONTEXT_RESERVED1_MASK 0x3 +#define RDIF_TASK_CONTEXT_RESERVED1_SHIFT 14 __le32 reserved2; }; /* - * RSS hash type - */ -enum rss_hash_type -{ - RSS_HASH_TYPE_DEFAULT=0, - RSS_HASH_TYPE_IPV4=1, - RSS_HASH_TYPE_TCP_IPV4=2, - RSS_HASH_TYPE_IPV6=3, - RSS_HASH_TYPE_TCP_IPV6=4, - RSS_HASH_TYPE_UDP_IPV4=5, - RSS_HASH_TYPE_UDP_IPV6=6, - MAX_RSS_HASH_TYPE -}; - - -/* * status block structure */ struct status_block_e4 @@ -1469,85 +1408,85 @@ struct status_block_e5 */ struct tdif_task_context { - __le32 initialRefTag; - __le16 appTagValue; - __le16 appTagMask; - __le16 partialCrcValueB; - __le16 partialChecksumValueB; + __le32 initial_ref_tag; + __le16 app_tag_value; + __le16 app_tag_mask; + __le16 partial_crc_value_b; + __le16 partial_checksum_value_b; __le16 stateB; -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_MASK 0xF -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTB_SHIFT 0 -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_MASK 0xF -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTB_SHIFT 4 -#define TDIF_TASK_CONTEXT_ERRORINIOB_MASK 0x1 -#define TDIF_TASK_CONTEXT_ERRORINIOB_SHIFT 8 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_MASK 0x1 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOW_SHIFT 9 -#define TDIF_TASK_CONTEXT_RESERVED0_MASK 0x3F -#define TDIF_TASK_CONTEXT_RESERVED0_SHIFT 10 +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_B_MASK 0xF +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_B_SHIFT 0 +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_B_MASK 0xF +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_B_SHIFT 4 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_B_MASK 0x1 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_B_SHIFT 8 +#define TDIF_TASK_CONTEXT_CHECKSUM_VERFLOW_MASK 0x1 +#define TDIF_TASK_CONTEXT_CHECKSUM_VERFLOW_SHIFT 9 +#define TDIF_TASK_CONTEXT_RESERVED0_MASK 0x3F +#define TDIF_TASK_CONTEXT_RESERVED0_SHIFT 10 u8 reserved1; u8 flags0; -#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_IGNOREAPPTAG_SHIFT 0 -#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_MASK 0x1 -#define TDIF_TASK_CONTEXT_INITIALREFTAGVALID_SHIFT 1 -#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ -#define TDIF_TASK_CONTEXT_HOSTGUARDTYPE_SHIFT 2 -#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_MASK 0x1 -#define TDIF_TASK_CONTEXT_SETERRORWITHEOP_SHIFT 3 -#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_MASK 0x3 /* 1/2/3 - Protection Type */ -#define TDIF_TASK_CONTEXT_PROTECTIONTYPE_SHIFT 4 -#define TDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ -#define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 -#define TDIF_TASK_CONTEXT_RESERVED2_MASK 0x1 -#define TDIF_TASK_CONTEXT_RESERVED2_SHIFT 7 +#define TDIF_TASK_CONTEXT_IGNORE_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_IGNORE_APP_TAG_SHIFT 0 +#define TDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_MASK 0x1 +#define TDIF_TASK_CONTEXT_INITIAL_REF_TAG_VALID_SHIFT 1 +#define TDIF_TASK_CONTEXT_HOST_GUARD_TYPE_MASK 0x1 /* 0 = IP checksum, 1 = CRC */ +#define TDIF_TASK_CONTEXT_HOST_GUARD_TYPE_SHIFT 2 +#define TDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_MASK 0x1 +#define TDIF_TASK_CONTEXT_SET_ERROR_WITH_EOP_SHIFT 3 +#define TDIF_TASK_CONTEXT_PROTECTION_TYPE_MASK 0x3 /* 1/2/3 - Protection Type */ +#define TDIF_TASK_CONTEXT_PROTECTION_TYPE_SHIFT 4 +#define TDIF_TASK_CONTEXT_CRC_SEED_MASK 0x1 /* 0=0x0000, 1=0xffff */ +#define TDIF_TASK_CONTEXT_CRC_SEED_SHIFT 6 +#define TDIF_TASK_CONTEXT_RESERVED2_MASK 0x1 +#define TDIF_TASK_CONTEXT_RESERVED2_SHIFT 7 __le32 flags1; -#define TDIF_TASK_CONTEXT_VALIDATEGUARD_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEGUARD_SHIFT 0 -#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEAPPTAG_SHIFT 1 -#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_VALIDATEREFTAG_SHIFT 2 -#define TDIF_TASK_CONTEXT_FORWARDGUARD_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDGUARD_SHIFT 3 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAG_SHIFT 4 -#define TDIF_TASK_CONTEXT_FORWARDREFTAG_MASK 0x1 -#define TDIF_TASK_CONTEXT_FORWARDREFTAG_SHIFT 5 -#define TDIF_TASK_CONTEXT_INTERVALSIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ -#define TDIF_TASK_CONTEXT_INTERVALSIZE_SHIFT 6 -#define TDIF_TASK_CONTEXT_HOSTINTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ -#define TDIF_TASK_CONTEXT_HOSTINTERFACE_SHIFT 9 -#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ -#define TDIF_TASK_CONTEXT_DIFBEFOREDATA_SHIFT 11 -#define TDIF_TASK_CONTEXT_RESERVED3_MASK 0x1 /* reserved */ -#define TDIF_TASK_CONTEXT_RESERVED3_SHIFT 12 -#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_MASK 0x1 /* 0=None, 1=DIF */ -#define TDIF_TASK_CONTEXT_NETWORKINTERFACE_SHIFT 13 -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_MASK 0xF -#define TDIF_TASK_CONTEXT_RECEIVEDDIFBYTESLEFTA_SHIFT 14 -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_MASK 0xF -#define TDIF_TASK_CONTEXT_TRANSMITEDDIFBYTESLEFTA_SHIFT 18 -#define TDIF_TASK_CONTEXT_ERRORINIOA_MASK 0x1 -#define TDIF_TASK_CONTEXT_ERRORINIOA_SHIFT 22 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_MASK 0x1 -#define TDIF_TASK_CONTEXT_CHECKSUMOVERFLOWA_SHIFT 23 -#define TDIF_TASK_CONTEXT_REFTAGMASK_MASK 0xF /* mask for refernce tag handling */ -#define TDIF_TASK_CONTEXT_REFTAGMASK_SHIFT 24 -#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_MASK 0x1 /* Forward application tag with mask */ -#define TDIF_TASK_CONTEXT_FORWARDAPPTAGWITHMASK_SHIFT 28 -#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_MASK 0x1 /* Forward reference tag with mask */ -#define TDIF_TASK_CONTEXT_FORWARDREFTAGWITHMASK_SHIFT 29 -#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_MASK 0x1 /* Keep reference tag constant */ -#define TDIF_TASK_CONTEXT_KEEPREFTAGCONST_SHIFT 30 -#define TDIF_TASK_CONTEXT_RESERVED4_MASK 0x1 -#define TDIF_TASK_CONTEXT_RESERVED4_SHIFT 31 - __le32 offsetInIOB; - __le16 partialCrcValueA; - __le16 partialChecksumValueA; - __le32 offsetInIOA; - u8 partialDifDataA[8]; - u8 partialDifDataB[8]; +#define TDIF_TASK_CONTEXT_VALIDATE_GUARD_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_GUARD_SHIFT 0 +#define TDIF_TASK_CONTEXT_VALIDATE_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_APP_TAG_SHIFT 1 +#define TDIF_TASK_CONTEXT_VALIDATE_REF_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_VALIDATE_REF_TAG_SHIFT 2 +#define TDIF_TASK_CONTEXT_FORWARD_GUARD_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_GUARD_SHIFT 3 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_SHIFT 4 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_MASK 0x1 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_SHIFT 5 +#define TDIF_TASK_CONTEXT_INTERVAL_SIZE_MASK 0x7 /* 0=512B, 1=1KB, 2=2KB, 3=4KB, 4=8KB */ +#define TDIF_TASK_CONTEXT_INTERVAL_SIZE_SHIFT 6 +#define TDIF_TASK_CONTEXT_HOST_INTERFACE_MASK 0x3 /* 0=None, 1=DIF, 2=DIX */ +#define TDIF_TASK_CONTEXT_HOST_INTERFACE_SHIFT 9 +#define TDIF_TASK_CONTEXT_DIF_BEFORE_DATA_MASK 0x1 /* DIF tag right at the beginning of DIF interval */ +#define TDIF_TASK_CONTEXT_DIF_BEFORE_DATA_SHIFT 11 +#define TDIF_TASK_CONTEXT_RESERVED3_MASK 0x1 /* reserved */ +#define TDIF_TASK_CONTEXT_RESERVED3_SHIFT 12 +#define TDIF_TASK_CONTEXT_NETWORK_INTERFACE_MASK 0x1 /* 0=None, 1=DIF */ +#define TDIF_TASK_CONTEXT_NETWORK_INTERFACE_SHIFT 13 +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_A_MASK 0xF +#define TDIF_TASK_CONTEXT_RECEIVED_DIF_BYTES_LEFT_A_SHIFT 14 +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_A_MASK 0xF +#define TDIF_TASK_CONTEXT_TRANSMITED_DIF_BYTES_LEFT_A_SHIFT 18 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_A_MASK 0x1 +#define TDIF_TASK_CONTEXT_ERROR_IN_IO_A_SHIFT 22 +#define TDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_A_MASK 0x1 +#define TDIF_TASK_CONTEXT_CHECKSUM_OVERFLOW_A_SHIFT 23 +#define TDIF_TASK_CONTEXT_REF_TAG_MASK_MASK 0xF /* mask for refernce tag handling */ +#define TDIF_TASK_CONTEXT_REF_TAG_MASK_SHIFT 24 +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_MASK 0x1 /* Forward application tag with mask */ +#define TDIF_TASK_CONTEXT_FORWARD_APP_TAG_WITH_MASK_SHIFT 28 +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_MASK 0x1 /* Forward reference tag with mask */ +#define TDIF_TASK_CONTEXT_FORWARD_REF_TAG_WITH_MASK_SHIFT 29 +#define TDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_MASK 0x1 /* Keep reference tag constant */ +#define TDIF_TASK_CONTEXT_KEEP_REF_TAG_CONST_SHIFT 30 +#define TDIF_TASK_CONTEXT_RESERVED4_MASK 0x1 +#define TDIF_TASK_CONTEXT_RESERVED4_SHIFT 31 + __le32 offset_in_io_b; + __le16 partial_crc_value_a; + __le16 partial_checksum_value_a; + __le32 offset_in_io_a; + u8 partial_dif_data_a[8]; + u8 partial_dif_data_b[8]; }; @@ -1602,7 +1541,7 @@ struct timers_context /* - * Enum for next_protocol field of tunnel_parsing_flags + * Enum for next_protocol field of tunnel_parsing_flags / tunnelTypeDesc */ enum tunnel_next_protocol { Modified: stable/10/sys/dev/qlnx/qlnxe/ecore.h ============================================================================== --- stable/10/sys/dev/qlnx/qlnxe/ecore.h Thu Aug 9 01:32:09 2018 (r337518) +++ stable/10/sys/dev/qlnx/qlnxe/ecore.h Thu Aug 9 01:39:47 2018 (r337519) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 Cavium, Inc. + * Copyright (c) 2017-2018 Cavium, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ #ifndef __ECORE_H #define __ECORE_H +#include "ecore_status.h" #include "ecore_hsi_common.h" #include "ecore_hsi_debug_tools.h" #include "ecore_hsi_init_func.h" @@ -39,8 +40,8 @@ #include "mcp_public.h" #define ECORE_MAJOR_VERSION 8 -#define ECORE_MINOR_VERSION 30 -#define ECORE_REVISION_VERSION 0 +#define ECORE_MINOR_VERSION 33 +#define ECORE_REVISION_VERSION 5 #define ECORE_ENGINEERING_VERSION 0 #define ECORE_VERSION \ @@ -58,6 +59,7 @@ /* Constants */ #define ECORE_WID_SIZE (1024) +#define ECORE_MIN_WIDS (4) /* Configurable */ #define ECORE_PF_DEMS_SIZE (4) @@ -80,11 +82,14 @@ enum ecore_nvm_cmd { ECORE_PHY_RAW_WRITE = DRV_MSG_CODE_PHY_RAW_WRITE, ECORE_PHY_CORE_READ = DRV_MSG_CODE_PHY_CORE_READ, ECORE_PHY_CORE_WRITE = DRV_MSG_CODE_PHY_CORE_WRITE, + ECORE_ENCRYPT_PASSWORD = DRV_MSG_CODE_ENCRYPT_PASSWORD, ECORE_GET_MCP_NVM_RESP = 0xFFFFFF00 }; +#ifndef LINUX_REMOVE #if !defined(CONFIG_ECORE_L2) && !defined(CONFIG_ECORE_ROCE) && \ - !defined(CONFIG_ECORE_FCOE) && !defined(CONFIG_ECORE_ISCSI) + !defined(CONFIG_ECORE_FCOE) && !defined(CONFIG_ECORE_ISCSI) && \ + !defined(CONFIG_ECORE_IWARP) #define CONFIG_ECORE_L2 #define CONFIG_ECORE_SRIOV #define CONFIG_ECORE_ROCE @@ -93,8 +98,10 @@ enum ecore_nvm_cmd { #define CONFIG_ECORE_ISCSI #define CONFIG_ECORE_LL2 #endif +#endif /* helpers */ +#ifndef __EXTRACT__LINUX__IF__ #define MASK_FIELD(_name, _value) \ ((_value) &= (_name##_MASK)) @@ -115,9 +122,10 @@ do { \ #define SET_MFW_FIELD(name, field, value) \ do { \ - (name) &= ~((field ## _MASK) << (field ## _OFFSET)); \ + (name) &= ~(field ## _MASK); \ (name) |= (((value) << (field ## _OFFSET)) & (field ## _MASK)); \ } while (0) +#endif static OSAL_INLINE u32 DB_ADDR(u32 cid, u32 DEMS) { @@ -139,6 +147,7 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS) ((sizeof(type_name) + (u32)(1<<(p_hwfn->p_dev->cache_shift))-1) & \ ~((1<<(p_hwfn->p_dev->cache_shift))-1)) +#ifndef LINUX_REMOVE #ifndef U64_HI #define U64_HI(val) ((u32)(((u64)(val)) >> 32)) #endif @@ -146,7 +155,9 @@ static OSAL_INLINE u32 DB_ADDR_VF(u32 cid, u32 DEMS) #ifndef U64_LO #define U64_LO(val) ((u32)(((u64)(val)) & 0xffffffff)) #endif +#endif +#ifndef __EXTRACT__LINUX__IF__ #ifndef UEFI /* Debug print definitions */ #define DP_ERR(p_dev, fmt, ...) \ @@ -203,6 +214,7 @@ enum DP_LEVEL { #define ECORE_LOG_NOTICE_MASK (0x80000000) enum DP_MODULE { +#ifndef LINUX_REMOVE ECORE_MSG_DRV = 0x0001, ECORE_MSG_PROBE = 0x0002, ECORE_MSG_LINK = 0x0004, @@ -218,6 +230,7 @@ enum DP_MODULE { ECORE_MSG_PKTDATA = 0x1000, ECORE_MSG_HW = 0x2000, ECORE_MSG_WOL = 0x4000, +#endif ECORE_MSG_SPQ = 0x10000, ECORE_MSG_STATS = 0x20000, ECORE_MSG_DCB = 0x40000, @@ -232,6 +245,7 @@ enum DP_MODULE { ECORE_MSG_DEBUG = 0x8000000, /* to be added...up to 0x8000000 */ }; +#endif #define for_each_hwfn(p_dev, i) for (i = 0; i < p_dev->num_hwfns; i++) @@ -252,6 +266,7 @@ struct ecore_l2_info; struct ecore_igu_info; struct ecore_mcp_info; struct ecore_dcbx_info; +struct ecore_llh_info; struct ecore_rt_data { u32 *init_val; @@ -321,6 +336,15 @@ struct ecore_qm_iids { u32 tids; }; +/* The PCI relax ordering is either taken care by management FW or can be + * enable/disable by ecore client. + */ +enum ecore_pci_rlx_odr { + ECORE_DEFAULT_RLX_ODR, + ECORE_ENABLE_RLX_ODR, + ECORE_DISABLE_RLX_ODR +}; + #define MAX_PF_PER_PORT 8 /* HW / FW resources, output of features supported below, most information @@ -387,6 +411,7 @@ enum ecore_dev_cap { ECORE_DEV_CAP_IWARP }; +#ifndef __EXTRACT__LINUX__IF__ enum ecore_hw_err_type { ECORE_HW_ERR_FAN_FAIL, ECORE_HW_ERR_MFW_RESP_FAIL, @@ -395,6 +420,7 @@ enum ecore_hw_err_type { ECORE_HW_ERR_RAMROD_FAIL, ECORE_HW_ERR_FW_ASSERT, }; +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 9 02:06:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14AEF107511F; Thu, 9 Aug 2018 02:06:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE4BC793D6; Thu, 9 Aug 2018 02:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EEAE13039; Thu, 9 Aug 2018 02:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7926QCV072791; Thu, 9 Aug 2018 02:06:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7926QCr072789; Thu, 9 Aug 2018 02:06:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090206.w7926QCr072789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 02:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337520 - in head/stand/i386: gptboot isoboot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand/i386: gptboot isoboot X-SVN-Commit-Revision: 337520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 02:06:27 -0000 Author: kevans Date: Thu Aug 9 02:06:25 2018 New Revision: 337520 URL: https://svnweb.freebsd.org/changeset/base/337520 Log: isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're not going to pass an additional argument to __exec. PR: 228151 Submitted by: guyyur@gmail.com MFC after: 1 week Modified: head/stand/i386/gptboot/gptboot.c head/stand/i386/isoboot/isoboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Thu Aug 9 01:39:47 2018 (r337519) +++ head/stand/i386/gptboot/gptboot.c Thu Aug 9 02:06:25 2018 (r337520) @@ -490,9 +490,10 @@ load(void) #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) #ifdef LOADER_GELI_SUPPORT - , geliargs + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs +#else + 0, 0, 0, VTOP(&bootinfo) #endif ); } Modified: head/stand/i386/isoboot/isoboot.c ============================================================================== --- head/stand/i386/isoboot/isoboot.c Thu Aug 9 01:39:47 2018 (r337519) +++ head/stand/i386/isoboot/isoboot.c Thu Aug 9 02:06:25 2018 (r337520) @@ -417,7 +417,7 @@ load(void) bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); + 0, 0, 0, VTOP(&bootinfo)); } static int From owner-svn-src-all@freebsd.org Thu Aug 9 02:07:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 287281075194; Thu, 9 Aug 2018 02:07:55 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCF417953D; Thu, 9 Aug 2018 02:07:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 6A37921848; Thu, 9 Aug 2018 02:07:54 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f52.google.com with SMTP id l16-v6so2948560lfc.13; Wed, 08 Aug 2018 19:07:54 -0700 (PDT) X-Gm-Message-State: AOUpUlGdv+cI9/Y1gftRo/VeHhwZor/k0TUOTc4xcdd3yomVr3voNHoP 5THlfm0UfBEJTNLdw3m2UW5BtmkeSarxs0gKSV8= X-Google-Smtp-Source: AA+uWPwLCOi3EkGvA9geJA06RrKBX37+Wtv00mqHp6RPh+dHiIY4PJ8y1U0bXiXjOr4WPRiNT2/Wxf7kQ0dIywJ49aU= X-Received: by 2002:a19:e955:: with SMTP id g82-v6mr107921lfh.44.1533780472954; Wed, 08 Aug 2018 19:07:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 19:07:32 -0700 (PDT) In-Reply-To: <201808090206.w7926QCr072789@repo.freebsd.org> References: <201808090206.w7926QCr072789@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 21:07:32 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337520 - in head/stand/i386: gptboot isoboot To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 02:07:55 -0000 On Wed, Aug 8, 2018 at 9:06 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Aug 9 02:06:25 2018 > New Revision: 337520 > URL: https://svnweb.freebsd.org/changeset/base/337520 > > Log: > isoboot, gptboot: Fix WITHOUT_LOADER_GELI (gptboot) and isoboot in general > > gptboot was broken when r316078 added the LOADER_GELI_SUPPORT #ifdef to > not pass geliargs via __exec. KARGS_FLAGS_EXTARG must not be used if we're > not going to pass an additional argument to __exec. > > PR: 228151 > Submitted by: guyyur@gmail.com > MFC after: 1 week > > Modified: > head/stand/i386/gptboot/gptboot.c > head/stand/i386/isoboot/isoboot.c > > Modified: head/stand/i386/gptboot/gptboot.c > ============================================================================== > --- head/stand/i386/gptboot/gptboot.c Thu Aug 9 01:39:47 2018 (r337519) > +++ head/stand/i386/gptboot/gptboot.c Thu Aug 9 02:06:25 2018 (r337520) > @@ -490,9 +490,10 @@ load(void) > #endif > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[gdsk.dsk.type], gdsk.dsk.part + 1, gdsk.dsk.unit, 0xff), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) > #ifdef LOADER_GELI_SUPPORT > - , geliargs > + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs > +#else > + 0, 0, 0, VTOP(&bootinfo) > #endif > ); > } > > Modified: head/stand/i386/isoboot/isoboot.c > ============================================================================== > --- head/stand/i386/isoboot/isoboot.c Thu Aug 9 01:39:47 2018 (r337519) > +++ head/stand/i386/isoboot/isoboot.c Thu Aug 9 02:06:25 2018 (r337520) > @@ -417,7 +417,7 @@ load(void) > bootinfo.bi_bios_dev = dsk.drive; > __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), > MAKEBOOTDEV(dev_maj[dsk.type], 0, dsk.unit, 0), > - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo)); > + 0, 0, 0, VTOP(&bootinfo)); > } > > static int > Rod, Can you test the version of isoboot that was in stable/11 with this patch applied? It seems highly likely that this was the source of your boot issues. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Aug 9 02:27:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481E11075BFD; Thu, 9 Aug 2018 02:27:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5DE47A19A; Thu, 9 Aug 2018 02:27:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C347313397; Thu, 9 Aug 2018 02:27:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w792RINr083014; Thu, 9 Aug 2018 02:27:18 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w792RI5o083013; Thu, 9 Aug 2018 02:27:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808090227.w792RI5o083013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 9 Aug 2018 02:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337521 - stable/11/usr.bin/gzip X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/usr.bin/gzip X-SVN-Commit-Revision: 337521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 02:27:19 -0000 Author: delphij Date: Thu Aug 9 02:27:18 2018 New Revision: 337521 URL: https://svnweb.freebsd.org/changeset/base/337521 Log: MFC r336121+r336127(cem): Don't delete outfile unconditionally. Modified: stable/11/usr.bin/gzip/gzip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/gzip/gzip.c ============================================================================== --- stable/11/usr.bin/gzip/gzip.c Thu Aug 9 02:06:25 2018 (r337520) +++ stable/11/usr.bin/gzip/gzip.c Thu Aug 9 02:27:18 2018 (r337521) @@ -1424,6 +1424,7 @@ file_uncompress(char *file, char *outfile, size_t outs unsigned char header1[4]; enum filetype method; int fd, ofd, zfd = -1; + int error; size_t in_size; #ifndef SMALL ssize_t rv; @@ -1597,14 +1598,21 @@ file_uncompress(char *file, char *outfile, size_t outs size = zuncompress(in, out, NULL, 0, NULL); /* need to fclose() if ferror() is true... */ - if (ferror(in) | fclose(in)) { - maybe_warn("failed infile fclose"); - unlink(outfile); + error = ferror(in); + if (error | fclose(in)) { + if (error) + maybe_warn("failed infile"); + else + maybe_warn("failed infile fclose"); + if (cflag == 0) + unlink(outfile); (void)fclose(out); + goto lose; } if (fclose(out) != 0) { maybe_warn("failed outfile fclose"); - unlink(outfile); + if (cflag == 0) + unlink(outfile); goto lose; } break; From owner-svn-src-all@freebsd.org Thu Aug 9 02:47:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979C6107697F; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42B977AF4D; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21F4C136DA; Thu, 9 Aug 2018 02:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w792lNoU093602; Thu, 9 Aug 2018 02:47:23 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w792lMrj093601; Thu, 9 Aug 2018 02:47:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201808090247.w792lMrj093601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 9 Aug 2018 02:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337522 - head/usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/tzsetup X-SVN-Commit-Revision: 337522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 02:47:23 -0000 Author: delphij Date: Thu Aug 9 02:47:22 2018 New Revision: 337522 URL: https://svnweb.freebsd.org/changeset/base/337522 Log: In read_zones(), check if the file name actually fit in the buffer and make sure it would terminate with nul with strlcpy(). Reviewed by: imp (earlier revision) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16595 Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu Aug 9 02:27:18 2018 (r337521) +++ head/usr.sbin/tzsetup/tzsetup.c Thu Aug 9 02:47:22 2018 (r337522) @@ -481,7 +481,7 @@ read_zones(void) char contbuf[16]; FILE *fp; struct continent *cont; - size_t len; + size_t len, contlen; char *line, *tlc, *file, *descr, *p; int lineno; @@ -504,12 +504,16 @@ read_zones(void) path_zonetab, lineno, tlc); /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); + /* get continent portion from continent/country */ p = strchr(file, '/'); if (p == NULL) errx(1, "%s:%d: invalid zone name `%s'", path_zonetab, lineno, file); - contbuf[0] = '\0'; - strncat(contbuf, file, p - file); + contlen = p - file + 1; /* trailing nul */ + if (contlen > sizeof(contbuf)) + errx(1, "%s:%d: continent name in zone name `%s' too long", + path_zonetab, lineno, file); + strlcpy(contbuf, file, contlen); cont = find_continent(contbuf); if (!cont) errx(1, "%s:%d: invalid region `%s'", path_zonetab, From owner-svn-src-all@freebsd.org Thu Aug 9 02:55:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE3061076E44; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99A617B5A0; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7ACFB13885; Thu, 9 Aug 2018 02:55:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w792tmFO098817; Thu, 9 Aug 2018 02:55:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w792tm4j098816; Thu, 9 Aug 2018 02:55:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090255.w792tm4j098816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 02:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337523 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 337523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 02:55:49 -0000 Author: kevans Date: Thu Aug 9 02:55:48 2018 New Revision: 337523 URL: https://svnweb.freebsd.org/changeset/base/337523 Log: libsa: exit on EOF in ngets It was possible in some rare circumstances for ngets to behave terribly with bhyveload and some form of redirecting user input over a pipe. PR: 198706 Submitted by: Ivan Krivonos MFC after: 1 week Modified: head/stand/libsa/gets.c Modified: head/stand/libsa/gets.c ============================================================================== --- head/stand/libsa/gets.c Thu Aug 9 02:47:22 2018 (r337522) +++ head/stand/libsa/gets.c Thu Aug 9 02:55:48 2018 (r337523) @@ -44,8 +44,11 @@ ngets(char *buf, int n) int c; char *lp; - for (lp = buf;;) - switch (c = getchar() & 0177) { + for (lp = buf;;) { + c = getchar(); + if (c == -1) + break; + switch (c & 0177) { case '\n': case '\r': *lp = '\0'; @@ -79,6 +82,7 @@ ngets(char *buf, int n) putchar(c); } } + } /*NOTREACHED*/ } From owner-svn-src-all@freebsd.org Thu Aug 9 03:45:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A04910522B8; Thu, 9 Aug 2018 03:45:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C48867D55E; Thu, 9 Aug 2018 03:45:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A68D414169; Thu, 9 Aug 2018 03:45:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w793jlgh025506; Thu, 9 Aug 2018 03:45:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w793jl8x025505; Thu, 9 Aug 2018 03:45:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808090345.w793jl8x025505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 03:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337524 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 337524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 03:45:48 -0000 Author: kevans Date: Thu Aug 9 03:45:47 2018 New Revision: 337524 URL: https://svnweb.freebsd.org/changeset/base/337524 Log: libi386: Fix typo in pxe.h PR: 207337 Submitted by: Tony Narlock MFC after: 1 week Modified: head/stand/i386/libi386/pxe.h Modified: head/stand/i386/libi386/pxe.h ============================================================================== --- head/stand/i386/libi386/pxe.h Thu Aug 9 02:55:48 2018 (r337523) +++ head/stand/i386/libi386/pxe.h Thu Aug 9 03:45:47 2018 (r337524) @@ -147,7 +147,7 @@ typedef struct { PXENV_STATUS_t Status; ADDR32_t ProtocolIni; /* Phys addr of a copy of the driver module */ uint8_t reserved[8]; -} PACKED t_PXENV_UNDI_INITALIZE; +} PACKED t_PXENV_UNDI_INITIALIZE; #define MAXNUM_MCADDR 8 From owner-svn-src-all@freebsd.org Thu Aug 9 04:16:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED201053738; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 829C47E690; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 217402256B; Thu, 9 Aug 2018 04:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f174.google.com with SMTP id p6-v6so3390608ljc.5; Wed, 08 Aug 2018 21:16:42 -0700 (PDT) X-Gm-Message-State: AOUpUlFHiUQEPevp8wnog/kq0w847d+Jxa6OE7hUXJZHbRFWy1Vea8As lZgcOEmismaGe1VrEyblTV3NNDS+qmAtMjSHsYo= X-Google-Smtp-Source: AA+uWPzZKDTFPwjFgkZcEa4nOzkYf3b/DlPEyVdqA0HzO2V+klmxkqaTwu5lvBMf+qWtb3lZI9VXZnU7mtnLeY9hchA= X-Received: by 2002:a2e:4055:: with SMTP id n82-v6mr231378lja.99.1533788200702; Wed, 08 Aug 2018 21:16:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Wed, 8 Aug 2018 21:16:20 -0700 (PDT) In-Reply-To: References: <201808082137.w78Lb2B5031967@repo.freebsd.org> From: Kyle Evans Date: Wed, 8 Aug 2018 23:16:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337505 - head/bin/dd To: Warner Losh Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 04:16:43 -0000 On Wed, Aug 8, 2018 at 8:15 PM, Warner Losh wrote: > > > On Wed, Aug 8, 2018 at 7:01 PM, Kyle Evans wrote: >> >> On Wed, Aug 8, 2018 at 7:58 PM, Eitan Adler wrote: >> > On Wed, 8 Aug 2018 at 14:37, Kyle Evans wrote: >> >> +/* ARGSUSED */ >> > >> > We've been slowly delintifying system utilities. Why do we still keep >> > these comments? >> > >> >> This is consistent with the style of the file, so I didn't object. >> I'd rather do another pass later to de-lintify the whole thing rather >> than nitpick at this patch for some otherwise harmless and matching >> comments. =) > > > It appears to be from NetBSD upstream, so removing it would be pointless > churn that makes things harder to merge. > Poking at NetBSD now that I have time, it doesn't look like they actually have this feature. They have progress= to output a dog every n blocks, but apparently not one that actually does a single-line summary every second like this and GNU dd (with the same status=progress flag). From owner-svn-src-all@freebsd.org Thu Aug 9 05:18:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDA451055339; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E06780764; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747F415017; Thu, 9 Aug 2018 05:18:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w795IS5l071452; Thu, 9 Aug 2018 05:18:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w795ISxD071451; Thu, 9 Aug 2018 05:18:28 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808090518.w795ISxD071451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 9 Aug 2018 05:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337525 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 05:18:29 -0000 Author: mmacy Date: Thu Aug 9 05:18:27 2018 New Revision: 337525 URL: https://svnweb.freebsd.org/changeset/base/337525 Log: epoch_block_wait: don't check TD_RUNNING struct epoch_thread is not type safe (stack allocated) and thus cannot be dereferenced from another CPU Reported by: novel@ Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu Aug 9 03:45:47 2018 (r337524) +++ head/sys/kern/subr_epoch.c Thu Aug 9 05:18:27 2018 (r337525) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); /* arbitrary --- needs benchmarking */ -#define MAX_ADAPTIVE_SPIN 1000 +#define MAX_ADAPTIVE_SPIN 100 #define MAX_EPOCHS 64 CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epoch_context)); @@ -240,24 +240,38 @@ epoch_block_handler_preempt(struct ck_epoch *global __ locksheld = td->td_locks; spincount = 0; counter_u64_add(block_count, 1); + /* + * We lost a race and there's no longer any threads + * on the CPU in an epoch section. + */ + if (TAILQ_EMPTY(&record->er_tdlist)) + return; + if (record->er_cpuid != curcpu) { /* * If the head of the list is running, we can wait for it * to remove itself from the list and thus save us the * overhead of a migration */ - if ((tdwait = TAILQ_FIRST(&record->er_tdlist)) != NULL && - TD_IS_RUNNING(tdwait->et_td)) { - gen = record->er_gen; - thread_unlock(td); - do { - cpu_spinwait(); - } while (tdwait == TAILQ_FIRST(&record->er_tdlist) && - gen == record->er_gen && TD_IS_RUNNING(tdwait->et_td) && - spincount++ < MAX_ADAPTIVE_SPIN); - thread_lock(td); + gen = record->er_gen; + thread_unlock(td); + /* + * We can't actually check if the waiting thread is running + * so we simply poll for it to exit before giving up and + * migrating. + */ + do { + cpu_spinwait(); + } while (!TAILQ_EMPTY(&record->er_tdlist) && + gen == record->er_gen && + spincount++ < MAX_ADAPTIVE_SPIN); + thread_lock(td); + /* + * If the generation has changed we can poll again + * otherwise we need to migrate. + */ + if (gen != record->er_gen) return; - } /* * Being on the same CPU as that of the record on which * we need to wait allows us access to the thread From owner-svn-src-all@freebsd.org Thu Aug 9 09:06:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36430105D792; Thu, 9 Aug 2018 09:06:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E051288B5A; Thu, 9 Aug 2018 09:06:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2DD9174F9; Thu, 9 Aug 2018 09:06:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7996Vsv098247; Thu, 9 Aug 2018 09:06:31 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7996Vxt098244; Thu, 9 Aug 2018 09:06:31 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808090906.w7996Vxt098244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 9 Aug 2018 09:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337526 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 337526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 09:06:32 -0000 Author: kevlo Date: Thu Aug 9 09:06:30 2018 New Revision: 337526 URL: https://svnweb.freebsd.org/changeset/base/337526 Log: Follow up to r333195, add us Macbook/Macbook Pro keyboard support. Tested by: rcyu Added: head/share/vt/keymaps/us.macbook.kbd (contents, props changed) Modified: head/share/vt/keymaps/INDEX.keymaps head/share/vt/keymaps/Makefile Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Thu Aug 9 05:18:27 2018 (r337525) +++ head/share/vt/keymaps/INDEX.keymaps Thu Aug 9 09:06:30 2018 (r337526) @@ -576,6 +576,12 @@ us.unix.kbd:fr:États Unis d'AmĂ©rique unix us.unix.kbd:pt:Estados Unidos da AmĂ©rica unix us.unix.kbd:es:Estadounidense Unix tradicional +us.macbook.kbd:en:United States of America Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:de:US-amerikanisch Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:fr:États Unis d'AmĂ©rique Macbook / Macbook Pro ISO-8859-1 +us.macbook.kbd:pt:Estados Unidos da AmĂ©rica Macbook/Macbook Pro ISO-8859-1 +us.macbook.kbd:es:Estadounidense Macbook/Macbook Pro ISO-8859-1 + ua.kbd.from-iso5:en:Ukrainian ua.kbd.from-iso5:de:Ukrainisch ua.kbd.from-iso5:fr:Ukrainien Modified: head/share/vt/keymaps/Makefile ============================================================================== --- head/share/vt/keymaps/Makefile Thu Aug 9 05:18:27 2018 (r337525) +++ head/share/vt/keymaps/Makefile Thu Aug 9 09:06:30 2018 (r337526) @@ -83,6 +83,7 @@ FILES= INDEX.keymaps \ us.dvorakx.kbd \ us.emacs.kbd \ us.kbd \ + us.macbook.kbd \ us.unix.kbd \ FILESDIR= ${SHAREDIR}/vt/keymaps Added: head/share/vt/keymaps/us.macbook.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/us.macbook.kbd Thu Aug 9 09:06:30 2018 (r337526) @@ -0,0 +1,116 @@ +# $FreeBSD$ +# by Willian Theesfeld Jr +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '`' '~' nop nop '`' '~' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O + From owner-svn-src-all@freebsd.org Thu Aug 9 09:39:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32CF105E7C5; Thu, 9 Aug 2018 09:39:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8655E89F29; Thu, 9 Aug 2018 09:39:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47EEC179C8; Thu, 9 Aug 2018 09:39:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w799dXf4014143; Thu, 9 Aug 2018 09:39:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w799dWIV014139; Thu, 9 Aug 2018 09:39:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808090939.w799dWIV014139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Aug 2018 09:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337527 - in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common/include: asm linux X-SVN-Commit-Revision: 337527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 09:39:34 -0000 Author: hselasky Date: Thu Aug 9 09:39:32 2018 New Revision: 337527 URL: https://svnweb.freebsd.org/changeset/base/337527 Log: Use atomic_fcmpset_XXX() instead of atomic_cmpset_XXX() when possible in the LinuxKPI. Suggested by: mjg @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h head/sys/compat/linuxkpi/common/include/asm/atomic.h head/sys/compat/linuxkpi/common/include/asm/atomic64.h head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h Thu Aug 9 09:39:32 2018 (r337527) @@ -87,9 +87,8 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n long ret = old; for (;;) { - if (atomic_cmpset_long(&v->counter, old, new)) + if (atomic_fcmpset_long(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } @@ -99,13 +98,12 @@ atomic_long_cmpxchg(atomic_long_t *v, long old, long n static inline int atomic_long_add_unless(atomic_long_t *v, long a, long u) { - long c; + long c = atomic_long_read(v); for (;;) { - c = atomic_long_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_long(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) break; } return (c != u); Modified: head/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic.h Thu Aug 9 09:39:32 2018 (r337527) @@ -108,13 +108,12 @@ atomic_dec(atomic_t *v) static inline int atomic_add_unless(atomic_t *v, int a, int u) { - int c; + int c = atomic_read(v); for (;;) { - c = atomic_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_int(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) break; } return (c != u); @@ -132,12 +131,10 @@ atomic_xchg(atomic_t *v, int i) #if !defined(__mips__) return (atomic_swap_int(&v->counter, i)); #else - int ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_int(&v->counter, ret, i)) - break; - } + int ret = atomic_read(v); + + while (!atomic_fcmpset_int(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -148,9 +145,8 @@ atomic_cmpxchg(atomic_t *v, int old, int new) int ret = old; for (;;) { - if (atomic_cmpset_int(&v->counter, old, new)) + if (atomic_fcmpset_int(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/asm/atomic64.h Thu Aug 9 09:39:32 2018 (r337527) @@ -92,13 +92,12 @@ atomic64_dec(atomic64_t *v) static inline int64_t atomic64_add_unless(atomic64_t *v, int64_t a, int64_t u) { - int64_t c; + int64_t c = atomic64_read(v); for (;;) { - c = atomic64_read(v); if (unlikely(c == u)) break; - if (likely(atomic_cmpset_64(&v->counter, c, c + a))) + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) break; } return (c != u); @@ -111,12 +110,10 @@ atomic64_xchg(atomic64_t *v, int64_t i) (defined(__powerpc__) && !defined(__powerpc64__))) return (atomic_swap_64(&v->counter, i)); #else - int64_t ret; - for (;;) { - ret = READ_ONCE(v->counter); - if (atomic_cmpset_64(&v->counter, ret, i)) - break; - } + int64_t ret = atomic64_read(v); + + while (!atomic_fcmpset_64(&v->counter, &ret, i)) + ; return (ret); #endif } @@ -127,9 +124,8 @@ atomic64_cmpxchg(atomic64_t *v, int64_t old, int64_t n int64_t ret = old; for (;;) { - if (atomic_cmpset_64(&v->counter, old, new)) + if (atomic_fcmpset_64(&v->counter, &ret, new)) break; - ret = READ_ONCE(v->counter); if (ret != old) break; } Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 9 09:06:30 2018 (r337526) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Thu Aug 9 09:39:32 2018 (r337527) @@ -282,10 +282,10 @@ test_and_clear_bit(long bit, volatile unsigned long *v var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val & ~bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val & ~bit)) + ; return !!(val & bit); } @@ -312,10 +312,10 @@ test_and_set_bit(long bit, volatile unsigned long *var var += BIT_WORD(bit); bit %= BITS_PER_LONG; bit = (1UL << bit); - do { - val = *var; - } while (atomic_cmpset_long(var, val, val | bit) == 0); + val = *var; + while (!atomic_fcmpset_long(var, &val, val | bit)) + ; return !!(val & bit); } From owner-svn-src-all@freebsd.org Thu Aug 9 10:28:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C56551060008; Thu, 9 Aug 2018 10:28:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x235.google.com (mail-qt0-x235.google.com [IPv6:2607:f8b0:400d:c0d::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55F728B83F; Thu, 9 Aug 2018 10:28:00 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x235.google.com with SMTP id h4-v6so5890141qtj.7; Thu, 09 Aug 2018 03:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UO1wFwFqwS7JQrIPPBrpMKADpjjN0ECqRPcs7IuNu24=; b=kvSGu+T0KFlkvLrehLH3b9q7NaCN3pEh9UYsa1Os8HaYL1fA/QEOsrzObx7yPi2LsP y+3Aba2WGnHIGt6OlY2tWIblhDpo3FzV9sFre0Bpi1NvNx8kw+lF87/xxGG4iSkBzwSp VXyA9jNCsLs5JaNTWG1zwGBhokmywASkwEI7ddXRIkoA/4aHatuDx6HUB5N3dd0lmXJM ZHcs+hIpXRQW0fjY8SvAVmrlk5epoXa29XUIuIZ4Sj0PRywUHJgShTlmJiFkhd7mal0e znWUlYr9mpH6n3o4ZHOyyFSMIxUKVabZIXhwY5ofV1GhD5geY720nZ/mHaTkp7R7CXL5 K8/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UO1wFwFqwS7JQrIPPBrpMKADpjjN0ECqRPcs7IuNu24=; b=Bz12A6LfAYLyFoyQF1HL1SMlK+mEFl89lIV3WpceBurXjupqd7mpbKwworJMPANxbO 3rOogr5NSYjpHaAJGs4Sg+wbXTqiPgj7sIV4TZTzBnptblGugjJyfMoNA2DOr6022q2D RYJV8NTnpONHZ0ozuR1CtM3k8xX1U1wLqw7IRlTuzMjnWatmFKGWaHpuSLPosvHnQL2x IMGDSHhar3vU4u/tP8Vro7sMJLBT3jyyuxAmeYUF9yQhvAbNzSMbajjGvSur39Fpg+w5 HRgSNOkoQ3IEurMkwSvxtQAXRqBNOcbCGFS7+uLgKxBHsC3GkiQoFz53c4vFtBENE/XT e50A== X-Gm-Message-State: AOUpUlHs5hK6tijmC7vQ+zwRLwnMfJ/fVHHEuAREgpNS9A/p4dW569PG uYOLYZnyBcV4RXEdek4S/2+ZmR1R X-Google-Smtp-Source: AA+uWPz2jaQMgWlOPKxHKXXsH6zDS9ZEksybTDx2soDytK/YgRmXg9mPwFvbouCQ0wHbuqNw5AGUbg== X-Received: by 2002:ac8:7284:: with SMTP id v4-v6mr1356863qto.177.1533810479476; Thu, 09 Aug 2018 03:27:59 -0700 (PDT) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id s19-v6sm4438495qtj.61.2018.08.09.03.27.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 03:27:58 -0700 (PDT) Subject: Re: svn commit: r337497 - in head: . contrib/mdocml contrib/tnftp/src etc/root share/skel tools/tools/nanobsd/pcengines/Files/root tools/tools/nanobsd/rescue/Files/root usr.bin/mail usr.bin/man usr.bin... To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808081924.w78JOKLP061364@repo.freebsd.org> From: Renato Botelho Openpgp: preference=signencrypt Autocrypt: addr=garga.bsd@gmail.com; prefer-encrypt=mutual; keydata= xsBNBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAHNLFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+wsCXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/UM7ATQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABwsB8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <1830754d-569d-256f-95e9-87d16664b51a@gmail.com> Date: Thu, 9 Aug 2018 07:27:54 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <201808081924.w78JOKLP061364@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 10:28:01 -0000 On 08/08/18 16:24, Alan Somers wrote: > Author: asomers > Date: Wed Aug 8 19:24:20 2018 > New Revision: 337497 > URL: https://svnweb.freebsd.org/changeset/base/337497 > > Log: > Switch the default pager for most commands to less > > Finally, a pager for the nineties. > > MFC after: Never > Relnotes: Yes > Differential Revision: https://reviews.freebsd.org/D13465 > Poll: https://reviews.freebsd.org/V7 Thank you! -- Renato Botelho From owner-svn-src-all@freebsd.org Thu Aug 9 11:21:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E66E1061CFF; Thu, 9 Aug 2018 11:21:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 040B38D971; Thu, 9 Aug 2018 11:21:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA34118BE8; Thu, 9 Aug 2018 11:21:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79BLVHJ069643; Thu, 9 Aug 2018 11:21:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BLV5r069641; Thu, 9 Aug 2018 11:21:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201808091121.w79BLV5r069641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Aug 2018 11:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337528 - in head: share/man/man4 sys/ddb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: share/man/man4 sys/ddb X-SVN-Commit-Revision: 337528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 11:21:32 -0000 Author: avg Date: Thu Aug 9 11:21:31 2018 New Revision: 337528 URL: https://svnweb.freebsd.org/changeset/base/337528 Log: add an option for ddb ps command to print process arguments We use ps to collect the information of all processes in textdump. But it doesn't contain process arguments which however sometimes are very useful for debugging. The new 'a' modifier adds that capability. While here, remove 'm' modifier from ddb.4. It was in the manual page from its very first revision, but I could not find any evidence of the code ever supporting it. Submitted by: Terry Hu Reviewed by: kib MFC after: 1 week Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D16603 Modified: head/share/man/man4/ddb.4 head/sys/ddb/db_ps.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Aug 9 09:39:32 2018 (r337527) +++ head/share/man/man4/ddb.4 Thu Aug 9 11:21:31 2018 (r337528) @@ -537,16 +537,15 @@ If the thread is not found, search the thread stack ca cached stack address. Otherwise, prints nothing. .Pp -.It Ic show Cm all procs Ns Op Li / Ns Cm m -.It Ic ps Ns Op Li / Ns Cm m +.It Ic show Cm all procs Ns Op Li / Ns Cm a +.It Ic ps Ns Op Li / Ns Cm a Display all process information. The process information may not be shown if it is not supported in the machine, or the bottom of the stack of the target process is not in the main memory at that time. The -.Cm m -modifier will alter the display to show VM map -addresses for the process and not show other information. +.Cm a +modifier will print command line arguments for each process. .\" .Pp .It Ic show Cm all trace Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Thu Aug 9 09:39:32 2018 (r337527) +++ head/sys/ddb/db_ps.c Thu Aug 9 11:21:31 2018 (r337528) @@ -50,8 +50,13 @@ __FBSDID("$FreeBSD$"); #include +#define PRINT_NONE 0 +#define PRINT_ARGS 1 + static void dumpthread(volatile struct proc *p, volatile struct thread *td, int all); +static int ps_mode; + /* * At least one non-optional show-command must be implemented using * DB_SHOW_ALL_COMMAND() so that db_show_all_cmd_set gets created. @@ -62,6 +67,24 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) db_ps(addr, have_addr, count, modif); } +static void +dump_args(volatile struct proc *p) +{ + char *args; + int i, len; + + if (p->p_args == NULL) + return; + args = p->p_args->ar_args; + len = (int)p->p_args->ar_length; + for (i = 0; i < len; i++) { + if (args[i] == '\0') + db_printf(" "); + else + db_printf("%c", args[i]); + } +} + /* * Layout: * - column counts @@ -90,6 +113,7 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c char state[9]; int np, rflag, sflag, dflag, lflag, wflag; + ps_mode = modif[0] == 'a' ? PRINT_ARGS : PRINT_NONE; np = nprocs; if (!LIST_EMPTY(&allproc)) @@ -207,6 +231,10 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, c db_printf("%s", p->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } FOREACH_THREAD_IN_PROC(p, td) { @@ -299,6 +327,10 @@ dumpthread(volatile struct proc *p, volatile struct th db_printf("%s", td->td_proc->p_comm); if (p->p_flag & P_SYSTEM) db_printf("]"); + if (ps_mode == PRINT_ARGS && all == 0) { + db_printf(" "); + dump_args(p); + } db_printf("\n"); } @@ -445,12 +477,7 @@ DB_SHOW_COMMAND(proc, db_show_proc) db_printf(" ABI: %s\n", p->p_sysent->sv_name); if (p->p_args != NULL) { db_printf(" arguments: "); - for (i = 0; i < (int)p->p_args->ar_length; i++) { - if (p->p_args->ar_args[i] == '\0') - db_printf(" "); - else - db_printf("%c", p->p_args->ar_args[i]); - } + dump_args(p); db_printf("\n"); } db_printf(" repear: %p reapsubtree: %d\n", From owner-svn-src-all@freebsd.org Thu Aug 9 11:30:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 127FE10620A6; Thu, 9 Aug 2018 11:30:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD4CD8DDBD; Thu, 9 Aug 2018 11:30:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E5F218C58; Thu, 9 Aug 2018 11:30:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79BUDrj070991; Thu, 9 Aug 2018 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BUDsW070990; Thu, 9 Aug 2018 11:30:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808091130.w79BUDsW070990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Aug 2018 11:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337529 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 337529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 11:30:14 -0000 Author: hselasky Date: Thu Aug 9 11:30:13 2018 New Revision: 337529 URL: https://svnweb.freebsd.org/changeset/base/337529 Log: Implement missing atomic_fcmpset_XXX() support for i386. This also fixes i386 build after r337527. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Thu Aug 9 11:21:31 2018 (r337528) +++ head/sys/i386/include/atomic.h Thu Aug 9 11:30:13 2018 (r337529) @@ -130,6 +130,7 @@ u_##TYPE atomic_load_acq_##TYPE(volatile u_##TYPE *p) void atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_64(volatile uint64_t *, uint64_t, uint64_t); +int atomic_fcmpset_64(volatile uint64_t *, uint64_t *, uint64_t); uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); @@ -404,6 +405,18 @@ atomic_cmpset_64_i386(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i386(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if (atomic_cmpset_64_i386(dst, *expect, src)) { + return (1); + } else { + *expect = *dst; + return (0); + } +} + static __inline uint64_t atomic_load_acq_64_i386(volatile uint64_t *p) { @@ -483,6 +496,24 @@ atomic_cmpset_64_i586(volatile uint64_t *dst, uint64_t return (res); } +static __inline int +atomic_fcmpset_64_i586(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchg8b %1 ; " + " sete %0" + : "=q" (res), /* 0 */ + "+m" (*dst), /* 1 */ + "+A" (*expect) /* 2 */ + : "b" ((uint32_t)src), /* 3 */ + "c" ((uint32_t)(src >> 32)) /* 4 */ + : "memory", "cc"); + return (res); +} + static __inline uint64_t atomic_load_acq_64_i586(volatile uint64_t *p) { @@ -542,6 +573,16 @@ atomic_cmpset_64(volatile uint64_t *dst, uint64_t expe return (atomic_cmpset_64_i586(dst, expect, src)); } +static __inline int +atomic_fcmpset_64(volatile uint64_t *dst, uint64_t *expect, uint64_t src) +{ + + if ((cpu_feature & CPUID_CX8) == 0) + return (atomic_fcmpset_64_i386(dst, expect, src)); + else + return (atomic_fcmpset_64_i586(dst, expect, src)); +} + static __inline uint64_t atomic_load_acq_64(volatile uint64_t *p) { @@ -655,6 +696,14 @@ atomic_cmpset_long(volatile u_long *dst, u_long expect (u_int)src)); } +static __inline int +atomic_fcmpset_long(volatile u_long *dst, u_long *expect, u_long src) +{ + + return (atomic_fcmpset_int((volatile u_int *)dst, (u_int *)expect, + (u_int)src)); +} + static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) { @@ -834,6 +883,8 @@ u_long atomic_swap_long(volatile u_long *p, u_long v); /* Operations on 64-bit quad words. */ #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 +#define atomic_fcmpset_acq_64 atomic_fcmpset_64 +#define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fetchadd_acq_64 atomic_fetchadd_64 #define atomic_fetchadd_rel_64 atomic_fetchadd_64 #define atomic_add_acq_64 atomic_add_64 From owner-svn-src-all@freebsd.org Thu Aug 9 11:46:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB63A1062883; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81C398E87C; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6391A18F8C; Thu, 9 Aug 2018 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79BkDGG080778; Thu, 9 Aug 2018 11:46:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79BkDFq080777; Thu, 9 Aug 2018 11:46:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091146.w79BkDFq080777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 11:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337530 - head/sbin/ldconfig X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/ldconfig X-SVN-Commit-Revision: 337530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 11:46:14 -0000 Author: trasz Date: Thu Aug 9 11:46:12 2018 New Revision: 337530 URL: https://svnweb.freebsd.org/changeset/base/337530 Log: Make ldconfig(8) atomic, by removing an unneccessary call to unlink(2) before rename(2). Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16641 Modified: head/sbin/ldconfig/ldconfig.c Modified: head/sbin/ldconfig/ldconfig.c ============================================================================== --- head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:30:13 2018 (r337529) +++ head/sbin/ldconfig/ldconfig.c Thu Aug 9 11:46:12 2018 (r337530) @@ -518,13 +518,6 @@ buildhints(void) warn("%s", hints_file); return -1; } - - /* Install it */ - if (unlink(hints_file) != 0 && errno != ENOENT) { - warn("%s", hints_file); - return -1; - } - if (rename(tmpfilename, hints_file) != 0) { warn("%s", hints_file); return -1; From owner-svn-src-all@freebsd.org Thu Aug 9 12:07:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8746E10637C0; Thu, 9 Aug 2018 12:07:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ADEB8F67C; Thu, 9 Aug 2018 12:07:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1892C192AB; Thu, 9 Aug 2018 12:07:38 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79C7bVn091393; Thu, 9 Aug 2018 12:07:37 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79C7bLp091388; Thu, 9 Aug 2018 12:07:37 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201808091207.w79C7bLp091388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 9 Aug 2018 12:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337531 - in vendor-sys/ck/dist: include/gcc/ppc include/spinlock src X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in vendor-sys/ck/dist: include/gcc/ppc include/spinlock src X-SVN-Commit-Revision: 337531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:07:38 -0000 Author: cognet Date: Thu Aug 9 12:07:37 2018 New Revision: 337531 URL: https://svnweb.freebsd.org/changeset/base/337531 Log: Import CK as of commit 08813496570879fbcc2adcdd9ddc0a054361bfde, mostly to avoid using lwsync on ppc32. Modified: vendor-sys/ck/dist/include/gcc/ppc/ck_pr.h vendor-sys/ck/dist/include/spinlock/hclh.h vendor-sys/ck/dist/src/ck_barrier_combining.c Modified: vendor-sys/ck/dist/include/gcc/ppc/ck_pr.h ============================================================================== --- vendor-sys/ck/dist/include/gcc/ppc/ck_pr.h Thu Aug 9 11:46:12 2018 (r337530) +++ vendor-sys/ck/dist/include/gcc/ppc/ck_pr.h Thu Aug 9 12:07:37 2018 (r337531) @@ -67,21 +67,29 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "lwsync") -CK_PR_FENCE(atomic_store, "lwsync") +#ifdef CK_MD_PPC32_LWSYNC +#define CK_PR_LWSYNCOP "lwsync" +#else /* CK_MD_PPC32_LWSYNC_DISABLE */ +#define CK_PR_LWSYNCOP "sync" +#endif + +CK_PR_FENCE(atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(atomic_store, CK_PR_LWSYNCOP) CK_PR_FENCE(atomic_load, "sync") -CK_PR_FENCE(store_atomic, "lwsync") -CK_PR_FENCE(load_atomic, "lwsync") -CK_PR_FENCE(store, "lwsync") +CK_PR_FENCE(store_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(store, CK_PR_LWSYNCOP) CK_PR_FENCE(store_load, "sync") -CK_PR_FENCE(load, "lwsync") -CK_PR_FENCE(load_store, "lwsync") +CK_PR_FENCE(load, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_store, CK_PR_LWSYNCOP) CK_PR_FENCE(memory, "sync") -CK_PR_FENCE(acquire, "lwsync") -CK_PR_FENCE(release, "lwsync") -CK_PR_FENCE(acqrel, "lwsync") -CK_PR_FENCE(lock, "lwsync") -CK_PR_FENCE(unlock, "lwsync") +CK_PR_FENCE(acquire, CK_PR_LWSYNCOP) +CK_PR_FENCE(release, CK_PR_LWSYNCOP) +CK_PR_FENCE(acqrel, CK_PR_LWSYNCOP) +CK_PR_FENCE(lock, CK_PR_LWSYNCOP) +CK_PR_FENCE(unlock, CK_PR_LWSYNCOP) + +#undef CK_PR_LWSYNCOP #undef CK_PR_FENCE Modified: vendor-sys/ck/dist/include/spinlock/hclh.h ============================================================================== --- vendor-sys/ck/dist/include/spinlock/hclh.h Thu Aug 9 11:46:12 2018 (r337530) +++ vendor-sys/ck/dist/include/spinlock/hclh.h Thu Aug 9 12:07:37 2018 (r337531) @@ -81,6 +81,8 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q thread->wait = true; thread->splice = false; thread->cluster_id = (*local_queue)->cluster_id; + /* Make sure previous->previous doesn't appear to be NULL */ + thread->previous = *local_queue; /* Serialize with respect to update of local queue. */ ck_pr_fence_store_atomic(); @@ -91,13 +93,15 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q /* Wait until previous thread from the local queue is done with lock. */ ck_pr_fence_load(); - if (previous->previous != NULL && - previous->cluster_id == thread->cluster_id) { - while (ck_pr_load_uint(&previous->wait) == true) + if (previous->previous != NULL) { + while (ck_pr_load_uint(&previous->wait) == true && + ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) ck_pr_stall(); /* We're head of the global queue, we're done */ - if (ck_pr_load_uint(&previous->splice) == false) + if (ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) return; } Modified: vendor-sys/ck/dist/src/ck_barrier_combining.c ============================================================================== --- vendor-sys/ck/dist/src/ck_barrier_combining.c Thu Aug 9 11:46:12 2018 (r337530) +++ vendor-sys/ck/dist/src/ck_barrier_combining.c Thu Aug 9 12:07:37 2018 (r337531) @@ -35,7 +35,7 @@ struct ck_barrier_combining_queue { struct ck_barrier_combining_group *tail; }; -CK_CC_INLINE static struct ck_barrier_combining_group * +static struct ck_barrier_combining_group * ck_barrier_combining_queue_dequeue(struct ck_barrier_combining_queue *queue) { struct ck_barrier_combining_group *front = NULL; @@ -48,7 +48,7 @@ ck_barrier_combining_queue_dequeue(struct ck_barrier_c return front; } -CK_CC_INLINE static void +static void ck_barrier_combining_insert(struct ck_barrier_combining_group *parent, struct ck_barrier_combining_group *tnode, struct ck_barrier_combining_group **child) @@ -72,7 +72,7 @@ ck_barrier_combining_insert(struct ck_barrier_combinin * into the barrier's tree. We use a queue to implement this * traversal. */ -CK_CC_INLINE static void +static void ck_barrier_combining_queue_enqueue(struct ck_barrier_combining_queue *queue, struct ck_barrier_combining_group *node_value) { @@ -185,10 +185,10 @@ ck_barrier_combining_aux(struct ck_barrier_combining * ck_pr_fence_store(); ck_pr_store_uint(&tnode->sense, ~tnode->sense); } else { - ck_pr_fence_memory(); while (sense != ck_pr_load_uint(&tnode->sense)) ck_pr_stall(); } + ck_pr_fence_memory(); return; } From owner-svn-src-all@freebsd.org Thu Aug 9 12:09:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA4B7106384E; Thu, 9 Aug 2018 12:09:36 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB588F7FF; Thu, 9 Aug 2018 12:09:36 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5339A192AC; Thu, 9 Aug 2018 12:09:36 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79C9aAf091518; Thu, 9 Aug 2018 12:09:36 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79C9avb091517; Thu, 9 Aug 2018 12:09:36 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201808091209.w79C9avb091517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 9 Aug 2018 12:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337532 - vendor-sys/ck/20180809 X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: vendor-sys/ck/20180809 X-SVN-Commit-Revision: 337532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:09:37 -0000 Author: cognet Date: Thu Aug 9 12:09:35 2018 New Revision: 337532 URL: https://svnweb.freebsd.org/changeset/base/337532 Log: Tag CK after import of commit 08813496570879fbcc2adcdd9ddc0a054361bfde Added: vendor-sys/ck/20180809/ - copied from r337531, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Thu Aug 9 12:11:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E314106393E; Thu, 9 Aug 2018 12:11:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7DEA8FBA7; Thu, 9 Aug 2018 12:11:50 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA6631941D; Thu, 9 Aug 2018 12:11:50 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CBot0096123; Thu, 9 Aug 2018 12:11:50 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CBokk096121; Thu, 9 Aug 2018 12:11:50 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201808091211.w79CBokk096121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 9 Aug 2018 12:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337533 - in head/sys/contrib/ck: include/gcc/ppc include/spinlock src X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in head/sys/contrib/ck: include/gcc/ppc include/spinlock src X-SVN-Commit-Revision: 337533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:11:51 -0000 Author: cognet Date: Thu Aug 9 12:11:49 2018 New Revision: 337533 URL: https://svnweb.freebsd.org/changeset/base/337533 Log: Import CK as of commit 08813496570879fbcc2adcdd9ddc0a054361bfde, mostly to avoid using lwsync on ppc32. Modified: head/sys/contrib/ck/include/gcc/ppc/ck_pr.h head/sys/contrib/ck/include/spinlock/hclh.h head/sys/contrib/ck/src/ck_barrier_combining.c Directory Properties: head/sys/contrib/ck/ (props changed) Modified: head/sys/contrib/ck/include/gcc/ppc/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/gcc/ppc/ck_pr.h Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/include/gcc/ppc/ck_pr.h Thu Aug 9 12:11:49 2018 (r337533) @@ -67,21 +67,29 @@ ck_pr_stall(void) __asm__ __volatile__(I ::: "memory"); \ } -CK_PR_FENCE(atomic, "lwsync") -CK_PR_FENCE(atomic_store, "lwsync") +#ifdef CK_MD_PPC32_LWSYNC +#define CK_PR_LWSYNCOP "lwsync" +#else /* CK_MD_PPC32_LWSYNC_DISABLE */ +#define CK_PR_LWSYNCOP "sync" +#endif + +CK_PR_FENCE(atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(atomic_store, CK_PR_LWSYNCOP) CK_PR_FENCE(atomic_load, "sync") -CK_PR_FENCE(store_atomic, "lwsync") -CK_PR_FENCE(load_atomic, "lwsync") -CK_PR_FENCE(store, "lwsync") +CK_PR_FENCE(store_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_atomic, CK_PR_LWSYNCOP) +CK_PR_FENCE(store, CK_PR_LWSYNCOP) CK_PR_FENCE(store_load, "sync") -CK_PR_FENCE(load, "lwsync") -CK_PR_FENCE(load_store, "lwsync") +CK_PR_FENCE(load, CK_PR_LWSYNCOP) +CK_PR_FENCE(load_store, CK_PR_LWSYNCOP) CK_PR_FENCE(memory, "sync") -CK_PR_FENCE(acquire, "lwsync") -CK_PR_FENCE(release, "lwsync") -CK_PR_FENCE(acqrel, "lwsync") -CK_PR_FENCE(lock, "lwsync") -CK_PR_FENCE(unlock, "lwsync") +CK_PR_FENCE(acquire, CK_PR_LWSYNCOP) +CK_PR_FENCE(release, CK_PR_LWSYNCOP) +CK_PR_FENCE(acqrel, CK_PR_LWSYNCOP) +CK_PR_FENCE(lock, CK_PR_LWSYNCOP) +CK_PR_FENCE(unlock, CK_PR_LWSYNCOP) + +#undef CK_PR_LWSYNCOP #undef CK_PR_FENCE Modified: head/sys/contrib/ck/include/spinlock/hclh.h ============================================================================== --- head/sys/contrib/ck/include/spinlock/hclh.h Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/include/spinlock/hclh.h Thu Aug 9 12:11:49 2018 (r337533) @@ -81,6 +81,8 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q thread->wait = true; thread->splice = false; thread->cluster_id = (*local_queue)->cluster_id; + /* Make sure previous->previous doesn't appear to be NULL */ + thread->previous = *local_queue; /* Serialize with respect to update of local queue. */ ck_pr_fence_store_atomic(); @@ -91,13 +93,15 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_q /* Wait until previous thread from the local queue is done with lock. */ ck_pr_fence_load(); - if (previous->previous != NULL && - previous->cluster_id == thread->cluster_id) { - while (ck_pr_load_uint(&previous->wait) == true) + if (previous->previous != NULL) { + while (ck_pr_load_uint(&previous->wait) == true && + ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) ck_pr_stall(); /* We're head of the global queue, we're done */ - if (ck_pr_load_uint(&previous->splice) == false) + if (ck_pr_load_int(&previous->cluster_id) == thread->cluster_id && + ck_pr_load_uint(&previous->splice) == false) return; } Modified: head/sys/contrib/ck/src/ck_barrier_combining.c ============================================================================== --- head/sys/contrib/ck/src/ck_barrier_combining.c Thu Aug 9 12:09:35 2018 (r337532) +++ head/sys/contrib/ck/src/ck_barrier_combining.c Thu Aug 9 12:11:49 2018 (r337533) @@ -35,7 +35,7 @@ struct ck_barrier_combining_queue { struct ck_barrier_combining_group *tail; }; -CK_CC_INLINE static struct ck_barrier_combining_group * +static struct ck_barrier_combining_group * ck_barrier_combining_queue_dequeue(struct ck_barrier_combining_queue *queue) { struct ck_barrier_combining_group *front = NULL; @@ -48,7 +48,7 @@ ck_barrier_combining_queue_dequeue(struct ck_barrier_c return front; } -CK_CC_INLINE static void +static void ck_barrier_combining_insert(struct ck_barrier_combining_group *parent, struct ck_barrier_combining_group *tnode, struct ck_barrier_combining_group **child) @@ -72,7 +72,7 @@ ck_barrier_combining_insert(struct ck_barrier_combinin * into the barrier's tree. We use a queue to implement this * traversal. */ -CK_CC_INLINE static void +static void ck_barrier_combining_queue_enqueue(struct ck_barrier_combining_queue *queue, struct ck_barrier_combining_group *node_value) { @@ -185,10 +185,10 @@ ck_barrier_combining_aux(struct ck_barrier_combining * ck_pr_fence_store(); ck_pr_store_uint(&tnode->sense, ~tnode->sense); } else { - ck_pr_fence_memory(); while (sense != ck_pr_load_uint(&tnode->sense)) ck_pr_stall(); } + ck_pr_fence_memory(); return; } From owner-svn-src-all@freebsd.org Thu Aug 9 12:13:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29FFE1063BB9; Thu, 9 Aug 2018 12:13:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D36E98FE45; Thu, 9 Aug 2018 12:13:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B60081944F; Thu, 9 Aug 2018 12:13:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CD88V096221; Thu, 9 Aug 2018 12:13:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CD8h0096220; Thu, 9 Aug 2018 12:13:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091213.w79CD8h0096220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 12:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337534 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:13:09 -0000 Author: trasz Date: Thu Aug 9 12:13:08 2018 New Revision: 337534 URL: https://svnweb.freebsd.org/changeset/base/337534 Log: Refactor common code into execute_script(). Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16627 Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Thu Aug 9 12:11:49 2018 (r337533) +++ head/sbin/init/init.c Thu Aug 9 12:13:08 2018 (r337534) @@ -146,6 +146,7 @@ static void transition(state_t); static state_t requested_transition; static state_t current_state = death_single; +static void execute_script(char *argv[]); static void open_console(void); static const char *get_shell(void); static void write_stderr(const char *message); @@ -1046,6 +1047,46 @@ runcom(void) return (state_func_t) read_ttys; } +static void +execute_script(char *argv[]) +{ + struct sigaction sa; + const char *shell, *script; + int error; + + bzero(&sa, sizeof(sa)); + sigemptyset(&sa.sa_mask); + sa.sa_handler = SIG_IGN; + sigaction(SIGTSTP, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); + + open_console(); + + sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); +#ifdef LOGIN_CAP + setprocresources(RESOURCE_RC); +#endif + + /* + * Try to directly execute the script first. If it + * fails, try the old method of passing the script path + * to sh(1). Don't complain if it fails because of + * the missing execute bit. + */ + script = argv[1]; + error = access(script, X_OK); + if (error == 0) { + execv(script, argv + 1); + warning("can't exec %s: %m", script); + } else if (errno != EACCES) { + warning("can't access %s: %m", script); + } + + shell = get_shell(); + execv(shell, argv); + stall("can't exec %s for %s: %m", shell, script); +} + /* * Run a shell script. * Returns 0 on success, otherwise the next transition to enter: @@ -1057,22 +1098,14 @@ static state_func_t run_script(const char *script) { pid_t pid, wpid; - int error, status; + int status; char *argv[4]; const char *shell; - struct sigaction sa; shell = get_shell(); if ((pid = fork()) == 0) { - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, (struct sigaction *)0); - sigaction(SIGHUP, &sa, (struct sigaction *)0); - open_console(); - char _sh[] = "sh"; char _autoboot[] = "autoboot"; @@ -1081,28 +1114,8 @@ run_script(const char *script) argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0; argv[3] = 0; - sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0); - -#ifdef LOGIN_CAP - setprocresources(RESOURCE_RC); -#endif - - /* - * Try to directly execute the script first. If it - * fails, try the old method of passing the script path - * to sh(1). Don't complain if it fails because of - * the missing execute bit. - */ - error = access(script, X_OK); - if (error == 0) { - execv(script, argv + 1); - warning("can't exec %s: %m", script); - } else if (errno != EACCES) { - warning("can't access %s: %m", script); - } - - execv(shell, argv); - stall("can't exec %s for %s: %m", shell, script); + execute_script(argv); + sleep(STALL_TIMEOUT); _exit(1); /* force single user mode */ } @@ -1869,12 +1882,10 @@ static int runshutdown(void) { pid_t pid, wpid; - int error, status; + int status; int shutdowntimeout; size_t len; char *argv[4]; - const char *shell; - struct sigaction sa; struct stat sb; /* @@ -1886,17 +1897,7 @@ runshutdown(void) if (stat(_PATH_RUNDOWN, &sb) == -1 && errno == ENOENT) return 0; - shell = get_shell(); - if ((pid = fork()) == 0) { - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sa.sa_handler = SIG_IGN; - sigaction(SIGTSTP, &sa, (struct sigaction *)0); - sigaction(SIGHUP, &sa, (struct sigaction *)0); - - open_console(); - char _sh[] = "sh"; char _reboot[] = "reboot"; char _single[] = "single"; @@ -1906,34 +1907,13 @@ runshutdown(void) argv[1] = _path_rundown; argv[2] = Reboot ? _reboot : _single; argv[3] = 0; - - sigprocmask(SIG_SETMASK, &sa.sa_mask, (sigset_t *) 0); - -#ifdef LOGIN_CAP - setprocresources(RESOURCE_RC); -#endif - - /* - * Try to directly execute the script first. If it - * fails, try the old method of passing the script path - * to sh(1). Don't complain if it fails because of - * the missing execute bit. - */ - error = access(_path_rundown, X_OK); - if (error == 0) { - execv(_path_rundown, argv + 1); - warning("can't exec %s: %m", _path_rundown); - } else if (errno != EACCES) { - warning("can't access %s: %m", _path_rundown); - } - - execv(shell, argv); - warning("can't exec %s for %s: %m", shell, _PATH_RUNDOWN); + + execute_script(argv); _exit(1); /* force single user mode */ } if (pid == -1) { - emergency("can't fork for %s on %s: %m", shell, _PATH_RUNDOWN); + emergency("can't fork for %s: %m", _PATH_RUNDOWN); while (waitpid(-1, (int *) 0, WNOHANG) > 0) continue; sleep(STALL_TIMEOUT); @@ -1956,20 +1936,20 @@ runshutdown(void) if (clang == 1) { /* we were waiting for the sub-shell */ kill(wpid, SIGTERM); - warning("timeout expired for %s on %s: %m; going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("timeout expired for %s: %m; going to " + "single user mode", _PATH_RUNDOWN); return -1; } if (wpid == -1) { if (errno == EINTR) continue; - warning("wait for %s on %s failed: %m; going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("wait for %s failed: %m; going to " + "single user mode", _PATH_RUNDOWN); return -1; } if (wpid == pid && WIFSTOPPED(status)) { - warning("init: %s on %s stopped, restarting\n", - shell, _PATH_RUNDOWN); + warning("init: %s stopped, restarting\n", + _PATH_RUNDOWN); kill(pid, SIGCONT); wpid = -1; } @@ -1992,8 +1972,8 @@ runshutdown(void) } if (!WIFEXITED(status)) { - warning("%s on %s terminated abnormally, going to " - "single user mode", shell, _PATH_RUNDOWN); + warning("%s terminated abnormally, going to " + "single user mode", _PATH_RUNDOWN); return -2; } From owner-svn-src-all@freebsd.org Thu Aug 9 12:17:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 136CF1063E56; Thu, 9 Aug 2018 12:17:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDEC57011A; Thu, 9 Aug 2018 12:17:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A059519454; Thu, 9 Aug 2018 12:17:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CH3g9096412; Thu, 9 Aug 2018 12:17:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CH3gO096411; Thu, 9 Aug 2018 12:17:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808091217.w79CH3gO096411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 9 Aug 2018 12:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337535 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:17:04 -0000 Author: trasz Date: Thu Aug 9 12:17:03 2018 New Revision: 337535 URL: https://svnweb.freebsd.org/changeset/base/337535 Log: Use NULLs instead of casted zeroes, for consistency. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Thu Aug 9 12:13:08 2018 (r337534) +++ head/sbin/init/init.c Thu Aug 9 12:17:03 2018 (r337535) @@ -316,12 +316,12 @@ invalid: delset(&mask, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, SIGXCPU, SIGXFSZ, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGALRM, SIGUSR1, SIGUSR2, SIGWINCH, 0); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; - sigaction(SIGTTIN, &sa, (struct sigaction *)0); - sigaction(SIGTTOU, &sa, (struct sigaction *)0); + sigaction(SIGTTIN, &sa, NULL); + sigaction(SIGTTOU, &sa, NULL); /* * Paranoia. @@ -435,7 +435,7 @@ handle(sig_t handler, ...) sa.sa_mask = mask_everything; /* XXX SA_RESTART? */ sa.sa_flags = sig == SIGCHLD ? SA_NOCLDSTOP : 0; - sigaction(sig, &sa, (struct sigaction *) 0); + sigaction(sig, &sa, NULL); } va_end(ap); } @@ -958,7 +958,7 @@ single_user(void) * and those are reset to SIG_DFL on exec. */ sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); /* * Fire off a shell. @@ -1443,7 +1443,7 @@ start_window_system(session_t *sp) _exit(0); sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); if (setsid() < 0) emergency("setsid failed (window) %m"); @@ -1510,7 +1510,7 @@ start_getty(session_t *sp) } sigemptyset(&mask); - sigprocmask(SIG_SETMASK, &mask, (sigset_t *) 0); + sigprocmask(SIG_SETMASK, &mask, NULL); #ifdef LOGIN_CAP setprocresources(RESOURCE_GETTY); From owner-svn-src-all@freebsd.org Thu Aug 9 12:46:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1272910651BC; Thu, 9 Aug 2018 12:46:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB35371655; Thu, 9 Aug 2018 12:46:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9768D19947; Thu, 9 Aug 2018 12:46:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79CkU7u012088; Thu, 9 Aug 2018 12:46:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79CkU84012087; Thu, 9 Aug 2018 12:46:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808091246.w79CkU84012087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 12:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337536 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 337536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:46:31 -0000 Author: ae Date: Thu Aug 9 12:46:30 2018 New Revision: 337536 URL: https://svnweb.freebsd.org/changeset/base/337536 Log: If -q flag is specified, do not complain when we are trying to delete nonexistent NAT instance or nonexistent rule. This allows execute batched `delete` commands and do not fail when found nonexistent rule. Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Aug 9 12:17:03 2018 (r337535) +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); if (exitval) { exitval = EX_UNAVAILABLE; - warn("rule %u not available", i); + if (co.do_quiet) + continue; + warn("nat %u not available", i); } - } else if (co.do_pipe) { + } else if (co.do_pipe) { exitval = ipfw_delete_pipe(co.do_pipe, i); } else { memset(&rt, 0, sizeof(rt)); @@ -3295,10 +3297,14 @@ ipfw_delete(char *av[]) i = do_range_cmd(IP_FW_XDEL, &rt); if (i != 0) { exitval = EX_UNAVAILABLE; + if (co.do_quiet) + continue; warn("rule %u: setsockopt(IP_FW_XDEL)", rt.start_rule); } else if (rt.new_set == 0 && do_set == 0) { exitval = EX_UNAVAILABLE; + if (co.do_quiet) + continue; if (rt.start_rule != rt.end_rule) warnx("no rules rules in %u-%u range", rt.start_rule, rt.end_rule); @@ -3308,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval != EX_OK) + if (exitval != EX_OK && co.do_quiet == 0) exit(exitval); } From owner-svn-src-all@freebsd.org Thu Aug 9 12:52:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDD29106559F; Thu, 9 Aug 2018 12:52:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEE671C0F; Thu, 9 Aug 2018 12:52:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22f.google.com with SMTP id n21-v6so9604463oig.3; Thu, 09 Aug 2018 05:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NxWnRG1i2yBHYyTcVioHmlIZjeKJLVg6Gbo66oSVX18=; b=ZwpqejW9lSZZCp7HjW80QF52FIfrkl1aJUQy96+uUdEPMM6U5mghfellJaDvEg22Ec 2zYljW8pBV66arnHcuf5ikSOiCgdcFuUmljsLdg++bDe0GFqlTrPOsrzxhzXmQBhfHoh 8oXXWT5+VvFCXfynoE2OhkxT7C2mAivDO+XESxX2NxifUZLNL+cPAuxTTGiV0I107yc6 Ni5F37X0qJ44XnlMHygtKDpwXI7V2MkDPiq/nxzSgKMKJr7ZvO5hm5XCOX1JJSrV8NZY U85vla8rB7iSaE6beI61wYAtb2l4OzjC+3vAoDfRpvY2a/d5aUWkODVzPBMTCHHG9AaC mXtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NxWnRG1i2yBHYyTcVioHmlIZjeKJLVg6Gbo66oSVX18=; b=N5VKQ0F+sAvDG2A+G4KBV9jRuTKuZ5AchbZf6H/FJRrKKXk8B73tTAA8MJTVAjiiJS WGhFSwjB1ejDjsnnvmHJkIDgspT9LHvb0/6FM3JF/juuIqV/xDwWqig0iZVDlqDAMkzW KK/sKG8nKO1yLJojic4wDOn21yck209d6JLG0GA+VJgZw8ziZSRfYQrSLBRECz2PJUPW OvUN5TzZaWWYmlqsL3ng7FQkynPJp5nN2oIs6vv7t+2ky31K2OkcRqAO854RKIwmorHB i9YLzIEedBm857Rn+VRl3Y7aRfge1z7X5ykRsttzzYuLBeMXT/FxmNkqBB3Bux3/B5S3 iKTA== X-Gm-Message-State: AOUpUlEUMhty+GFL6rpNtBedRskNH/L0IAFPiUzoG6+6BSjDXg+d+SI6 eI/mpQFhL7q9y8U6ibY3jY+ECOVyZXC3axVvrZBuvgRSzUg= X-Google-Smtp-Source: AA+uWPzbM4aUbVcfqCDT1pY29MT6uYewE6nMjqRjg3oZdknxjD8jwmOW6LtSpVAlUkkBSWICGcFv/NzQRsUGGvAoQW0= X-Received: by 2002:aca:6142:: with SMTP id v63-v6mr2139975oib.137.1533819128548; Thu, 09 Aug 2018 05:52:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3bb6:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 05:52:08 -0700 (PDT) In-Reply-To: <201808091217.w79CH3gO096411@repo.freebsd.org> References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 9 Aug 2018 07:52:08 -0500 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Edward Tomasz Napierala Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 12:52:10 -0000 On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Thu Aug 9 12:17:03 2018 > New Revision: 337535 > URL: https://svnweb.freebsd.org/changeset/base/337535 > > Log: > Use NULLs instead of casted zeroes, for consistency. > It's probably helpful to note explicitly that these are not in arguments to varargs functions, in which case the explicit cast is needed in order to produce a program that will have correct behavior on all compliant compilers/systems. (We do define NULL to be a zero-with-cast, but programs should not assume that NULL will be of pointer type -- "An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant".) -Ben From owner-svn-src-all@freebsd.org Thu Aug 9 14:04:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB90F10674FA; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7164774145; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E29E1A69C; Thu, 9 Aug 2018 14:04:52 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79E4qK2052555; Thu, 9 Aug 2018 14:04:52 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79E4p5F052553; Thu, 9 Aug 2018 14:04:51 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201808091404.w79E4p5F052553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 9 Aug 2018 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337537 - in head/sys: kern netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: kern netinet netinet6 X-SVN-Commit-Revision: 337537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:04:53 -0000 Author: luporl Date: Thu Aug 9 14:04:51 2018 New Revision: 337537 URL: https://svnweb.freebsd.org/changeset/base/337537 Log: [ppc] Fix kernel panic when using BOOTP_NFSROOT On PowerPC (and possibly other architectures), that doesn't use EARLY_AP_STARTUP, the config task queue may be used initialized. This was observed while trying to mount the root fs from NFS, as reported here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230168. This patch has 2 main changes: 1- Perform a basic initialization of qgroup_config, similar to what is done in taskqgroup_adjust, but simpler. This makes qgroup_config ready to be used during NFS root mount. 2- When EARLY_AP_STARTUP is not used, call inm_init() and in6m_init() right before SI_SUB_ROOT_CONF, because bootp needs to send multicast packages to request an IP. PR: Bug 230168 Reported by: sbruno Reviewed by: jhibbits, mmacy, sbruno Approved by: jhibbits Differential Revision: D16633 Modified: head/sys/kern/subr_gtaskqueue.c head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/kern/subr_gtaskqueue.c Thu Aug 9 14:04:51 2018 (r337537) @@ -857,6 +857,24 @@ taskqgroup_bind(struct taskqgroup *qgroup) } } +static void +taskqgroup_config_init(void *arg) +{ + struct taskqgroup *qgroup = qgroup_config; + LIST_HEAD(, grouptask) gtask_head = LIST_HEAD_INITIALIZER(NULL); + + LIST_SWAP(>ask_head, &qgroup->tqg_queue[0].tgc_tasks, + grouptask, gt_list); + qgroup->tqg_queue[0].tgc_cnt = 0; + taskqgroup_cpu_create(qgroup, 0, 0); + + qgroup->tqg_cnt = 1; + qgroup->tqg_stride = 1; +} + +SYSINIT(taskqgroup_config_init, SI_SUB_TASKQ, SI_ORDER_SECOND, + taskqgroup_config_init, NULL); + static int _taskqgroup_adjust(struct taskqgroup *qgroup, int cnt, int stride) { Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/netinet/in_mcast.c Thu Aug 9 14:04:51 2018 (r337537) @@ -231,8 +231,13 @@ static void inm_init(void) taskqgroup_config_gtask_init(NULL, &free_gtask, inm_release_task, "inm release task"); } +#ifdef EARLY_AP_STARTUP SYSINIT(inm_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, inm_init, NULL); +#else +SYSINIT(inm_init, SI_SUB_ROOT_CONF - 1, SI_ORDER_FIRST, + inm_init, NULL); +#endif void Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu Aug 9 12:46:30 2018 (r337536) +++ head/sys/netinet6/in6_mcast.c Thu Aug 9 14:04:51 2018 (r337537) @@ -562,8 +562,13 @@ static void in6m_init(void) taskqgroup_config_gtask_init(NULL, &free_gtask, in6m_release_task, "in6m release task"); } +#ifdef EARLY_AP_STARTUP SYSINIT(in6m_init, SI_SUB_SMP + 1, SI_ORDER_FIRST, in6m_init, NULL); +#else +SYSINIT(in6m_init, SI_SUB_ROOT_CONF - 1, SI_ORDER_SECOND, + in6m_init, NULL); +#endif void From owner-svn-src-all@freebsd.org Thu Aug 9 14:19:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D71B21067B94; Thu, 9 Aug 2018 14:19:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84DBB74B13; Thu, 9 Aug 2018 14:19:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 667D61A836; Thu, 9 Aug 2018 14:19:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79EJmlq058453; Thu, 9 Aug 2018 14:19:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79EJlJi058448; Thu, 9 Aug 2018 14:19:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091419.w79EJlJi058448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337538 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 337538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:19:49 -0000 Author: np Date: Thu Aug 9 14:19:47 2018 New Revision: 337538 URL: https://svnweb.freebsd.org/changeset/base/337538 Log: cxgbe(4): Add support for high priority filters on T6+. They have their own region in the TCAM starting with T6, unlike previous chips where they were in the same region as normal filters. These filters "hit" before anything else in the LE's lookup. The exact order is: a) High priority filters b) TOE's active region (TCAM and/or hash) c) Servers (TOE hw listeners) d) Normal filters MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/common/common.h Thu Aug 9 14:19:47 2018 (r337538) @@ -441,6 +441,13 @@ static inline int is_ftid(const struct adapter *sc, u_ tid <= sc->tids.ftid_end); } +static inline int is_hpftid(const struct adapter *sc, u_int tid) +{ + + return (sc->tids.nhpftids > 0 && tid >= sc->tids.hpftid_base && + tid <= sc->tids.hpftid_end); +} + static inline int is_etid(const struct adapter *sc, u_int tid) { Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/offload.h Thu Aug 9 14:19:47 2018 (r337538) @@ -133,7 +133,12 @@ struct tid_info { u_int ftid_base; u_int ftid_end; + u_int nhpftids; + u_int hpftid_base; + u_int hpftid_end; + u_int ntids; + u_int tid_base; u_int netids; u_int etid_base; @@ -150,10 +155,13 @@ struct tid_info { union aopen_entry *afree; u_int atids_in_use; + /* High priority filters and normal filters share the lock and cv. */ struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); struct cv ftid_cv; struct filter_entry *ftid_tab; + struct filter_entry *hpftid_tab; u_int ftids_in_use; + u_int hpftids_in_use; /* * hashfilter and TOE are mutually exclusive and both use ntids and Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_filter.c Thu Aug 9 14:19:47 2018 (r337538) @@ -64,12 +64,20 @@ struct filter_entry { }; static void free_filter_resources(struct filter_entry *); +static int get_tcamfilter(struct adapter *, struct t4_filter *); static int get_hashfilter(struct adapter *, struct t4_filter *); static int set_hashfilter(struct adapter *, struct t4_filter *, uint64_t, struct l2t_entry *, struct smt_entry *); static int del_hashfilter(struct adapter *, struct t4_filter *); static int configure_hashfilter_tcb(struct adapter *, struct filter_entry *); +static inline bool +separate_hpfilter_region(struct adapter *sc) +{ + + return (chip_id(sc) >= CHELSIO_T6); +} + static int alloc_hftid_tab(struct tid_info *t, int flags) { @@ -302,7 +310,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode) if (rc) return (rc); - if (sc->tids.ftids_in_use > 0) { + if (sc->tids.ftids_in_use > 0 || sc->tids.hpftids_in_use > 0) { rc = EBUSY; goto done; } @@ -343,39 +351,10 @@ get_filter_hits(struct adapter *sc, uint32_t tid) int get_filter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.nftids; - struct filter_entry *f; - if (t->fs.hash) return (get_hashfilter(sc, t)); - - if (sc->tids.ftids_in_use == 0 || sc->tids.ftid_tab == NULL || - t->idx >= nfilters) { - t->idx = 0xffffffff; - return (0); - } - - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; - for (i = t->idx; i < nfilters; i++, f++) { - if (f->valid) { - MPASS(f->tid == sc->tids.ftid_base + i); - t->idx = i; - t->l2tidx = f->l2te ? f->l2te->idx : 0; - t->smtidx = f->smt ? f->smt->idx : 0; - if (f->fs.hitcnts) - t->hits = get_filter_hits(sc, f->tid); - else - t->hits = UINT64_MAX; - t->fs = f->fs; - - goto done; - } - } - t->idx = 0xffffffff; -done: - mtx_unlock(&sc->tids.ftid_lock); - return (0); + else + return (get_tcamfilter(sc, t)); } static int @@ -387,15 +366,23 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t u_int vnic_vld, vnic_vld_mask; struct wrq_cookie cookie; int i, rc, busy, locked; + u_int tid; const int ntids = t->fs.type ? 4 : 1; MPASS(!t->fs.hash); - MPASS(t->idx < sc->tids.nftids); /* Already validated against fconf, iconf */ MPASS((t->fs.val.pfvf_vld & t->fs.val.ovlan_vld) == 0); MPASS((t->fs.mask.pfvf_vld & t->fs.mask.ovlan_vld) == 0); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + MPASS(t->idx < sc->tids.nhpftids); + f = &sc->tids.hpftid_tab[t->idx]; + tid = sc->tids.hpftid_base + t->idx; + } else { + MPASS(t->idx < sc->tids.nftids); + f = &sc->tids.ftid_tab[t->idx]; + tid = sc->tids.ftid_base + t->idx; + } rc = busy = locked = 0; mtx_lock(&sc->tids.ftid_lock); for (i = 0; i < ntids; i++) { @@ -418,7 +405,10 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t rc = ENOMEM; else { f->pending = 1; - sc->tids.ftids_in_use++; + if (separate_hpfilter_region(sc) && t->fs.prio) + sc->tids.hpftids_in_use++; + else + sc->tids.ftids_in_use++; } } mtx_unlock(&sc->tids.ftid_lock); @@ -434,7 +424,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t * Can't fail now. A set-filter WR will definitely be sent. */ - f->tid = sc->tids.ftid_base + t->idx; + f->tid = tid; f->fs = t->fs; f->l2te = l2te; f->smt = smt; @@ -649,10 +639,17 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) return (rc); } else { - if (ti->nftids == 0) - return (ENOTSUP); - if (t->idx >= ti->nftids) - return (EINVAL); + if (separate_hpfilter_region(sc) && t->fs.prio) { + if (ti->nhpftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nhpftids) + return (EINVAL); + } else { + if (ti->nftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nftids) + return (EINVAL); + } /* IPv6 filter idx must be 4 aligned */ if (t->fs.type == 1 && ((t->idx & 0x3) || t->idx + 4 >= ti->nftids)) @@ -702,17 +699,37 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) goto done; } + } else if (separate_hpfilter_region(sc) && t->fs.prio && + __predict_false(ti->hpftid_tab == NULL)) { + MPASS(ti->nhpftids != 0); + KASSERT(ti->hpftids_in_use == 0, + ("%s: no memory allocated but hpftids_in_use is %u", + __func__, ti->hpftids_in_use)); + ti->hpftid_tab = malloc(sizeof(struct filter_entry) * + ti->nhpftids, M_CXGBE, M_NOWAIT | M_ZERO); + if (ti->hpftid_tab == NULL) { + rc = ENOMEM; + goto done; + } + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } else if (__predict_false(ti->ftid_tab == NULL)) { + MPASS(ti->nftids != 0); KASSERT(ti->ftids_in_use == 0, - ("%s: no memory allocated but ftids_in_use > 0", __func__)); + ("%s: no memory allocated but ftids_in_use is %u", + __func__, ti->ftids_in_use)); ti->ftid_tab = malloc(sizeof(struct filter_entry) * ti->nftids, M_CXGBE, M_NOWAIT | M_ZERO); if (ti->ftid_tab == NULL) { rc = ENOMEM; goto done; } - mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); - cv_init(&ti->ftid_cv, "t4fcv"); + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } done: end_synchronized_op(sc, 0); @@ -768,16 +785,32 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t struct filter_entry *f; struct fw_filter_wr *fwr; struct wrq_cookie cookie; - int rc; + int rc, nfilters; +#ifdef INVARIANTS + u_int tid_base; +#endif - MPASS(sc->tids.ftid_tab != NULL); - MPASS(sc->tids.nftids > 0); - - if (t->idx >= sc->tids.nftids) - return (EINVAL); - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + MPASS(f != NULL); /* Caller checked this. */ + if (t->idx >= nfilters) { + rc = EINVAL; + goto done; + } + f += t->idx; + if (f->locked) { rc = EPERM; goto done; @@ -790,7 +823,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t rc = EINVAL; goto done; } - MPASS(f->tid == sc->tids.ftid_base + t->idx); + MPASS(f->tid == tid_base + t->idx); fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), &cookie); if (fwr == NULL) { rc = ENOMEM; @@ -833,6 +866,9 @@ del_filter(struct adapter *sc, struct t4_filter *t) if (t->fs.hash) { if (sc->tids.hftid_tab != NULL) return (del_hashfilter(sc, t)); + } else if (separate_hpfilter_region(sc) && t->fs.prio) { + if (sc->tids.hpftid_tab != NULL) + return (del_tcamfilter(sc, t)); } else { if (sc->tids.ftid_tab != NULL) return (del_tcamfilter(sc, t)); @@ -899,21 +935,28 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *rpl = (const void *)(rss + 1); u_int tid = GET_TID(rpl); - u_int rc, cleanup, idx; + u_int rc, idx; struct filter_entry *f; KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - MPASS(is_ftid(sc, tid)); - cleanup = 0; - idx = tid - sc->tids.ftid_base; - f = &sc->tids.ftid_tab[idx]; + + if (is_hpftid(sc, tid)) { + idx = tid - sc->tids.hpftid_base; + f = &sc->tids.hpftid_tab[idx]; + } else if (is_ftid(sc, tid)) { + idx = tid - sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + } else + panic("%s: FW reply for invalid TID %d.", __func__, tid); + + MPASS(f->tid == tid); rc = G_COOKIE(rpl->cookie); mtx_lock(&sc->tids.ftid_lock); KASSERT(f->pending, ("%s: reply %d for filter[%u] that isn't pending.", - __func__, rc, idx)); + __func__, rc, tid)); switch(rc) { case FW_FILTER_WR_FLT_ADDED: /* set-filter succeeded */ @@ -936,7 +979,10 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head /* set-filter failed due to lack of SMT space. */ MPASS(f->valid == 0); free_filter_resources(f); - sc->tids.ftids_in_use--; + if (separate_hpfilter_region(sc) && f->fs.prio) + sc->tids.hpftids_in_use--; + else + sc->tids.ftids_in_use--; break; case FW_FILTER_WR_SUCCESS: case FW_FILTER_WR_EINVAL: @@ -1077,10 +1123,68 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct } static int +get_tcamfilter(struct adapter *sc, struct t4_filter *t) +{ + int i, nfilters; + struct filter_entry *f; + u_int in_use; +#ifdef INVARIANTS + u_int tid_base; +#endif + + MPASS(!t->fs.hash); + + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; + in_use = sc->tids.hpftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; + in_use = sc->tids.ftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + + if (in_use == 0 || f == NULL || t->idx >= nfilters) { + t->idx = 0xffffffff; + return (0); + } + + f += t->idx; + mtx_lock(&sc->tids.ftid_lock); + for (i = t->idx; i < nfilters; i++, f++) { + if (f->valid) { + MPASS(f->tid == tid_base + i); + t->idx = i; + t->l2tidx = f->l2te ? f->l2te->idx : 0; + t->smtidx = f->smt ? f->smt->idx : 0; + if (f->fs.hitcnts) + t->hits = get_filter_hits(sc, f->tid); + else + t->hits = UINT64_MAX; + t->fs = f->fs; + + goto done; + } + } + t->idx = 0xffffffff; +done: + mtx_unlock(&sc->tids.ftid_lock); + return (0); +} + +static int get_hashfilter(struct adapter *sc, struct t4_filter *t) { int i, nfilters = sc->tids.ntids; struct filter_entry *f; + + MPASS(t->fs.hash); if (sc->tids.tids_in_use == 0 || sc->tids.hftid_tab == NULL || t->idx >= nfilters) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_main.c Thu Aug 9 14:19:47 2018 (r337538) @@ -1404,6 +1404,7 @@ t4_detach_common(device_t dev) free(sc->sge.iqmap, M_CXGBE); free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); + free(sc->tids.hpftid_tab, M_CXGBE); if (sc->tids.hftid_tab) free_hftid_tab(&sc->tids); free(sc->tids.atid_tab, M_CXGBE); @@ -3853,6 +3854,47 @@ get_params__post_init(struct adapter *sc) __func__, sc->vres.l2t.size, L2T_SIZE)); sc->params.core_vdd = val[6]; + if (chip_id(sc) >= CHELSIO_T6) { + +#ifdef INVARIANTS + if (sc->params.fw_vers >= + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + /* + * Note that the code to enable the region should run + * before t4_fw_initialize and not here. This is just a + * reminder to add said code. + */ + device_printf(sc->dev, + "hpfilter region not enabled.\n"); + } +#endif + + sc->tids.tid_base = t4_read_reg(sc, + A_LE_DB_ACTIVE_TABLE_START_INDEX); + + param[0] = FW_PARAM_PFVF(HPFILTER_START); + param[1] = FW_PARAM_PFVF(HPFILTER_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query hpfilter parameters: %d.\n", rc); + return (rc); + } + if ((int)val[1] > (int)val[0]) { + sc->tids.hpftid_base = val[0]; + sc->tids.hpftid_end = val[1]; + sc->tids.nhpftids = val[1] - val[0] + 1; + + /* + * These should go off if the layout changes and the + * driver needs to catch up. + */ + MPASS(sc->tids.hpftid_base == 0); + MPASS(sc->tids.tid_base == sc->tids.nhpftids); + } + } + /* * MPSBGMAP is queried separately because only recent firmwares support * it as a parameter and we don't want the compound query above to fail @@ -3916,6 +3958,12 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; + if (sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + MPASS(sc->tids.ntids >= sc->tids.nhpftids); + sc->tids.ntids -= sc->tids.nhpftids; + } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); sc->params.hash_filter = 1; } @@ -8127,6 +8175,11 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) t->atids_in_use); } + if (t->nhpftids) { + sbuf_printf(sb, "HPFTID range: %u-%u, in use: %u\n", + t->hpftid_base, t->hpftid_end, t->hpftids_in_use); + } + if (t->ntids) { sbuf_printf(sb, "TID range: "); if (t4_read_reg(sc, A_LE_DB_CONFIG) & F_HASHEN) { @@ -8141,10 +8194,10 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (b) - sbuf_printf(sb, "0-%u, ", b - 1); + sbuf_printf(sb, "%u-%u, ", t->tid_base, b - 1); sbuf_printf(sb, "%u-%u", hb, t->ntids - 1); } else - sbuf_printf(sb, "0-%u", t->ntids - 1); + sbuf_printf(sb, "%u-%u", t->tid_base, t->ntids - 1); sbuf_printf(sb, ", in use: %u\n", atomic_load_acq_int(&t->tids_in_use)); } @@ -8155,8 +8208,8 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (t->nftids) { - sbuf_printf(sb, "FTID range: %u-%u\n", t->ftid_base, - t->ftid_base + t->nftids - 1); + sbuf_printf(sb, "FTID range: %u-%u, in use: %u\n", t->ftid_base, + t->ftid_end, t->ftids_in_use); } if (t->netids) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 14:19:47 2018 (r337538) @@ -367,7 +367,7 @@ set_tcb_rpl_handler(struct sge_iq *iq, const struct rs MPASS(m == NULL); tid = GET_TID(cpl); - if (is_ftid(iq->adapter, tid)) { + if (is_hpftid(iq->adapter, tid) || is_ftid(iq->adapter, tid)) { /* * The return code for filter-write is put in the CPL cookie so * we have to rely on the hardware tid (is_ftid) to determine Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 9 14:04:51 2018 (r337537) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Aug 9 14:19:47 2018 (r337538) @@ -510,7 +510,10 @@ insert_tid(struct adapter *sc, int tid, void *ctx, int { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + MPASS(tid >= t->tid_base); + MPASS(tid - t->tid_base < t->ntids); + + t->tid_tab[tid - t->tid_base] = ctx; atomic_add_int(&t->tids_in_use, ntids); } @@ -519,7 +522,7 @@ lookup_tid(struct adapter *sc, int tid) { struct tid_info *t = &sc->tids; - return (t->tid_tab[tid]); + return (t->tid_tab[tid - t->tid_base]); } void @@ -527,7 +530,7 @@ update_tid(struct adapter *sc, int tid, void *ctx) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + t->tid_tab[tid - t->tid_base] = ctx; } void @@ -535,7 +538,7 @@ remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = NULL; + t->tid_tab[tid - t->tid_base] = NULL; atomic_subtract_int(&t->tids_in_use, ntids); } From owner-svn-src-all@freebsd.org Thu Aug 9 14:21:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC24E1067C5B; Thu, 9 Aug 2018 14:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6026C74D3B; Thu, 9 Aug 2018 14:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41FAD1A97D; Thu, 9 Aug 2018 14:21:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79ELSD6059985; Thu, 9 Aug 2018 14:21:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79ELRNW059984; Thu, 9 Aug 2018 14:21:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091421.w79ELRNW059984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337539 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 337539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:21:28 -0000 Author: np Date: Thu Aug 9 14:21:27 2018 New Revision: 337539 URL: https://svnweb.freebsd.org/changeset/base/337539 Log: cxgbetool(8): Userspace part of support for high priority filters on T6+. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.8 head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.8 ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.8 Thu Aug 9 14:19:47 2018 (r337538) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Thu Aug 9 14:21:27 2018 (r337539) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2018 +.Dd Aug 8, 2018 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -60,7 +60,7 @@ .It .Nm Ar nexus Cm filter Ar idx Ar filter-specification .It -.Nm Ar nexus Cm filter Ar idx Cm delete +.Nm Ar nexus Cm filter Ar idx Cm delete Op Cm prio Bro Cm 0 | 1 Brc .It .Nm Ar nexus Cm filter list .It @@ -381,7 +381,7 @@ TCAM filters: The number of available filters is in dev...nfilters. .Ar idx must be an unused index between 0 and nfilters - 1. -IPv6 filters consume 4 consecutive entries on T4/T5 and and 2 on T6 and +IPv6 filters consume 4 consecutive entries on T4/T5 and 2 on T6 and .Ar idx must be aligned to 4 or 2 in this case. .Pp Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Thu Aug 9 14:19:47 2018 (r337538) +++ head/usr.sbin/cxgbetool/cxgbetool.c Thu Aug 9 14:21:27 2018 (r337539) @@ -94,7 +94,7 @@ usage(FILE *fp) "\tcontext show an SGE context\n" "\tdumpstate dump chip state\n" "\tfilter [ ] ... set a filter\n" - "\tfilter delete|clear delete a filter\n" + "\tfilter delete|clear [prio 1] delete a filter\n" "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\thashfilter [ ] ... set a hashfilter\n" @@ -147,7 +147,6 @@ real_doit(unsigned long cmd, void *data, const char *c rc = errno; return (rc); } - chip_id = nexus[1] - '0'; } rc = ioctl(fd, cmd, data); @@ -934,7 +933,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t printf("(hash)"); } } - if (t->fs.prio) + if (chip_id <= 5 && t->fs.prio) printf(" Prio"); if (t->fs.rpttid) printf(" RptTID"); @@ -944,7 +943,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t static int show_filters(int hash) { - uint32_t mode = 0, header = 0; + uint32_t mode = 0, header, hpfilter = 0; struct t4_filter t; int rc; @@ -953,6 +952,29 @@ show_filters(int hash) if (rc != 0) return (rc); + if (!hash && chip_id >= 6) { + header = 0; + bzero(&t, sizeof (t)); + t.idx = 0; + t.fs.hash = 0; + t.fs.prio = 1; + for (t.idx = 0; ; t.idx++) { + rc = doit(CHELSIO_T4_GET_FILTER, &t); + if (rc != 0 || t.idx == 0xffffffff) + break; + + if (!header) { + printf("High Priority TCAM Region:\n"); + do_show_info_header(mode); + header = 1; + hpfilter = 1; + } + do_show_one_filter_info(&t, mode); + } + } + + header = 0; + bzero(&t, sizeof (t)); t.idx = 0; t.fs.hash = hash; for (t.idx = 0; ; t.idx++) { @@ -961,11 +983,13 @@ show_filters(int hash) break; if (!header) { + if (hpfilter) + printf("\nNormal Priority TCAM Region:\n"); do_show_info_header(mode); header = 1; } do_show_one_filter_info(&t, mode); - }; + } return (rc); } @@ -1092,10 +1116,11 @@ set_filter_mode(int argc, const char *argv[]) } static int -del_filter(uint32_t idx, int hashfilter) +del_filter(uint32_t idx, int prio, int hashfilter) { struct t4_filter t; + t.fs.prio = prio; t.fs.hash = hashfilter; t.idx = idx; @@ -1225,6 +1250,15 @@ set_filter(uint32_t idx, int argc, const char *argv[], } else if (!parse_val("hitcnts", args, &val)) { t.fs.hitcnts = val; } else if (!parse_val("prio", args, &val)) { + if (hash) { + warnx("Hashfilters doesn't support \"prio\"\n"); + return (EINVAL); + } + if (val != 0 && val != 1) { + warnx("invalid priority \"%s\"; must be" + " \"0\" or \"1\"", argv[start_arg + 1]); + return (EINVAL); + } t.fs.prio = val; } else if (!parse_val("rpttid", args, &val)) { t.fs.rpttid = 1; @@ -1406,10 +1440,33 @@ filter_cmd(int argc, const char *argv[], int hashfilte } idx = (uint32_t) val; - /* delete|clear */ - if (argc == 2 && + /* delete|clear [prio 0|1] */ + if ((argc == 2 || argc == 4) && (strcmp(argv[1], "delete") == 0 || strcmp(argv[1], "clear") == 0)) { - return del_filter(idx, hashfilter); + int prio = 0; + + if (argc == 4) { + if (hashfilter) { + warnx("stray arguments after \"%s\".", argv[1]); + return (EINVAL); + } + + if (strcmp(argv[2], "prio") != 0) { + warnx("\"prio\" is the only valid keyword " + "after \"%s\", found \"%s\" instead.", + argv[1], argv[2]); + return (EINVAL); + } + + s = str_to_number(argv[3], NULL, &val); + if (*s || val < 0 || val > 1) { + warnx("%s \"%s\"; must be \"0\" or \"1\".", + argv[2], argv[3]); + return (EINVAL); + } + prio = (int)val; + } + return del_filter(idx, prio, hashfilter); } /* skip */ @@ -3557,6 +3614,7 @@ main(int argc, const char *argv[]) } nexus = argv[1]; + chip_id = nexus[1] - '0'; /* progname and nexus */ argc -= 2; From owner-svn-src-all@freebsd.org Thu Aug 9 14:28:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A241067F8D; Thu, 9 Aug 2018 14:28:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 F2F3975397; Thu, 9 Aug 2018 14:28:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79ESmYv017685; Thu, 9 Aug 2018 07:28:48 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79ESmln017684; Thu, 9 Aug 2018 07:28:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <201808091246.w79CkU84012087@repo.freebsd.org> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 07:28:48 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:28:51 -0000 > Author: ae > Date: Thu Aug 9 12:46:30 2018 > New Revision: 337536 > URL: https://svnweb.freebsd.org/changeset/base/337536 > > Log: > If -q flag is specified, do not complain when we are trying to delete > nonexistent NAT instance or nonexistent rule. It would probably be better to not overload -q with what is usually a -f like functionality of a command. Sadly -f is already used in ipfw, so another option should be choosen. > This allows execute batched `delete` commands and do not fail when > found nonexistent rule. So now I can not code a quiet ipfw command that does fail when I give it a bad delete command :-(. > Obtained from: Yandex LLC > MFC after: 2 weeks > Sponsored by: Yandex LLC > > Modified: > head/sbin/ipfw/ipfw2.c > > Modified: head/sbin/ipfw/ipfw2.c > ============================================================================== > --- head/sbin/ipfw/ipfw2.c Thu Aug 9 12:17:03 2018 (r337535) > +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) > @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) > exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); > if (exitval) { > exitval = EX_UNAVAILABLE; > - warn("rule %u not available", i); > + if (co.do_quiet) > + continue; > + warn("nat %u not available", i); > } > - } else if (co.do_pipe) { > + } else if (co.do_pipe) { > exitval = ipfw_delete_pipe(co.do_pipe, i); > } else { > memset(&rt, 0, sizeof(rt)); > @@ -3295,10 +3297,14 @@ ipfw_delete(char *av[]) > i = do_range_cmd(IP_FW_XDEL, &rt); > if (i != 0) { > exitval = EX_UNAVAILABLE; > + if (co.do_quiet) > + continue; > warn("rule %u: setsockopt(IP_FW_XDEL)", > rt.start_rule); > } else if (rt.new_set == 0 && do_set == 0) { > exitval = EX_UNAVAILABLE; > + if (co.do_quiet) > + continue; > if (rt.start_rule != rt.end_rule) > warnx("no rules rules in %u-%u range", > rt.start_rule, rt.end_rule); > @@ -3308,7 +3314,7 @@ ipfw_delete(char *av[]) > } > } > } > - if (exitval != EX_OK) > + if (exitval != EX_OK && co.do_quiet == 0) > exit(exitval); > } > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 14:33:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CB4A1068245; Thu, 9 Aug 2018 14:33:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDB1F75A68; Thu, 9 Aug 2018 14:33:17 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward101o.mail.yandex.net (Yandex) with ESMTP id A6C051341FF8; Thu, 9 Aug 2018 17:33:08 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ByrnRNgkj6-X8Imsm4v; Thu, 09 Aug 2018 17:33:08 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533825188; bh=HjAuM91yURe9olicTMnvPTmmsra6Cey+mjBy7+GDId0=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=dJbScly6cslHn++60ekSS3zkHXCCbjIniX9GBjNQWyh73Aw8r3n/7OMarEEdsRGNL LMF2tGFGLrD5H5JhIVWkG1OL+O80SWu6GLCkct5Uz6c5VDC1G12IRy0QRLJm3q06Pk 5wrQPJ8cIqU7sJpFuhSimEu0clBXLZn3JzIv9x+c= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id MLrszNJksQ-X75OtgeX; Thu, 09 Aug 2018 17:33:07 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533825187; bh=HjAuM91yURe9olicTMnvPTmmsra6Cey+mjBy7+GDId0=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=WoTa2ChbZHTKaishSChlIKToeVWjXEhhkZdmn+M/VE3h4a2CFhgWuQHJqtHi60Mfd bgt+8171b4Iuioj5f1xVpyg8BAA3cpWmQzreHVII6UwOVmcHO2Cx7doxIcgt6+kYmh 63jPdr1ROpAcxQ7lv9u39rghr3miSdHMMkNlBdiE= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> Date: Thu, 9 Aug 2018 17:32:39 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:33:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA Content-Type: multipart/mixed; boundary="LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> --LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 17:28, Rodney W. Grimes wrote: >> Author: ae >> Date: Thu Aug 9 12:46:30 2018 >> New Revision: 337536 >> URL: https://svnweb.freebsd.org/changeset/base/337536 >> >> Log: >> If -q flag is specified, do not complain when we are trying to delet= e >> nonexistent NAT instance or nonexistent rule. >=20 > It would probably be better to not overload -q with what is > usually a -f like functionality of a command. Sadly -f is > already used in ipfw, so another option should be choosen. >=20 >> This allows execute batched `delete` commands and do not fail when >> found nonexistent rule. >=20 > So now I can not code a quiet ipfw command that does fail when > I give it a bad delete command :-(. Previously -q did not handled by delete command, so you can just use bad "ipfw delete" without -q :) --=20 WBR, Andrey V. Elsukov --LpJyyWminLHZf2p9I37HHjKfGbfbuS4Zt-- --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsUIcACgkQAcXqBBDI oXqpxgf/fzmdNCMFNEdo4azluvfn1K9ACM4uK/I1+oB65k/OB7PRAkWO+yhRsFgk WDbp0DuLDEX57jCKWihbCDLAuxyS4QmBE4lJu3eprUlBXuLfFtgYaVuPv6rky7VZ 7VlPwwpGk7A7/ThRHd9xL0FF5jhAgdAiRT19DWA3siPE0kISzV+5Gqd8OLCI4Wza tOUru7n3XkLhSuc1IH0Ce/AbtQk6Xb3bjhVzOotVc87M4SdbUOeYKHeYNwLjiFHP W9DbzllQ5qBqE42bTYbEuwUEL+sMWZse2vfr3kld5YvImVuWx1VEu4W3gUB468GL SOLFMe4m5hSdGz0ScIH0k0N5TU8ElA== =3zWV -----END PGP SIGNATURE----- --UeyYkxXOZH3rWOCb9kqjga9eH5kCqOKIA-- From owner-svn-src-all@freebsd.org Thu Aug 9 14:36:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 632331068315; Thu, 9 Aug 2018 14:36:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1551775C1C; Thu, 9 Aug 2018 14:36:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E58E81AB61; Thu, 9 Aug 2018 14:36:44 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79EaiuC068806; Thu, 9 Aug 2018 14:36:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79Eaifp068805; Thu, 9 Aug 2018 14:36:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808091436.w79Eaifp068805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 14:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337540 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:36:45 -0000 Author: np Date: Thu Aug 9 14:36:44 2018 New Revision: 337540 URL: https://svnweb.freebsd.org/changeset/base/337540 Log: cxgbe(4): Display pkt-size and burst-size in traffic class parameters. Modified: head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Thu Aug 9 14:21:27 2018 (r337539) +++ head/sys/dev/cxgbe/t4_sched.c Thu Aug 9 14:36:44 2018 (r337540) @@ -650,6 +650,10 @@ sysctl_tc_params(SYSCTL_HANDLER_ARGS) break; case SCHED_CLASS_MODE_FLOW: sbuf_printf(sb, " per-flow"); + if (tc.pktsize > 0) + sbuf_printf(sb, " pkt-size %u", tc.pktsize); + if (tc.burstsize > 0) + sbuf_printf(sb, " burst-size %u", tc.burstsize); break; default: rc = ENXIO; From owner-svn-src-all@freebsd.org Thu Aug 9 14:40:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B6DE10685B0; Thu, 9 Aug 2018 14:40:35 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 BD86D75FAE; Thu, 9 Aug 2018 14:40:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79EeWnJ017774; Thu, 9 Aug 2018 07:40:32 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79EeWYj017773; Thu, 9 Aug 2018 07:40:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <740fdc14-f1a0-db75-372d-a0a0c52de62a@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 07:40:32 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:40:35 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 09.08.2018 17:28, Rodney W. Grimes wrote: > >> Author: ae > >> Date: Thu Aug 9 12:46:30 2018 > >> New Revision: 337536 > >> URL: https://svnweb.freebsd.org/changeset/base/337536 > >> > >> Log: > >> If -q flag is specified, do not complain when we are trying to delete > >> nonexistent NAT instance or nonexistent rule. > > > > It would probably be better to not overload -q with what is > > usually a -f like functionality of a command. Sadly -f is > > already used in ipfw, so another option should be choosen. > > > >> This allows execute batched `delete` commands and do not fail when > >> found nonexistent rule. > > > > So now I can not code a quiet ipfw command that does fail when > > I give it a bad delete command :-(. > > Previously -q did not handled by delete command, so you can just use bad > "ipfw delete" without -q :) This now means -q has 2 functions, silence most commands, and silently ignore errors on delete. That is a poor implementation of syntax and options. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 14:48:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3EE41069385; Thu, 9 Aug 2018 14:48:51 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::608]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B308786B7; Thu, 9 Aug 2018 14:48:50 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 7D50944434CC; Thu, 9 Aug 2018 17:48:40 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id j0SDnleRZ6-meIKUJYM; Thu, 09 Aug 2018 17:48:40 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533826120; bh=e3Uq49I1Zu7cfGyOfFBpl4ZgUu+8lZpzulmGXhmNEP8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=HcHXPvMh8TchBawNauoJydXF5+gKcWZ31CPJHH5lcYFtQyosfV/vEX9zVjTJERpFx Mm5RGUjrLKBCt3GUsWV1mw+tRQs81xxHn1g2eZwjV2GmHuzAVGaaIIb3sQsgsabG0W VbhWE/1EB9Txb+mN+0y+obf8rLrKUdeS4DogCPKc= Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id szA5aJ1AMD-mdOKCdpQ; Thu, 09 Aug 2018 17:48:39 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533826119; bh=e3Uq49I1Zu7cfGyOfFBpl4ZgUu+8lZpzulmGXhmNEP8=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=dvehdJxQydD4At4N49uOrUBY0Vo+bh/i3fHvCSklQZvB8sGM6hgIK6ZYqlk3cSqBh Kw6e8MCwHMozmBgvGDZmA//KKff5Oi7yrvPsFVxXOIviWmgQCd+u055pwIeyWK2MRC I112zmz4fyq3P9G5uLIWEoK47oLVGPPJ3bHf0bVQ= Authentication-Results: smtp2o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> Date: Thu, 9 Aug 2018 17:48:12 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 14:48:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ Content-Type: multipart/mixed; boundary="spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091440.w79EeWYj017773@pdx.rh.CN85.dnsmgr.net> --spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 17:40, Rodney W. Grimes wrote: >>> So now I can not code a quiet ipfw command that does fail when >>> I give it a bad delete command :-(. >> >> Previously -q did not handled by delete command, so you can just use b= ad >> "ipfw delete" without -q :) >=20 > This now means -q has 2 functions, silence most commands, > and silently ignore errors on delete. >=20 > That is a poor implementation of syntax and options. I think it makes "delete" command to have the same behavior as described for commands in "-q" description: -q Be quiet when executing the add, nat, zero, resetlog or flush commands; (implies -f). This is useful when updating rulesets by executing multiple ipfw commands in a script (e.g., =E2=80=98sh=C2=A0/etc/rc.firewall=E2=80=99), or by processing a fil= e with many ipfw rules across a remote login session. It also stops a table add or delete from failing if the entry already exists or is not present. table add/delete commands had the same behavior, "nat" already noted in this list. What is the usage scenario do you use, where you need to fail on bad delete? =09 --=20 WBR, Andrey V. Elsukov --spdXVtP3yl6FhG3okyfhG7epxgW5IBj1B-- --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsVCwACgkQAcXqBBDI oXoy8Af+MOnY966xX7auk9xZQ5YMNvmBlY8H5XVJv0aAyFtcj1m6mMnJv+tQppzj kkvze4I0Gtf+dqbdCLRypeGtssQsys4PI1BiAXjiCP+89yjgtx9g02+NxCPGdNEH ftW3ki67vl/lUnHH6smaqo3QDu6G616qn7kmu/MXy85xUWT5Nx2M1v9NlL+kBK9U pKBlAkL+vTfTE/jb1dFFocIK9A9/M8Brrdp4wXzyNh12Zk62/QYWFYh/arbcsR38 kv4igQqin3URNBIRC+7f9TD1ffyxKp6eIlfhXPGyZ52zWyvOl6JBOkMsrOUZSbcc V46uudKRaOGd7XoY0XKJCPBzhiY+VA== =jyKv -----END PGP SIGNATURE----- --BcQH2h1NECUiu8mHJVgt8LcEI4GXuP8LQ-- From owner-svn-src-all@freebsd.org Thu Aug 9 15:22:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9890B106A040; Thu, 9 Aug 2018 15:22:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE8B79DFB; Thu, 9 Aug 2018 15:22:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D2C81B387; Thu, 9 Aug 2018 15:22:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79FMdHb098280; Thu, 9 Aug 2018 15:22:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79FMcKE098279; Thu, 9 Aug 2018 15:22:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808091522.w79FMcKE098279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Aug 2018 15:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r337541 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: markj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 337541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 15:22:39 -0000 Author: markj Date: Thu Aug 9 15:22:38 2018 New Revision: 337541 URL: https://svnweb.freebsd.org/changeset/base/337541 Log: Welcome Li-Wen to the ranks of src committers. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Aug 9 14:36:44 2018 (r337540) +++ svnadmin/conf/access Thu Aug 9 15:22:38 2018 (r337541) @@ -140,6 +140,7 @@ loos lstewart luigi luporl +lwhsu mahrens manu marcel Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Aug 9 14:36:44 2018 (r337540) +++ svnadmin/conf/mentors Thu Aug 9 15:22:38 2018 (r337541) @@ -28,6 +28,7 @@ jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko leitao jhibbits Co-mentor: nwhitehorn luporl jhibbits Co-mentor: nwhitehorn +lwhsu markj Co-mentor: emaste mahrens mckusick miwi araujo mjoras rstone From owner-svn-src-all@freebsd.org Thu Aug 9 15:35:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04161106A4A0; Thu, 9 Aug 2018 15:35:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADE987A3D2; Thu, 9 Aug 2018 15:35:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDA61B527; Thu, 9 Aug 2018 15:35:48 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79FZmOO003660; Thu, 9 Aug 2018 15:35:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79FZmkw003659; Thu, 9 Aug 2018 15:35:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808091535.w79FZmkw003659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Aug 2018 15:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337542 - stable/11/usr.bin/procstat/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.bin/procstat/tests X-SVN-Commit-Revision: 337542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 15:35:49 -0000 Author: markj Date: Thu Aug 9 15:35:48 2018 New Revision: 337542 URL: https://svnweb.freebsd.org/changeset/base/337542 Log: MFC r337133: Add a rudimentary test for procstat kstack. Modified: stable/11/usr.bin/procstat/tests/procstat_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- stable/11/usr.bin/procstat/tests/procstat_test.sh Thu Aug 9 15:22:38 2018 (r337541) +++ stable/11/usr.bin/procstat/tests/procstat_test.sh Thu Aug 9 15:35:48 2018 (r337542) @@ -131,10 +131,25 @@ file_descriptor_body() atf_check -o match:"$line_re" awk 'NR > 1' procstat.out } +atf_test_case kernel_stacks +kernel_stacks_head() +{ + atf_set "descr" "Captures kernel stacks for all visible threads" +} +kernel_stacks_body() +{ + atf_check -o save:procstat.out procstat -a kstack + atf_check -o not-empty awk '{if ($3 == "procstat") print}' procstat.out + + atf_check -o save:procstat.out procstat -kka + atf_check -o not-empty awk '{if ($3 == "procstat") print}' procstat.out +} + atf_init_test_cases() { atf_add_test_case binary_info atf_add_test_case command_line_arguments atf_add_test_case environment atf_add_test_case file_descriptor + atf_add_test_case kernel_stacks } From owner-svn-src-all@freebsd.org Thu Aug 9 15:48:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7272A106A9C4; Thu, 9 Aug 2018 15:48:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 CE2AE7AB38; Thu, 9 Aug 2018 15:48:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Fm8jG018169; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79Fm8Ed018168; Thu, 9 Aug 2018 08:48:08 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <1511fb63-89f9-14a9-32df-6706b5a9e93c@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 08:48:08 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 15:48:12 -0000 > On 09.08.2018 17:40, Rodney W. Grimes wrote: > >>> So now I can not code a quiet ipfw command that does fail when > >>> I give it a bad delete command :-(. > >> > >> Previously -q did not handled by delete command, so you can just use bad > >> "ipfw delete" without -q :) > > > > This now means -q has 2 functions, silence most commands, > > and silently ignore errors on delete. > > > > That is a poor implementation of syntax and options. > > I think it makes "delete" command to have the same behavior as described > for commands in "-q" description: Which is yet another bug in your commit, you did not update the synopsis or the description of the -q flag to include your change. Though oddly the synopsis does show delete -q, it how ever does not show -q for any of the table commands. > > -q Be quiet when executing the add, nat, zero, resetlog or flush > commands; (implies -f). No mention of what it does on delete, does -q on delete imply -f? > This is useful when updating rulesets by > executing multiple ipfw commands in a script (e.g., > ?sh?/etc/rc.firewall?), or by processing a file with many ipfw > rules across a remote login session. It also stops a table add > or delete from failing if the entry already exists or is not > present. That suggesting that -q is good for remote login session is poor advice at best, you should redirect both standard and error output to a file, depending on -q is just a loaded gun waiting to go off. > > table add/delete commands had the same behavior, "nat" already noted in > this list. What is the usage scenario do you use, where you need to fail > on bad delete? if [ ipfw delete ${1} ]; then handle the missing rule fi But more importantly you seem to be ignoring the aspect that your overloading a "silent" option with a "ignore failure" option. That is bad design. The description of the -q flag is already 2x as long as it should be in a good design. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 16:02:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3773C106B2D4; Thu, 9 Aug 2018 16:02:11 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A573B7B513; Thu, 9 Aug 2018 16:02:10 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 9166718061B2; Thu, 9 Aug 2018 19:01:59 +0300 (MSK) Received: from smtp4p.mail.yandex.net (smtp4p.mail.yandex.net [2a02:6b8:0:1402::15:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VkhMn87jVX-1xIWRdlW; Thu, 09 Aug 2018 19:01:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533830519; bh=RTG9QSyaX+jlKqKYVoVsxvSi6UvtFJ3Wquv8NfpZCos=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=CtOucxA0ViYSIqQja11DgQWAwlfdUiGVwwCOCjFZtZlvmWDv8qGh3LIEWCKMfOsmB AgMPcjR1eyeeHWfjk4uYRorqfGccgvTq7nkSsnfQ1abgt5hOtpn2bMZqw7GHe9w3JO XjPeOs4OD8feLSkFgXOmNmQO58zOYvp1eIUXCl+o= Received: by smtp4p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2KJkKTHhdN-1wqqGl6I; Thu, 09 Aug 2018 19:01:59 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533830519; bh=RTG9QSyaX+jlKqKYVoVsxvSi6UvtFJ3Wquv8NfpZCos=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=CtOucxA0ViYSIqQja11DgQWAwlfdUiGVwwCOCjFZtZlvmWDv8qGh3LIEWCKMfOsmB AgMPcjR1eyeeHWfjk4uYRorqfGccgvTq7nkSsnfQ1abgt5hOtpn2bMZqw7GHe9w3JO XjPeOs4OD8feLSkFgXOmNmQO58zOYvp1eIUXCl+o= Authentication-Results: smtp4p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Thu, 9 Aug 2018 19:01:35 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:02:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O Content-Type: multipart/mixed; boundary="UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091548.w79Fm8Ed018168@pdx.rh.CN85.dnsmgr.net> --UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 18:48, Rodney W. Grimes wrote: >>> This now means -q has 2 functions, silence most commands, >>> and silently ignore errors on delete. >>> >>> That is a poor implementation of syntax and options. >> >> I think it makes "delete" command to have the same behavior as describ= ed >> for commands in "-q" description: >=20 > Which is yet another bug in your commit, you did not update the > synopsis or the description of the -q flag to include your > change. Though oddly the synopsis does show delete -q, it > how ever does not show -q for any of the table commands. >=20 >> >> -q Be quiet when executing the add, nat, zero, resetlog or flush >> commands; (implies -f). > No mention of what it does on delete, does -q on delete imply -f? >=20 >> This is useful when updating rulesets by >> executing multiple ipfw commands in a script (e.g., >> ?sh?/etc/rc.firewall?), or by processing a file with many ipfw >> rules across a remote login session. It also stops a table add >> or delete from failing if the entry already exists or is not >> present. >=20 > That suggesting that -q is good for remote login session is > poor advice at best, you should redirect both standard and > error output to a file, depending on -q is just a loaded > gun waiting to go off. >=20 >> >> table add/delete commands had the same behavior, "nat" already noted i= n >> this list. What is the usage scenario do you use, where you need to fa= il >> on bad delete? >=20 > if [ ipfw delete ${1} ]; then > handle the missing rule > fi This is mostly unneeded operation, that we wanted to avoid. I.e. to be able run in bath mode: delete ${n} add ${n} ... > But more importantly you seem to be ignoring the aspect that > your overloading a "silent" option with a "ignore failure" > option. That is bad design. The description of the -q flag > is already 2x as long as it should be in a good design. I have a feeling you are watching each my commit and comment it :) I did not designed this behavior, at work we use another tool to work with rules and tables. I'm fine with reverting this change. Do you want to restore previous behavior? AFAIR, julian@ complains that ipfw(8) has some error states that should be removed. --=20 WBR, Andrey V. Elsukov --UJWIzXMrMDONHFGFBhkb5em8cEPA5Dl6b-- --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsZV8ACgkQAcXqBBDI oXrR+wf+LF3YioMLJfoFxsxnopo1/8AG5QMiKtSAHO+zj/t0Kj0gKcIrFWtYcoNL QVqjYXTqGVmipGFFqK0julCyynvlKRw2LalbkFGxxbVGF4iH7sv1dt+IDTuVABB5 nbvj0CzrV86RMz7tTOxbheLlsK85oNSU6TDngztpKnApYRRO4ROi3BqkMZDxQ0xg bquRWp/cTAu6w+t0EY0nRiK7gW6iG9HpvYnGbS7MxMcccXNDarsCLfqaPKNC0Ycq AXLZsYOAFRaBLBlTpAVcETQghwMyrWk3oPhQ8aYL3edKNxOkExzb3N/tJZBoO0t+ 1oHLLcK0IMUyagw0mTNtyShwZ5EMqA== =JjSe -----END PGP SIGNATURE----- --N69pLIyczzLTbSCZeYfQq2Uz5E9zmW55O-- From owner-svn-src-all@freebsd.org Thu Aug 9 16:03:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE29B106B367; Thu, 9 Aug 2018 16:03:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7827B6C1; Thu, 9 Aug 2018 16:03:10 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f50.google.com with SMTP id e14-v6so961392itf.1; Thu, 09 Aug 2018 09:03:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=hWWdtXzGX0dUWaMW8dG+2iXtboIqDLlGgPP1YE+y9aU=; b=LiVQwGhnVxyf20FiVpo/Ze3ZZqHMzkti0Lsh7HxEpL+otpfXXb20XbdIj1VTFTNke6 MocJOtsZahTHqDiNJtQTJH5VDEVoi9xIGB8GFiH9BdPimtdX70pgaIovahlBcUHOHpuz jy5BmVB4eb8tMYsl5oGfK7592BFUP5x3aPPX1dy284t4VT0y2FUYvVmbdJySyhrcN57d t1qv6tIRVKqgN51N7zXC3JHr5ZjovERB4vLJkwcxsKpF9uzV3htuQRNcRH3RAYCDP+Q8 j3F9VrvCXn5RRv/S2LY+2G2bMXH1UOTN7KCWGN1Apn/sBDxPorR9wP4GaQq40u7Tm4Ib hGdw== X-Gm-Message-State: AOUpUlHHggUcB/D+LhxxpYf+qCJilZf/E7TYuvBeki+fsuUK+JYSMyXO CF32pdgFAKTTwPo0TwNwhj+voyFM X-Google-Smtp-Source: AA+uWPwhzDTVkCvXAjxLO0peIFlntWHqBTbfmZBGGs3MoO1hlbfRdkO1lZG1J7wyth8ryApVuD7JQg== X-Received: by 2002:a02:bb04:: with SMTP id y4-v6mr2467003jan.5.1533830583395; Thu, 09 Aug 2018 09:03:03 -0700 (PDT) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id w20-v6sm2102313iob.24.2018.08.09.09.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 09:03:03 -0700 (PDT) Received: by mail-it0-f45.google.com with SMTP id s7-v6so930782itb.4; Thu, 09 Aug 2018 09:03:03 -0700 (PDT) X-Received: by 2002:a24:be8f:: with SMTP id i137-v6mr2518969itf.61.1533830582911; Thu, 09 Aug 2018 09:03:02 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:7e0a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 09:03:02 -0700 (PDT) In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Conrad Meyer Date: Thu, 9 Aug 2018 09:03:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:03:11 -0000 On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote: > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala > wrote: >> Use NULLs instead of casted zeroes, for consistency. > > It's probably helpful to note explicitly that these are not in arguments = to > varargs functions, I don't think it's helpful. > in which case the explicit cast is needed in order to produce a program t= hat > will have > correct behavior on all compliant compilers/systems. Here "compliant" means "minimally compliant to the C standard." Use of NULL in varargs is functionally correct on all FreeBSD systems. > (We do define NULL to > be a zero-with-cast, > but programs (Ones that care about portability to weird systems.) I don't think BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a strong = candidate for portability. > should not assume that NULL will be of pointer type -- "An > integer constant > expression with the value 0, or such an expression cast to type void *, i= s > called a null pointer constant".) Right. The problem only arises when both conditions are met: 1. The system's varargs representation is smaller than the pointer representation, and 2. The runtime headers do not defined NULL as a pointer-typed value. (3. The function being invoked is actually varargs?) Neither is true on FreeBSD and v7-style init is not a useful place to call for portability. All the best, Conrad From owner-svn-src-all@freebsd.org Thu Aug 9 16:19:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA462106B8D6; Thu, 9 Aug 2018 16:19:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 2E1477BFE8; Thu, 9 Aug 2018 16:19:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79GJ9Dk018294; Thu, 9 Aug 2018 09:19:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79GJ9lp018293; Thu, 9 Aug 2018 09:19:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 09:19:09 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:19:12 -0000 > On 09.08.2018 18:48, Rodney W. Grimes wrote: > >>> This now means -q has 2 functions, silence most commands, > >>> and silently ignore errors on delete. > >>> > >>> That is a poor implementation of syntax and options. > >> > >> I think it makes "delete" command to have the same behavior as described > >> for commands in "-q" description: > > > > Which is yet another bug in your commit, you did not update the > > synopsis or the description of the -q flag to include your > > change. Though oddly the synopsis does show delete -q, it > > how ever does not show -q for any of the table commands. > > > >> > >> -q Be quiet when executing the add, nat, zero, resetlog or flush > >> commands; (implies -f). > > No mention of what it does on delete, does -q on delete imply -f? > > > >> This is useful when updating rulesets by > >> executing multiple ipfw commands in a script (e.g., > >> ?sh?/etc/rc.firewall?), or by processing a file with many ipfw > >> rules across a remote login session. It also stops a table add > >> or delete from failing if the entry already exists or is not > >> present. > > > > That suggesting that -q is good for remote login session is > > poor advice at best, you should redirect both standard and > > error output to a file, depending on -q is just a loaded > > gun waiting to go off. > > > >> > >> table add/delete commands had the same behavior, "nat" already noted in > >> this list. What is the usage scenario do you use, where you need to fail > >> on bad delete? > > > > if [ ipfw delete ${1} ]; then > > handle the missing rule > > fi > > This is mostly unneeded operation, that we wanted to avoid. > I.e. to be able run in bath mode: > > delete ${n} > add ${n} ... That is one use case, but any shell script worth writting is worth writting to handle error conditions, and not being able to handle errors while being silent is a PITA. Though you didnt add to the already bad state of ipfw, this certainly did not do anything that I would consider improving that bad state. > > > But more importantly you seem to be ignoring the aspect that > > your overloading a "silent" option with a "ignore failure" > > option. That is bad design. The description of the -q flag > > is already 2x as long as it should be in a good design. > > I have a feeling you are watching each my commit and comment it :) I watch every commit by everyone, and comment when I see a reason to comment. I do not play any favors or dis favors in that respect. If you feel I am unjustly critizing you for some reason your mistaken. > I did not designed this behavior, at work we use another tool to work > with rules and tables. I'm fine with reverting this change. Do you want > to restore previous behavior? I am not asking for a revert, or at least a total revert, there is atleast a few issues here that do need some fixing. Like that fact that "ipfw delete 1" vs "ipfw -q delete 1" do the exact same thing, and per the man page (arguable interpretation) the second one should be silent: (This is an 11.1 system:) root@x230a:/etc # ipfw add 1 count ip from any to any 00001 count ip from any to any root@x230a:/etc # ipfw delete 1 root@x230a:/etc # ipfw add 1 count ip from any to any 00001 count ip from any to any root@x230a:/etc # ipfw -q delete 1 root@x230a:/etc # ipfw delete 1 ipfw: rule 1 not found root@x230a:/etc # ipfw -q delete 1 ipfw: rule 1 not found I would like to see the "do not return error" part of this change removed though. That is actually changing existing behavior. > AFAIR, julian@ complains that ipfw(8) has some error states that should > be removed. Yes, I recall that email. And yes there are probably error states that should be removed, but IMHO it is almost always a mistake to have the same option to a command do both silence and ignore error, that just leads to a lot of 1>/dev/null 2>&1 in shell scripts. Though one could also argue that there should be no silencing options to commands as all commands can be silenced by use of redirection :-) Typing ipfw -q FOO is only slightly shorter than typing ipfw FOO >&/dev/null (csh users). -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 16:35:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A949F106C057; Thu, 9 Aug 2018 16:35:18 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16CFF7CBC5; Thu, 9 Aug 2018 16:35:17 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 5E8014087900; Thu, 9 Aug 2018 19:35:15 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 0ZaAM3n9Ng-ZFG05sdw; Thu, 09 Aug 2018 19:35:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533832515; bh=VrtmfHs6NY2E+m3NLt3ZA6v1/ZHt8fdh1UtTjpwqsvg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=adTAA3xLyk5XJSQzeboyPuwKfcFeBpKdnRIer/KFNcvDuW6xEFAMxhXQaaVi3U1mb BVg72bqUsUoRrkbKgfqVfXmxceK69wd0mnB4ZgjiGYK8szaR4XLYAjttMpwL3g1a7U c/+4jW2f/MxtYo3PxwlM/PIki4Nk3cziSoVtMwao= Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XJ7HBwl7kI-ZEPiX9Ll; Thu, 09 Aug 2018 19:35:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533832514; bh=VrtmfHs6NY2E+m3NLt3ZA6v1/ZHt8fdh1UtTjpwqsvg=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=JN8Yooi5qfxjPKRFl1Dg23uVIEsRZ3jCMgOiKmGZAiltBBCkSoXiatuJHl3CAeDd/ wHUKXuAsIXUdg2pruyY7d2sF53I7YDIfL7gU+gjVS8p543Nj0vjMqfNH6OjXhU8hVn jgGe0U5TMFkFDeJB5obRAErWMHDr9oAhNYEWOsUQ= Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> Date: Thu, 9 Aug 2018 19:34:47 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:35:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc Content-Type: multipart/mixed; boundary="ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091619.w79GJ9lp018293@pdx.rh.CN85.dnsmgr.net> --ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 19:19, Rodney W. Grimes wrote: >>>> table add/delete commands had the same behavior, "nat" already noted= in >>>> this list. What is the usage scenario do you use, where you need to = fail >>>> on bad delete? >>> >>> if [ ipfw delete ${1} ]; then >>> handle the missing rule >>> fi >> >> This is mostly unneeded operation, that we wanted to avoid. >> I.e. to be able run in bath mode: >> >> delete ${n} >> add ${n} ... >=20 > That is one use case, but any shell script worth writting > is worth writting to handle error conditions, and not being > able to handle errors while being silent is a PITA. Ok, I still don't understand the usefulness of knowing the error code of delete command. But, I can propose the following solution: Index: ipfw2.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 --- ipfw2.c (revision 337541) +++ ipfw2.c (working copy) @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval !=3D EX_OK && co.do_quiet =3D=3D 0) + if (exitval !=3D EX_OK && co.do_force =3D=3D 0) exit(exitval); } With this patch -q will work as "quiet", -f will work as "force". So, you can still get error code in shell script, and I can run batched commands with -q -f: # ipfw -f delete 10000-11000 ; echo $? ipfw: no rules rules in 10000-11000 range 0 # ipfw -qf delete 10000-11000 ; echo $? 0 # ipfw -q delete 10000-11000 ; echo $? 69 Are you fine with this? --=20 WBR, Andrey V. Elsukov --ED60JM1c6I2rSV9k2NyRGw4OwEhDoinM2-- --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltsbScACgkQAcXqBBDI oXqBkwf+O4mBg6wo0VC19fS4aIfej3CwSJ7i82sxmb9kaf5jGTwX5qudvEwb8dz5 bHeFq4eTNw3feECgtAaPaFIi6eKZwuuK+oL0w/dvssDUIiak4RYMVG4slkI5HgiQ qTaZTD8otIJFexKW+AKd5SpB0IsGN2zAdAJXXBpVCuFlpi3Bkpu1yo3DRs5vRBGF S8gFM/rndmTQrzbPPug/MHt7QWhzTcapoxTmuCKJqjumhNqFdbYACLfyQdtNxhLG evFWC2UE7GiQbEYvXjmghJ15J9LI1ozyYDeGxQI6LG+yMgoHc6C5oZs1VK3Nk46Q mR57mCnBuX7HXWdeTpDBv/t0agOnHQ== =Ogot -----END PGP SIGNATURE----- --o4EFbxeT5wmGonS9hninS7cVFGEJvMOfc-- From owner-svn-src-all@freebsd.org Thu Aug 9 16:42:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20979106C3DE; Thu, 9 Aug 2018 16:42:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA87C7D0FB; Thu, 9 Aug 2018 16:42:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD24E1C083; Thu, 9 Aug 2018 16:42:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79GgDkU039903; Thu, 9 Aug 2018 16:42:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79GgDCC039902; Thu, 9 Aug 2018 16:42:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808091642.w79GgDCC039902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 9 Aug 2018 16:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337543 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 337543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:42:14 -0000 Author: jhb Date: Thu Aug 9 16:42:13 2018 New Revision: 337543 URL: https://svnweb.freebsd.org/changeset/base/337543 Log: Correct default path of kernel modules. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Aug 9 15:35:48 2018 (r337542) +++ head/share/mk/bsd.own.mk Thu Aug 9 16:42:13 2018 (r337543) @@ -47,7 +47,7 @@ # # # KMODDIR Base path for loadable kernel modules -# (see kld(4)). [/boot/module] +# (see kld(4)). [/boot/modules] # # KMODOWN Kernel and KLD owner. [${BINOWN}] # From owner-svn-src-all@freebsd.org Thu Aug 9 16:49:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40F16106C664; Thu, 9 Aug 2018 16:49:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 A85B67D555; Thu, 9 Aug 2018 16:49:52 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Gni0G018409; Thu, 9 Aug 2018 09:49:44 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79GniZf018408; Thu, 9 Aug 2018 09:49:44 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <640fc2e6-9332-2b59-c6ad-b0fd42dae7f2@yandex.ru> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 09:49:44 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:49:53 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > On 09.08.2018 19:19, Rodney W. Grimes wrote: > >>>> table add/delete commands had the same behavior, "nat" already noted in > >>>> this list. What is the usage scenario do you use, where you need to fail > >>>> on bad delete? > >>> > >>> if [ ipfw delete ${1} ]; then > >>> handle the missing rule > >>> fi > >> > >> This is mostly unneeded operation, that we wanted to avoid. > >> I.e. to be able run in bath mode: > >> > >> delete ${n} > >> add ${n} ... > > > > That is one use case, but any shell script worth writting > > is worth writting to handle error conditions, and not being > > able to handle errors while being silent is a PITA. > > Ok, I still don't understand the usefulness of knowing the error > code of delete command. But, I can propose the following solution: > Index: ipfw2.c > =================================================================== > --- ipfw2.c (revision 337541) > +++ ipfw2.c (working copy) > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > } > } > } > - if (exitval != EX_OK && co.do_quiet == 0) > + if (exitval != EX_OK && co.do_force == 0) > exit(exitval); > } > > > With this patch -q will work as "quiet", -f will work as "force". > So, you can still get error code in shell script, and I can run batched > commands with -q -f: > > # ipfw -f delete 10000-11000 ; echo $? > ipfw: no rules rules in 10000-11000 range > 0 > # ipfw -qf delete 10000-11000 ; echo $? > 0 > # ipfw -q delete 10000-11000 ; echo $? > 69 > > Are you fine with this? In spirit yes, in implementation No: The -f option is documented, and actually does, something different than what your change would implement. -f Do not ask for confirmation for commands that can cause problems if misused, i.e., flush. If there is no tty associated with the process, this is implied. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 16:56:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C33CF106C9F2 for ; Thu, 9 Aug 2018 16:56:17 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F4947DB8A for ; Thu, 9 Aug 2018 16:56:17 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 20249bc6-9bf5-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 20249bc6-9bf5-11e8-93fa-f3ebd9db2b94; Thu, 09 Aug 2018 16:56:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79GuEq8059156; Thu, 9 Aug 2018 10:56:14 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533833774.9860.116.camel@freebsd.org> Subject: Re: svn commit: r337536 - head/sbin/ipfw From: Ian Lepore To: rgrimes@freebsd.org, "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 10:56:14 -0600 In-Reply-To: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> References: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 16:56:17 -0000 On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > -- Start of PGP signed section. > [ Charset UTF-8 unsupported, converting... ] > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > already noted in > > > > > > this list. What is the usage scenario do you use, where you > > > > > > need to fail > > > > > > on bad delete? > > > > > if [ ipfw delete ${1} ]; then > > > > > handle the missing rule > > > > > fi > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > I.e. to be able run in bath mode: > > > > > > > > delete ${n} > > > > add ${n} ... > > > That is one use case, but any shell script worth writting > > > is worth writting to handle error conditions, and not being > > > able to handle errors while being silent is a PITA. > > Ok, I still don't understand the usefulness of knowing the error > > code of delete command. But, I can propose the following solution: > > Index: ipfw2.c > > =================================================================== > > --- ipfw2.c (revision 337541) > > +++ ipfw2.c (working copy) > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > >   } > >   } > >   } > > - if (exitval != EX_OK && co.do_quiet == 0) > > + if (exitval != EX_OK && co.do_force == 0) > >   exit(exitval); > >  } > > > > > > With this patch -q will work as "quiet", -f will work as "force". > > So, you can still get error code in shell script, and I can run > > batched > > commands with -q -f: > > > > # ipfw -f delete 10000-11000 ; echo $? > > ipfw: no rules rules in 10000-11000 range > > 0 > > # ipfw -qf delete 10000-11000 ; echo $? > > 0 > > # ipfw -q delete 10000-11000 ; echo $? > > 69 > > > > Are you fine with this? > In spirit yes, in implementation No: > > The -f option is documented, and actually does, something different > than what your change would implement. > >      -f      Do not ask for confirmation for commands that can cause > problems >              if misused, i.e., flush.  If there is no tty associated > with the >              process, this is implied. > > > > What he proposes is pretty much the exact behavior of rm -f, and should be intuitively obvious to anyone familiar with common unix commands. -- Ian From owner-svn-src-all@freebsd.org Thu Aug 9 17:01:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5881C106D023; Thu, 9 Aug 2018 17:01:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 C7EDF7E115; Thu, 9 Aug 2018 17:01:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79H1mew018528; Thu, 9 Aug 2018 10:01:48 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79H1mgh018527; Thu, 9 Aug 2018 10:01:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <1533833774.9860.116.camel@freebsd.org> To: Ian Lepore Date: Thu, 9 Aug 2018 10:01:48 -0700 (PDT) CC: rgrimes@freebsd.org, "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:01:51 -0000 > On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > > -- Start of PGP signed section. > > [ Charset UTF-8 unsupported, converting... ] > > > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > > already noted in > > > > > > > this list. What is the usage scenario do you use, where you > > > > > > > need to fail > > > > > > > on bad delete? > > > > > > if [ ipfw delete ${1} ]; then > > > > > > handle the missing rule > > > > > > fi > > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > > I.e. to be able run in bath mode: > > > > > > > > > > delete ${n} > > > > > add ${n} ... > > > > That is one use case, but any shell script worth writting > > > > is worth writting to handle error conditions, and not being > > > > able to handle errors while being silent is a PITA. > > > Ok, I still don't understand the usefulness of knowing the error > > > code of delete command. But, I can propose the following solution: > > > Index: ipfw2.c > > > =================================================================== > > > --- ipfw2.c (revision 337541) > > > +++ ipfw2.c (working copy) > > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > > > ? } > > > ? } > > > ? } > > > - if (exitval != EX_OK && co.do_quiet == 0) > > > + if (exitval != EX_OK && co.do_force == 0) > > > ? exit(exitval); > > > ?} > > > > > > > > > With this patch -q will work as "quiet", -f will work as "force". > > > So, you can still get error code in shell script, and I can run > > > batched > > > commands with -q -f: > > > > > > # ipfw -f delete 10000-11000 ; echo $? > > > ipfw: no rules rules in 10000-11000 range > > > 0 > > > # ipfw -qf delete 10000-11000 ; echo $? > > > 0 > > > # ipfw -q delete 10000-11000 ; echo $? > > > 69 > > > > > > Are you fine with this? > > In spirit yes, in implementation No: > > > > The -f option is documented, and actually does, something different > > than what your change would implement. > > > > ?????-f??????Do not ask for confirmation for commands that can cause > > problems > > ?????????????if misused, i.e., flush.??If there is no tty associated > > with the > > ?????????????process, this is implied. > > > > > > > > > > What he proposes is pretty much the exact behavior of rm -f, and should > be intuitively obvious to anyone familiar with common unix commands. And saddly that someone choose to use -f differently in ipfw, just because it is intuatively obvious it is in direct conflict with both the man page and the implemented code. This would just be another overloading of an option to do 2 different things on 2 different sub commands. Are you really advocating going down that slipperly slope? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 17:15:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CA56106D555 for ; Thu, 9 Aug 2018 17:15:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 073A67EA56 for ; Thu, 9 Aug 2018 17:15:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c349fc38-9bf7-11e8-aff6-0b9b8210da61 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id c349fc38-9bf7-11e8-aff6-0b9b8210da61; Thu, 09 Aug 2018 17:15:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79HF6tu059207; Thu, 9 Aug 2018 11:15:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533834906.9860.118.camel@freebsd.org> Subject: Re: svn commit: r337536 - head/sbin/ipfw From: Ian Lepore To: rgrimes@freebsd.org Cc: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 11:15:06 -0600 In-Reply-To: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> References: <201808091701.w79H1mgh018527@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:15:19 -0000 On Thu, 2018-08-09 at 10:01 -0700, Rodney W. Grimes wrote: > > > > On Thu, 2018-08-09 at 09:49 -0700, Rodney W. Grimes wrote: > > > > > > -- Start of PGP signed section. > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > > > > > On 09.08.2018 19:19, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > table add/delete commands had the same behavior, "nat" > > > > > > > > already noted in > > > > > > > > this list. What is the usage scenario do you use, where > > > > > > > > you > > > > > > > > need to fail > > > > > > > > on bad delete? > > > > > > > if [ ipfw delete ${1} ]; then > > > > > > > handle the missing rule > > > > > > > fi > > > > > > This is mostly unneeded operation, that we wanted to avoid. > > > > > > I.e. to be able run in bath mode: > > > > > > > > > > > > delete ${n} > > > > > > add ${n} ... > > > > > That is one use case, but any shell script worth writting > > > > > is worth writting to handle error conditions, and not being > > > > > able to handle errors while being silent is a PITA. > > > > Ok, I still don't understand the usefulness of knowing the > > > > error > > > > code of delete command. But, I can propose the following > > > > solution: > > > > Index: ipfw2.c > > > > =============================================================== > > > > ==== > > > > --- ipfw2.c (revision 337541) > > > > +++ ipfw2.c (working copy) > > > > @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) > > > > ? } > > > > ? } > > > > ? } > > > > - if (exitval != EX_OK && co.do_quiet == 0) > > > > + if (exitval != EX_OK && co.do_force == 0) > > > > ? exit(exitval); > > > > ?} > > > > > > > > > > > > With this patch -q will work as "quiet", -f will work as > > > > "force". > > > > So, you can still get error code in shell script, and I can run > > > > batched > > > > commands with -q -f: > > > > > > > > # ipfw -f delete 10000-11000 ; echo $? > > > > ipfw: no rules rules in 10000-11000 range > > > > 0 > > > > # ipfw -qf delete 10000-11000 ; echo $? > > > > 0 > > > > # ipfw -q delete 10000-11000 ; echo $? > > > > 69 > > > > > > > > Are you fine with this? > > > In spirit yes, in implementation No: > > > > > > The -f option is documented, and actually does, something > > > different > > > than what your change would implement. > > > > > > ?????-f??????Do not ask for confirmation for commands that can > > > cause > > > problems > > > ?????????????if misused, i.e., flush.??If there is no tty > > > associated > > > with the > > > ?????????????process, this is implied. > > > > > > > > > > > > > > What he proposes is pretty much the exact behavior of rm -f, and > > should > > be intuitively obvious to anyone familiar with common unix > > commands. > And saddly that someone choose to use -f differently in ipfw, just > because it is intuatively obvious it is in direct conflict with  > both the man page and the implemented code.  This would just be > another overloading of an option to do 2 different things on 2 > different sub commands.  Are you really advocating going down that > slipperly slope? > > Am I advocating for the ability to optionally silently not-fail on an attempt to delete something that doesn't exist, using the exact same syntax for that behavior as the standard rm(1) command uses? Why, yes.  Yes I am. -- Ian From owner-svn-src-all@freebsd.org Thu Aug 9 17:28:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD91106DA50; Thu, 9 Aug 2018 17:28:59 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward5j.cmail.yandex.net (forward5j.cmail.yandex.net [IPv6:2a02:6b8:0:1630::18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B707F661; Thu, 9 Aug 2018 17:28:58 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id 1D0EA21881; Thu, 9 Aug 2018 20:28:48 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QPloHc9SU4-SlXeDEL2; Thu, 09 Aug 2018 20:28:47 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533835727; bh=XWFk9lLyzJ8XuWCDVJy26zUKexfcGzsbHrAFsmm8fqQ=; h=From:To:Cc:In-Reply-To:References:Subject:Date:Message-Id; b=EKaXhb2COf4WiIewEmXfngKvgorsfWWaVRB4UfmE+JN3KLCexKKX1xCRdMzCYG9jU UbVqOqQ/wKLQIkT7Jt+PZiGLadJkAqiFZN4ES9L+MYUiY3gwM/2tC2+tF5R0F85STz uUAOrtp1XUt18owc2Q/AsGgx7keQV22kXxWuB2tY= Authentication-Results: mxback1o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by sas1-dc4267721c1f.qloud-c.yandex.net with HTTP; Thu, 09 Aug 2018 20:28:47 +0300 From: Andrey V. Elsukov To: "rgrimes@freebsd.org" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> References: <201808091649.w79GniZf018408@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 09 Aug 2018 20:28:47 +0300 Message-Id: <4860211533835727@sas1-dc4267721c1f.qloud-c.yandex.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:28:59 -0000 From owner-svn-src-all@freebsd.org Thu Aug 9 17:32:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E76F106DCBB; Thu, 9 Aug 2018 17:32:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 BFD5C7FAD6; Thu, 9 Aug 2018 17:32:12 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79HWAjN018695; Thu, 9 Aug 2018 10:32:10 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79HWAU1018694; Thu, 9 Aug 2018 10:32:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <4860211533835727@sas1-dc4267721c1f.qloud-c.yandex.net> To: "Andrey V. Elsukov" Date: Thu, 9 Aug 2018 10:32:10 -0700 (PDT) CC: "rgrimes@freebsd.org" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UNKNOWN-8BIT X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:32:13 -0000 [ text/html is unsupported, treating like TEXT/PLAIN ] Can you resend in none html format please? >

19:50, 9 =D0=B0=D0=B2=D0=B3=D1=83=D1=81=D1=82=D0=B0 2018 =D0= =B3., "Rodney W. Grimes" <freebsd@pdx.rh.cn85.dnsmgr.net>:

-- Start of PGP signed section.
[ Charset UTF-8 unsupported,= converting... ]

=C2=A0On 09.08.2018 19:19, R= odney W. Grimes wrote:
=C2=A0>>>> table add/delete command= s had the same behavior, "nat" already noted in
=C2=A0>>>>= this list. What is the usage scenario do you use, where you need to fail=C2=A0>>>> on bad delete?=
=C2=A0>>>
=C2=A0>>> if [ ipfw delete ${1} ]; t= hen
=C2=A0>>> handle the missing rule
=C2=A0>>>= ; fi
=C2=A0>>
=C2=A0>> This is mostly unneeded operat= ion, that we wanted to avoid.
=C2=A0>> I.e. to= be able run in bath mode:
=C2=A0>>
=C2=A0>> delete $= {n}
=C2=A0>> add ${n} ...
=C2=A0>
=C2=A0> That = is one use case, but any shell script worth writting
=C2=A0> is wor= th writting to handle error conditions, and not being=
=C2=A0> able to handle errors while being silent is a PITA.
<= br />=C2=A0Ok, I still don't understand the usefulness of knowing the error=
=C2=A0code of delete command. But, I can propose the following soluti= on:
=C2=A0Index: ipfw2.c
=C2=A0=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D
=C2=A0--- ipfw2.c (revision 337541)
= =C2=A0+++ ipfw2.c (working copy)
=C2=A0@@ -3314,7 +3314,7 @@ ipfw_dele= te(char *av[])
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0}
=C2=A0- if (exitval !=3D EX_OK && co.do_quiet =3D= =3D 0)
=C2=A0+ if (exitval !=3D EX_OK && co.do_force =3D=3D 0)=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0exit(exitval);
=C2=A0=C2=A0}

=C2=A0With this patch -q will work as "quiet", -f will work as "forc= e".
=C2=A0So, you can still get error code in shell script, and I can = run batched
=C2=A0commands with -q -f:

=C2=A0# ipfw -f dele= te 10000-11000 ; echo $?
=C2=A0= ipfw: no rules rules in 10000-11000 range
=C2=A00
= =C2=A0# ipfw -qf delete 10000-11000 ; echo $?
=C2=A00
=C2=A0# ipfw -q delete 10000-11000 ; echo $?
=C2=A069
=C2=A0Are you fine with this?

In spirit yes, in implementation No:

The -f option is docu= mented, and actually does, something different
than what your change w= ould implement.

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0-f Do not ask= for confirmation for commands that can cause pro= blems
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0if misused, i.e., flush. If there is no tty associated with= the
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0process, this is implied.

But this opt= ion means "force", with -f ipfw(8) will not ask any questions= and forcebly execute the command. The description in man page can be modif= ied to correctly describe the case.=C2=A0

=D0=9E=D1=82=D0=BF=D1= =80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE =D0=B8=D0=B7 =D0=BC=D0=BE=D0=B1=D0= =B8=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9 =D0=AF=D0=BD=D0=B4=D0=B5=D0=BA=D1=81.=D0= =9F=D0=BE=D1=87=D1=82=D1=8B: http://m.ya.ru/ymail --=20 Rod Grimes rgrimes@freebsd.= org From owner-svn-src-all@freebsd.org Thu Aug 9 17:42:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429D6106E14C; Thu, 9 Aug 2018 17:42:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB288021C; Thu, 9 Aug 2018 17:42:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D04C01CA33; Thu, 9 Aug 2018 17:42:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HgSWZ070877; Thu, 9 Aug 2018 17:42:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79HgSXq070874; Thu, 9 Aug 2018 17:42:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091742.w79HgSXq070874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337544 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 337544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:42:29 -0000 Author: kevans Date: Thu Aug 9 17:42:27 2018 New Revision: 337544 URL: https://svnweb.freebsd.org/changeset/base/337544 Log: msgbuf: Light detailing (const'ify and bool'itize) Modified: head/sys/kern/subr_msgbuf.c head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_msgbuf.c ============================================================================== --- head/sys/kern/subr_msgbuf.c Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/kern/subr_msgbuf.c Thu Aug 9 17:42:27 2018 (r337544) @@ -181,7 +181,7 @@ msgbuf_addchar(struct msgbuf *mbp, int c) * carriage returns down this path. So do we still need it? */ void -msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr) +msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr) { u_int seq; size_t len, prefix_len; Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:42:27 2018 (r337544) @@ -120,7 +120,7 @@ static void putchar(int ch, void *arg); static char *ksprintn(char *nbuf, uintmax_t num, int base, int *len, int upper); static void snprintf_func(int ch, void *arg); -static int msgbufmapped; /* Set when safe to use msgbuf */ +static bool msgbufmapped; /* Set when safe to use msgbuf */ int msgbuftrigger; struct msgbuf *msgbufp; @@ -1030,7 +1030,7 @@ msgbufinit(void *ptr, int size) msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); - msgbufmapped = 1; + msgbufmapped = true; oldp = msgbufp; } Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 16:42:13 2018 (r337543) +++ head/sys/sys/msgbuf.h Thu Aug 9 17:42:27 2018 (r337544) @@ -71,7 +71,7 @@ extern struct mtx msgbuf_lock; void msgbufinit(void *ptr, int size); void msgbuf_addchar(struct msgbuf *mbp, int c); -void msgbuf_addstr(struct msgbuf *mbp, int pri, char *str, int filter_cr); +void msgbuf_addstr(struct msgbuf *mbp, int pri, const char *str, int filter_cr); void msgbuf_clear(struct msgbuf *mbp); void msgbuf_copy(struct msgbuf *src, struct msgbuf *dst); int msgbuf_getbytes(struct msgbuf *mbp, char *buf, int buflen); From owner-svn-src-all@freebsd.org Thu Aug 9 17:47:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F22D6106E2AE; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F5C80449; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60AE61CA3B; Thu, 9 Aug 2018 17:47:48 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HlmUd071160; Thu, 9 Aug 2018 17:47:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79Hlldv071157; Thu, 9 Aug 2018 17:47:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091747.w79Hlldv071157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337545 - in head/sys: conf kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: conf kern sys X-SVN-Commit-Revision: 337545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:47:49 -0000 Author: kevans Date: Thu Aug 9 17:47:47 2018 New Revision: 337545 URL: https://svnweb.freebsd.org/changeset/base/337545 Log: BOOT_TAG: Make a config(5) option, expose as sysctl and loader tunable BOOT_TAG lived shortly in sys/msgbuf.h, but this wasn't necessarily great for changing it or removing it. Move it into subr_prf.c and add options for it to opt_printf.h. One can specify both the BOOT_TAG and BOOT_TAG_SZ (really, size of the buffer that holds the BOOT_TAG). We expose it as kern.boot_tag and also add a loader tunable by the same name that we'll fetch upon initialization of the msgbuf. This allows for flexibility and also ensures that there's a consistent way to figure out the boot tag of the running kernel, rather than relying on headers to be in-sync. Prodded super-super-lightly by: imp Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/subr_prf.c head/sys/sys/msgbuf.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/conf/NOTES Thu Aug 9 17:47:47 2018 (r337545) @@ -145,6 +145,16 @@ options INCLUDE_CONFIG_FILE # Include this file i options BOOTVERBOSE=1 options BOOTHOWTO=RB_MULTIPLE +# +# Compile-time defaults for dmesg boot tagging +# +# Default boot tag; may use 'kern.boot_tag' loader tunable to override. The +# current boot's tag is also exposed via the 'kern.boot_tag' sysctl. +options BOOT_TAG=\"---<>---\" +# Maximum boot tag size the kernel's static buffer should accomodate. Maximum +# size for both BOOT_TAG and the assocated tunable. +options BOOT_TAG_SZ=32 + options GEOM_BDE # Disk encryption. options GEOM_BSD # BSD disklabels (obsolete, gone in 12) options GEOM_CACHE # Disk cache. Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/conf/options Thu Aug 9 17:47:47 2018 (r337545) @@ -811,6 +811,8 @@ TERMINAL_NORM_ATTR opt_teken.h # options for printf PRINTF_BUFR_SIZE opt_printf.h +BOOT_TAG opt_printf.h +BOOT_TAG_SZ opt_printf.h # kbd options KBD_DISABLE_KEYMAP_LOAD opt_kbd.h Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:47:47 2018 (r337545) @@ -124,6 +124,18 @@ static bool msgbufmapped; /* Set when safe to use msg int msgbuftrigger; struct msgbuf *msgbufp; +#ifndef BOOT_TAG_SZ +#define BOOT_TAG_SZ 32 +#endif +#ifndef BOOT_TAG +/* Tag used to mark the start of a boot in dmesg */ +#define BOOT_TAG "---<>---" +#endif + +static char current_boot_tag[BOOT_TAG_SZ + 1] = BOOT_TAG; +SYSCTL_STRING(_kern, OID_AUTO, boot_tag, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + current_boot_tag, 0, "Tag added to dmesg at start of boot"); + static int log_console_output = 1; SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RWTUN, &log_console_output, 0, "Duplicate console output to the syslog"); @@ -1025,9 +1037,13 @@ msgbufinit(void *ptr, int size) size -= sizeof(*msgbufp); cp = (char *)ptr; + /* Attempt to fetch kern.boot_tag tunable on first mapping */ + if (!msgbufmapped) + TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, + BOOT_TAG_SZ + 1); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); + msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Aug 9 17:42:27 2018 (r337544) +++ head/sys/sys/msgbuf.h Thu Aug 9 17:47:47 2018 (r337545) @@ -60,9 +60,6 @@ struct msgbuf { /* Subtract sequence numbers. Note that only positive values result. */ #define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2))) -/* Tag used to mark the start of a boot in dmesg */ -#define BOOT_TAG "---<>---" - #ifdef _KERNEL extern int msgbufsize; extern int msgbuftrigger; From owner-svn-src-all@freebsd.org Thu Aug 9 17:53:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA4A1106E621; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60640809D6; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 412EB1CBCB; Thu, 9 Aug 2018 17:53:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79HrJja076269; Thu, 9 Aug 2018 17:53:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79HrJsY076268; Thu, 9 Aug 2018 17:53:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091753.w79HrJsY076268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 17:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337546 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 17:53:19 -0000 Author: kevans Date: Thu Aug 9 17:53:18 2018 New Revision: 337546 URL: https://svnweb.freebsd.org/changeset/base/337546 Log: subr_prf: Use "sizeof current_boot_tag" instead Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 17:47:47 2018 (r337545) +++ head/sys/kern/subr_prf.c Thu Aug 9 17:53:18 2018 (r337546) @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, - BOOT_TAG_SZ + 1); + sizeof current_boot_tag); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); From owner-svn-src-all@freebsd.org Thu Aug 9 18:09:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4657A106EB33 for ; Thu, 9 Aug 2018 18:09:45 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC4FB8114E for ; Thu, 9 Aug 2018 18:09:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 62ed1730-9bff-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 62ed1730-9bff-11e8-93fa-f3ebd9db2b94; Thu, 09 Aug 2018 18:09:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w79I9fbf059308; Thu, 9 Aug 2018 12:09:41 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533838181.9860.119.camel@freebsd.org> Subject: Re: svn commit: r337546 - head/sys/kern From: Ian Lepore To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 09 Aug 2018 12:09:41 -0600 In-Reply-To: <201808091753.w79HrJsY076268@repo.freebsd.org> References: <201808091753.w79HrJsY076268@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 18:09:45 -0000 On Thu, 2018-08-09 at 17:53 +0000, Kyle Evans wrote: > Author: kevans > Date: Thu Aug  9 17:53:18 2018 > New Revision: 337546 > URL: https://svnweb.freebsd.org/changeset/base/337546 > > Log: >   subr_prf: Use "sizeof current_boot_tag" instead > > Modified: >   head/sys/kern/subr_prf.c > > Modified: head/sys/kern/subr_prf.c > ===================================================================== > ========= > --- head/sys/kern/subr_prf.c Thu Aug  9 17:47:47 2018 ( > r337545) > +++ head/sys/kern/subr_prf.c Thu Aug  9 17:53:18 2018 ( > r337546) > @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) >   /* Attempt to fetch kern.boot_tag tunable on first mapping > */ >   if (!msgbufmapped) >   TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, > -     BOOT_TAG_SZ + 1); > +     sizeof current_boot_tag); Style(9) mandates parens with sizeof. -- Ian >   msgbufp = (struct msgbuf *)(cp + size); >   msgbuf_reinit(msgbufp, cp, size); >   msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); > From owner-svn-src-all@freebsd.org Thu Aug 9 18:25:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D3FA106F4BC; Thu, 9 Aug 2018 18:25:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D553281D38; Thu, 9 Aug 2018 18:25:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 962F11D0AC; Thu, 9 Aug 2018 18:25:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79IPnED091528; Thu, 9 Aug 2018 18:25:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79IPnLo091527; Thu, 9 Aug 2018 18:25:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808091825.w79IPnLo091527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 9 Aug 2018 18:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337547 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 337547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 18:25:50 -0000 Author: markj Date: Thu Aug 9 18:25:49 2018 New Revision: 337547 URL: https://svnweb.freebsd.org/changeset/base/337547 Log: Account for the lowmem handlers in the inactive queue scan target. Before r329882 the target would be computed after lowmem handlers run and free pages. On some systems a significant amount of page reclamation happens this way. However, with r329882 the target is computed first, which can lead to unnecessary reclamation from the page cache, and this in turn may result in excessive swapping. Instead, adjust the target after running lowmem handlers. Don't invoke the lowmem handlers before the PID controller, though, since that would hide the true rate of page allocation. Reviewed by: alc, kib (previous version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16606 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Aug 9 17:53:18 2018 (r337546) +++ head/sys/vm/vm_pageout.c Thu Aug 9 18:25:49 2018 (r337547) @@ -152,7 +152,6 @@ static int vm_pageout_oom_seq = 12; static int vm_pageout_update_period; static int disable_swap_pageouts; static int lowmem_period = 10; -static time_t lowmem_uptime; static int swapdev_enabled; static int vm_panic_on_oom = 0; @@ -1856,12 +1855,17 @@ vm_pageout_oom(int shortage) } } -static void -vm_pageout_lowmem(struct vm_domain *vmd) +static bool +vm_pageout_lowmem(void) { + static int lowmem_ticks = 0; + int last; - if (vmd == VM_DOMAIN(0) && - time_uptime - lowmem_uptime >= lowmem_period) { + last = atomic_load_int(&lowmem_ticks); + while ((u_int)(ticks - last) / hz >= lowmem_period) { + if (atomic_fcmpset_int(&lowmem_ticks, &last, ticks) == 0) + continue; + /* * Decrease registered cache sizes. */ @@ -1873,14 +1877,16 @@ vm_pageout_lowmem(struct vm_domain *vmd) * drained above. */ uma_reclaim(); - lowmem_uptime = time_uptime; + return (true); } + return (false); } static void vm_pageout_worker(void *arg) { struct vm_domain *vmd; + u_int ofree; int addl_shortage, domain, shortage; bool target_met; @@ -1939,11 +1945,16 @@ vm_pageout_worker(void *arg) /* * Use the controller to calculate how many pages to free in - * this interval, and scan the inactive queue. + * this interval, and scan the inactive queue. If the lowmem + * handlers appear to have freed up some pages, subtract the + * difference from the inactive queue scan target. */ shortage = pidctrl_daemon(&vmd->vmd_pid, vmd->vmd_free_count); if (shortage > 0) { - vm_pageout_lowmem(vmd); + ofree = vmd->vmd_free_count; + if (vm_pageout_lowmem() && vmd->vmd_free_count > ofree) + shortage -= min(vmd->vmd_free_count - ofree, + (u_int)shortage); target_met = vm_pageout_scan_inactive(vmd, shortage, &addl_shortage); } else From owner-svn-src-all@freebsd.org Thu Aug 9 19:09:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 598EE10704FB; Thu, 9 Aug 2018 19:09:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4728348A; Thu, 9 Aug 2018 19:09:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E12721D759; Thu, 9 Aug 2018 19:09:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79J96al012159; Thu, 9 Aug 2018 19:09:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79J96Tt012158; Thu, 9 Aug 2018 19:09:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808091909.w79J96Tt012158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 19:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337548 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 19:09:07 -0000 Author: kevans Date: Thu Aug 9 19:09:06 2018 New Revision: 337548 URL: https://svnweb.freebsd.org/changeset/base/337548 Log: subr_prf: style(9) the sizeof Reported by: jkim, ian Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Aug 9 18:25:49 2018 (r337547) +++ head/sys/kern/subr_prf.c Thu Aug 9 19:09:06 2018 (r337548) @@ -1040,7 +1040,7 @@ msgbufinit(void *ptr, int size) /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, - sizeof current_boot_tag); + sizeof(current_boot_tag)); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); From owner-svn-src-all@freebsd.org Thu Aug 9 20:29:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255571072A26; Thu, 9 Aug 2018 20:29:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C95CF86386; Thu, 9 Aug 2018 20:29:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A45ED1E4ED; Thu, 9 Aug 2018 20:29:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79KTigP052729; Thu, 9 Aug 2018 20:29:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79KTiCZ052728; Thu, 9 Aug 2018 20:29:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808092029.w79KTiCZ052728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 9 Aug 2018 20:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337549 - head/lib/libnv X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libnv X-SVN-Commit-Revision: 337549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 20:29:45 -0000 Author: kevans Date: Thu Aug 9 20:29:44 2018 New Revision: 337549 URL: https://svnweb.freebsd.org/changeset/base/337549 Log: libnv: Remove -I${SRCTOP}/sys This should have been done as part of r336019 -- including ${SRCTOP}/sys is not a good business model for something that's build in legacy/bootstrap stages. Beyond that, libnv seems to build quite alright as legacy, part of buildworld, and standalone without. Axe it. Reported by: truckman (head building stable/11) Tested by: Shawn Webb (HardenedBSD) MFC after: 3 days Modified: head/lib/libnv/Makefile Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Thu Aug 9 19:09:06 2018 (r337548) +++ head/lib/libnv/Makefile Thu Aug 9 20:29:44 2018 (r337549) @@ -9,7 +9,7 @@ LIB= nv SHLIB_MAJOR= 0 .PATH: ${SRCTOP}/sys/contrib/libnv ${SRCTOP}/sys/sys -CFLAGS+=-I${SRCTOP}/sys -I${.CURDIR} +CFLAGS+=-I${.CURDIR} SRCS= cnvlist.c SRCS+= dnvlist.c From owner-svn-src-all@freebsd.org Thu Aug 9 20:33:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 826C31072E44; Thu, 9 Aug 2018 20:33:23 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA63C868AB; Thu, 9 Aug 2018 20:33:22 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 9B30B44BBE; Thu, 9 Aug 2018 23:33:19 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id vFLJP9f8ry-XJ4GOmCv; Thu, 09 Aug 2018 23:33:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533846799; bh=LVWPDXUws4o92jvEXcd8T/5eRhm5zK3iejh2PP6KaNQ=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mCivni295kB004tsnO1jYwRx6BZXtKZgVyypwqp6PVJctl9H2KPsvMErBDFEyEk1D ygw/2qfxJsUUJNQ1Bovfgz0AuvsdiEJxsHF2Ii/HUN/6z0/S3wOyabnJsQP3VF0C+l gslntF7qPxYtBWb9glUtI7ZVX17gm06wp73oZCX4= Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id PxIMPL14IQ-XI5mIdVC; Thu, 09 Aug 2018 23:33:19 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1533846799; bh=LVWPDXUws4o92jvEXcd8T/5eRhm5zK3iejh2PP6KaNQ=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=mCivni295kB004tsnO1jYwRx6BZXtKZgVyypwqp6PVJctl9H2KPsvMErBDFEyEk1D ygw/2qfxJsUUJNQ1Bovfgz0AuvsdiEJxsHF2Ii/HUN/6z0/S3wOyabnJsQP3VF0C+l gslntF7qPxYtBWb9glUtI7ZVX17gm06wp73oZCX4= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: svn commit: r337536 - head/sbin/ipfw To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= xsBNBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAHNIkFuZHJleSBWLiBFbHN1a292IDxhZUBmcmVlYnNkLm9yZz7CwHsEEwECACUCGwMGCwkI BwMCBhUIAgkKCwQWAgMBAh4BAheABQJMB/ruAhkBAAoJEAHF6gQQyKF6MLwH/3Ri/TZl9uo0 SepYWXOnxL6EaDVXDA+dLb1eLKC4PRBBjX29ttQ0KaWapiE6y5/AfzOPmRtHLrHYHjd/aiHX GMLHcYRXD+5GvdkK8iMALrZ28X0JXyuuZa8rAxWIWmCbYHNSBy2unqWgTI04Erodk90IALgM 9JeHN9sFqTM6zalrMnTzlcmel4kcjT3lyYw3vOKgoYLtsLhKZSbJoVVVlvRlGBpHFJI5AoYJ SyfXoN0rcX6k9X7Isp2K50YjqxV4v78xluh1puhwZyC0p8IShPrmrp9Oy9JkMX90o6UAXdGU KfdExJuGJfUZOFBTtNIMNIAKfMTjhpRhxONIr0emxxDOwE0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAcLAXwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <09dc8efe-7e68-1da6-6709-01b2af037f1e@yandex.ru> Date: Thu, 9 Aug 2018 23:32:49 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 20:33:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ Content-Type: multipart/mixed; boundary="HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97"; protected-headers="v1" From: "Andrey V. Elsukov" To: rgrimes@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <09dc8efe-7e68-1da6-6709-01b2af037f1e@yandex.ru> Subject: Re: svn commit: r337536 - head/sbin/ipfw References: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808091732.w79HWAU1018694@pdx.rh.CN85.dnsmgr.net> --HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.08.2018 20:32, Rodney W. Grimes wrote: > [ text/html is unsupported, treating like TEXT/PLAIN ] > Can you resend in none html format please? Yes, sorry, I was AFK and tried to send via mobile phone.. -f options means "force", with -f ipfw(8) will not ask any questions and forcibly execute the command. The description in man page can be modified to correctly describe the case with "delete" command. --=20 WBR, Andrey V. Elsukov --HIo5alIPVkDla2gj8TSXkKN1jLlM9tR97-- --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAltspPEACgkQAcXqBBDI oXp7wAgAmrNBiEyFolTufh6Oj0Q5NQSSftzdOpqtbuiJDjrdXFPaKrkhoBKGIpNt YiTmOMc39UmBIys1eekXXJF2gVpYEBBAGJobNE0JvLABQGAQ7Kb2u6U0diurSZUN Z9sZge5cYEDp1H47f5CeuvW6tvq86p5DnqYlE8rLUGAEBTDBFst5t77Y3hqTeCjI edh84cl72MbyMaOvpuuWjE8ff/tat+GpOsSoCKzKLzh8SKgPYjlAY4DTOXIGkJ18 Nnk2Z312TJlAO71zW2WexvLSDvIo60RU31nWtafl4IawM3C4SX6WRpxNgDQbC7Aw hTsQxg+JDZmGT95lE594u/LQA1+w2A== =j90H -----END PGP SIGNATURE----- --UrhdzkMYzfkAKfR2WSBBshxytXA9HKcGZ-- From owner-svn-src-all@freebsd.org Thu Aug 9 20:43:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C9410732DF; Thu, 9 Aug 2018 20:43:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA5986F3F; Thu, 9 Aug 2018 20:43:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id DE531289A8; Thu, 9 Aug 2018 20:43:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f176.google.com with SMTP id w16-v6so5490715ljh.12; Thu, 09 Aug 2018 13:43:26 -0700 (PDT) X-Gm-Message-State: AOUpUlEfZc9445pcTzYZU1VTYgeWGt3hsE6cWg5DIXMIZbMI2GU1+eUd rmf28AA9MAJgWc0IXLmrlZbXKTUqpdn6k2y6yJE= X-Google-Smtp-Source: AA+uWPwbT8mxZYUddJ2fLwrX5AARelQ6FNCr0suHovlXrK9clm2D92SXIrkL7ChbsMWd/X79VSo5keMr3tTOnVpuHrg= X-Received: by 2002:a2e:498:: with SMTP id a24-v6mr2786486ljf.27.1533847405456; Thu, 09 Aug 2018 13:43:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 13:43:04 -0700 (PDT) In-Reply-To: <201808092029.w79KTiCZ052728@repo.freebsd.org> References: <201808092029.w79KTiCZ052728@repo.freebsd.org> From: Kyle Evans Date: Thu, 9 Aug 2018 15:43:04 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337549 - head/lib/libnv To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 20:43:27 -0000 On Thu, Aug 9, 2018 at 3:29 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Aug 9 20:29:44 2018 > New Revision: 337549 > URL: https://svnweb.freebsd.org/changeset/base/337549 > > Log: > libnv: Remove -I${SRCTOP}/sys > > This should have been done as part of r336019 -- including ${SRCTOP}/sys is > not a good business model for something that's build in legacy/bootstrap > stages. > > Beyond that, libnv seems to build quite alright as legacy, part of > buildworld, and standalone without. Axe it. > > Reported by: truckman (head building stable/11) > Tested by: Shawn Webb (HardenedBSD) > MFC after: 3 days > > Modified: > head/lib/libnv/Makefile > I say "3 days," but this actually fixes head building stable/11 and thus will probably get done later today or tomorrow since it's a trivial patch. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Aug 9 20:48:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F03791073526; Thu, 9 Aug 2018 20:48:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.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 6442087207; Thu, 9 Aug 2018 20:48:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w79Km3DP019445; Thu, 9 Aug 2018 13:48:04 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w79Km3WI019444; Thu, 9 Aug 2018 13:48:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201808092048.w79Km3WI019444@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r337549 - head/lib/libnv In-Reply-To: To: Kyle Evans Date: Thu, 9 Aug 2018 13:48:03 -0700 (PDT) CC: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 20:48:08 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Aug 9, 2018 at 3:29 PM, Kyle Evans wrote: > > Author: kevans > > Date: Thu Aug 9 20:29:44 2018 > > New Revision: 337549 > > URL: https://svnweb.freebsd.org/changeset/base/337549 > > > > Log: > > libnv: Remove -I${SRCTOP}/sys > > > > This should have been done as part of r336019 -- including ${SRCTOP}/sys is > > not a good business model for something that's build in legacy/bootstrap > > stages. > > > > Beyond that, libnv seems to build quite alright as legacy, part of > > buildworld, and standalone without. Axe it. > > > > Reported by: truckman (head building stable/11) > > Tested by: Shawn Webb (HardenedBSD) > > MFC after: 3 days > > > > Modified: > > head/lib/libnv/Makefile > > > > I say "3 days," but this actually fixes head building stable/11 and > thus will probably get done later today or tomorrow since it's a > trivial patch. Please send a request for immediate MFC to re@ Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Aug 9 21:07:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EE01073AF6; Thu, 9 Aug 2018 21:07:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C4588855B; Thu, 9 Aug 2018 21:07:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D71A1EB53; Thu, 9 Aug 2018 21:07:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79L7WjR072920; Thu, 9 Aug 2018 21:07:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79L7Wtq072918; Thu, 9 Aug 2018 21:07:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808092107.w79L7Wtq072918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 21:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337550 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 337550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:07:33 -0000 Author: np Date: Thu Aug 9 21:07:32 2018 New Revision: 337550 URL: https://svnweb.freebsd.org/changeset/base/337550 Log: cxgbe(4): Set fl_pktshift to 0 by default. Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/t4_sge.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Thu Aug 9 20:29:44 2018 (r337549) +++ head/share/man/man4/cxgbe.4 Thu Aug 9 21:07:32 2018 (r337550) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd Aug 9, 2018 .Dt CXGBE 4 .Os .Sh NAME @@ -262,7 +262,8 @@ The default is 1. .It Va hw.cxgbe.fl_pktshift Number of padding bytes inserted before the beginning of an Ethernet frame in the receive buffer. -The default value of 2 ensures that the Ethernet payload (usually the IP header) +The default value is 0. +A value of of 2 would ensure that the Ethernet payload (usually the IP header) is at a 4 byte aligned address. 0-7 are all valid values. .It Va hw.cxgbe.fl_pad Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 20:29:44 2018 (r337549) +++ head/sys/dev/cxgbe/t4_sge.c Thu Aug 9 21:07:32 2018 (r337550) @@ -86,7 +86,7 @@ __FBSDID("$FreeBSD$"); * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. */ -static int fl_pktshift = 2; +static int fl_pktshift = 0; TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); /* @@ -496,8 +496,8 @@ t4_sge_modload(void) if (fl_pktshift < 0 || fl_pktshift > 7) { printf("Invalid hw.cxgbe.fl_pktshift value (%d)," - " using 2 instead.\n", fl_pktshift); - fl_pktshift = 2; + " using 0 instead.\n", fl_pktshift); + fl_pktshift = 0; } if (spg_len != 64 && spg_len != 128) { From owner-svn-src-all@freebsd.org Thu Aug 9 21:20:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51B461073DAE; Thu, 9 Aug 2018 21:20:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 052DA88AD7; Thu, 9 Aug 2018 21:20:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9E841ED25; Thu, 9 Aug 2018 21:20:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LK7mC078040; Thu, 9 Aug 2018 21:20:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LK7Kj078039; Thu, 9 Aug 2018 21:20:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808092120.w79LK7Kj078039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 9 Aug 2018 21:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337551 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 337551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:20:08 -0000 Author: cem Date: Thu Aug 9 21:20:07 2018 New Revision: 337551 URL: https://svnweb.freebsd.org/changeset/base/337551 Log: cam_ccb.h: Remove redundant declarations of static inline functions No functional change. They're unnecessarily confusing for tools like grep or ctags. Sponsored by: Dell EMC Isilon Modified: head/sys/cam/cam_ccb.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Aug 9 21:07:32 2018 (r337550) +++ head/sys/cam/cam_ccb.h Thu Aug 9 21:20:07 2018 (r337551) @@ -1349,48 +1349,6 @@ cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retri u_int32_t flags, u_int8_t tag_action, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int8_t cdb_len, - u_int32_t timeout); - -static __inline void -cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout); - -static __inline void -cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, u_int tag_id, - u_int init_id, u_int scsi_status, u_int8_t *data_ptr, - u_int32_t dxfer_len, u_int32_t timeout); - -static __inline void -cam_fill_ataio(struct ccb_ataio *ataio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout); - -static __inline void -cam_fill_smpio(struct ccb_smpio *smpio, uint32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, - uint8_t *smp_request, int smp_request_len, - uint8_t *smp_response, int smp_response_len, - uint32_t timeout); - -static __inline void -cam_fill_mmcio(struct ccb_mmcio *mmcio, uint32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, - uint32_t mmc_opcode, uint32_t mmc_arg, uint32_t mmc_flags, - struct mmc_data *mmc_d, - uint32_t timeout); - -static __inline void -cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t tag_action, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int8_t sense_len, u_int8_t cdb_len, u_int32_t timeout) { csio->ccb_h.func_code = XPT_SCSI_IO; From owner-svn-src-all@freebsd.org Thu Aug 9 21:28:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B9C10740E4; Thu, 9 Aug 2018 21:28:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9DBE88FD2; Thu, 9 Aug 2018 21:28:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB0D41EECB; Thu, 9 Aug 2018 21:28:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LSXvb083085; Thu, 9 Aug 2018 21:28:33 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LSVPC083077; Thu, 9 Aug 2018 21:28:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808092128.w79LSVPC083077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 9 Aug 2018 21:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337552 - in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 337552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:28:34 -0000 Author: dim Date: Thu Aug 9 21:28:31 2018 New Revision: 337552 URL: https://svnweb.freebsd.org/changeset/base/337552 Log: Add optional LLVM BPF target support BPF (eBPF) is an independent instruction set architecture which is introduced in Linux a few years ago. Originally, eBPF execute environment was only inside Linux kernel. However, recent years there are some user space implementation (https://github.com/iovisor/ubpf, https://doc.dpdk.org/guides/prog_guide/bpf_lib.html) and kernel space implementation for FreeBSD is going on (https://github.com/YutaroHayakawa/generic-ebpf). The BPF target support can be enabled using WITH_LLVM_TARGET_BPF, as it is not built by default. Submitted by: Yutaro Hayakawa Reviewed by: dim, bdrewery Differential Revision: https://reviews.freebsd.org/D16033 Added: head/tools/build/options/WITH_LLVM_TARGET_BPF (contents, props changed) Modified: head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/clang/libllvm/Makefile head/lib/clang/llvm.build.mk head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmParsers.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_ASM_PARSER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PARSER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_ASM_PARSER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PARSER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmPrinters.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/AsmPrinters.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_ASM_PRINTER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PRINTER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_ASM_PRINTER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PRINTER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- head/lib/clang/include/llvm/Config/Disassemblers.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/Disassemblers.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_DISASSEMBLER(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_DISASSEMBLER(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_DISASSEMBLER(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_DISASSEMBLER(Mips) #endif Modified: head/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- head/lib/clang/include/llvm/Config/Targets.def Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/include/llvm/Config/Targets.def Thu Aug 9 21:28:31 2018 (r337552) @@ -10,6 +10,9 @@ LLVM_TARGET(AArch64) #ifdef LLVM_TARGET_ENABLE_ARM LLVM_TARGET(ARM) #endif +#ifdef LLVM_TARGET_ENABLE_BPF +LLVM_TARGET(BPF) +#endif #ifdef LLVM_TARGET_ENABLE_MIPS LLVM_TARGET(Mips) #endif Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/libllvm/Makefile Thu Aug 9 21:28:31 2018 (r337552) @@ -9,14 +9,15 @@ INTERNALLIB= CFLAGS+= -I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ - ${MK_LLVM_TARGET_MIPS} == "no" && ${MK_LLVM_TARGET_POWERPC} == "no" && \ - ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" + ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ + ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ + ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ - MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_MIPS, MK_LLVM_TARGET_POWERPC,\ - MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -905,6 +906,25 @@ SRCS_MIN+= Target/ARM/Thumb2SizeReduction.cpp SRCS_MIN+= Target/ARM/ThumbRegisterInfo.cpp SRCS_MIN+= Target/ARM/Utils/ARMBaseInfo.cpp .endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_BPF} != "no" +SRCS_MIN+= Target/BPF/AsmParser/BPFAsmParser.cpp +SRCS_MIN+= Target/BPF/BPFAsmPrinter.cpp +SRCS_MIN+= Target/BPF/BPFFrameLowering.cpp +SRCS_MIN+= Target/BPF/BPFISelDAGToDAG.cpp +SRCS_MIN+= Target/BPF/BPFISelLowering.cpp +SRCS_MIN+= Target/BPF/BPFInstrInfo.cpp +SRCS_MIN+= Target/BPF/BPFMCInstLower.cpp +SRCS_MIN+= Target/BPF/BPFRegisterInfo.cpp +SRCS_MIN+= Target/BPF/BPFSubtarget.cpp +SRCS_MIN+= Target/BPF/BPFTargetMachine.cpp +SRCS_MIN+= Target/BPF/Disassembler/BPFDisassembler.cpp +SRCS_MIN+= Target/BPF/InstPrinter/BPFInstPrinter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFAsmBackend.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp +SRCS_MIN+= Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp +SRCS_MIN+= Target/BPF/TargetInfo/BPFTargetInfo.cpp +.endif # MK_LLVM_TARGET_BPF .if ${MK_LLVM_TARGET_MIPS} != "no" SRCS_MIN+= Target/Mips/AsmParser/MipsAsmParser.cpp SRCS_XDW+= Target/Mips/Disassembler/MipsDisassembler.cpp @@ -1371,7 +1391,7 @@ beforebuild: # Note: some rules are superfluous, not every combination is valid. .for arch in \ - AArch64/AArch64 ARM/ARM Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 + AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 . for hdr in \ AsmMatcher/-gen-asm-matcher \ AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ @@ -1431,6 +1451,17 @@ TGHDRS+= ARMGenRegisterInfo.inc TGHDRS+= ARMGenSubtargetInfo.inc TGHDRS+= ARMGenSystemRegister.inc .endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_BPF} != "no" +TGHDRS+= BPFGenAsmMatcher.inc +TGHDRS+= BPFGenAsmWriter.inc +TGHDRS+= BPFGenCallingConv.inc +TGHDRS+= BPFGenDAGISel.inc +TGHDRS+= BPFGenDisassemblerTables.inc +TGHDRS+= BPFGenInstrInfo.inc +TGHDRS+= BPFGenMCCodeEmitter.inc +TGHDRS+= BPFGenRegisterInfo.inc +TGHDRS+= BPFGenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_BPF .if ${MK_LLVM_TARGET_MIPS} != "no" TGHDRS+= MipsGenAsmMatcher.inc TGHDRS+= MipsGenAsmWriter.inc Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Thu Aug 9 21:20:07 2018 (r337551) +++ head/lib/clang/llvm.build.mk Thu Aug 9 21:28:31 2018 (r337552) @@ -54,6 +54,9 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_ARM LLVM_NATIVE_ARCH= ARM . endif .endif +.if ${MK_LLVM_TARGET_BPF} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_BPF +.endif .if ${MK_LLVM_TARGET_MIPS} != "no" CFLAGS+= -DLLVM_TARGET_ENABLE_MIPS . if ${MACHINE_CPUARCH} == "mips" Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Aug 9 21:20:07 2018 (r337551) +++ head/share/man/man5/src.conf.5 Thu Aug 9 21:28:31 2018 (r337552) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 2, 2018 +.Dd August 9, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1110,6 +1110,11 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITH_LLVM_TARGET_BPF +Set to build LLVM target support for BPF. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. .It Va WITHOUT_LLVM_TARGET_MIPS Set to not build LLVM target support for MIPS. The Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Aug 9 21:20:07 2018 (r337551) +++ head/share/mk/src.opts.mk Thu Aug 9 21:28:31 2018 (r337552) @@ -275,6 +275,8 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__ .endif .endfor +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF + .include # If the compiler is not C++11 capable, disable Clang and use GCC instead. # This means that architectures that have GCC 4.2 as default can not Added: head/tools/build/options/WITH_LLVM_TARGET_BPF ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_BPF Thu Aug 9 21:28:31 2018 (r337552) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build LLVM target support for BPF. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. From owner-svn-src-all@freebsd.org Thu Aug 9 21:41:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AD0910744C5; Thu, 9 Aug 2018 21:41:37 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C2E6896BF; Thu, 9 Aug 2018 21:41:37 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x233.google.com with SMTP id y207-v6so12367320oie.13; Thu, 09 Aug 2018 14:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=i4shtrkOdcE9KwB4QryY5diQ3TQHV9xR36gFhUBkV+E=; b=iQNYn3rU3CpT+1ghDgOZHBphpUAlF7SGr4XzhXdy30RZ4iIhgLsgYujrEG75uxW84Z x7M+jc/BudHW3kzm0MtifebaSjNjQS9/exDaQkWYghLAXTv7pkXI874fP/CxITH7mBZ5 jFmZsAMmb+2HyuBYoH3alrCSBSWIfMkAkltbZsa60zti3xfxSguvZdAXnlRSLpwfBTT2 rdRU4ophmvwYpwCXpskO9VmNPt/q9Kzae03SDUuzTnj6/GLI7/PfyON47+d1VPDYnlhI 2ejMcUuI/dO3Q/kzX7CvahmUKghCN26YiM7UY/whtGnlxtAi/oER8eSLke4a5Hj67hIJ +47w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=i4shtrkOdcE9KwB4QryY5diQ3TQHV9xR36gFhUBkV+E=; b=uESMXVDbtfxOcffQFBAEUGIKqv7lgj8mHOYuXxWHcLlip0DVwscVunA3AC40fkjeAW nvXV6tJ2lPBWFWmCHQ7vCcy4G7KduF7IN2KwzvNdcYtCFV3zHqD+MP2OqUvLrccmcKUF tdJ0AplBSGzkrCIkYYWBREVPshmUPZHdbcKG+vRdjxC5wJBwW3YgYB4M+EBwL/8YNu6Z tKIQa9u6P7Iufwlq4CxBKRE04gq3049c82zbV+lmU3EQcaxEq1So0enpzg6zLGiyhkXE 3HesgYXSfbz1cwco2WIvliW4Ckl3i7E49R+mQ2GXqpnEM+hIwfcXvvi+5hCm4LwSutdi g87w== X-Gm-Message-State: AOUpUlH79GWC6LdidKQP//f9/2SIwIuNb/aXRgxqE69LH9gnMa1EkPy5 Uc+0nxfHf0iWhiVmZZv38xjV5VX3xmjAqlJ+9DB5U5m1AWs= X-Google-Smtp-Source: AA+uWPwdURi5wRs+HB82yU6vupY6hbnVoWVtZRN1JD6qR24KX9sLf2a3iv718HFvfbHBqjCiZkoc480Aw2ZBpSmFxGk= X-Received: by 2002:aca:e754:: with SMTP id e81-v6mr3747251oih.203.1533850896384; Thu, 09 Aug 2018 14:41:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3bb6:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 14:41:35 -0700 (PDT) In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 9 Aug 2018 16:41:35 -0500 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: "cem@FreeBSD.org" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:41:37 -0000 On Thu, Aug 9, 2018 at 11:03 AM, Conrad Meyer wrote: > On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote: > > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala < > trasz@freebsd.org> > > wrote: > >> Use NULLs instead of casted zeroes, for consistency. > > > > It's probably helpful to note explicitly that these are not in argument= s > to > > varargs functions, > > I don't think it's helpful. > > > in which case the explicit cast is needed in order to produce a program > that > > will have > > correct behavior on all compliant compilers/systems. > > Here "compliant" means "minimally compliant to the C standard." Use > of NULL in varargs is functionally correct on all FreeBSD systems. > > > (We do define NULL to > > be a zero-with-cast, > > but programs > > (Ones that care about portability to weird systems.) I don't think > BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a stron= g candidate > for portability. > > > should not assume that NULL will be of pointer type -- "An > > integer constant > > expression with the value 0, or such an expression cast to type void *, > is > > called a null pointer constant".) > > Right. The problem only arises when both conditions are met: > > 1. The system's varargs representation is smaller than the pointer > representation, and > 2. The runtime headers do not defined NULL as a pointer-typed value. > (3. The function being invoked is actually varargs?) > > Neither is true on FreeBSD and v7-style init is not a useful place to > call for portability. > I don't really feel a need to continue the discussion that was already started in response to r336835 (in addition to the current thread), so I'll limit myself to asking whether we want to be writing standard C or a FreeBSD-specific dialect of C. My understanding was that we had some experience with the latter (e.g., heavy patching of the compiler) and it ended up with us in a bad place, which would tend to support writing standard C or as close to it as we can. (Yes, I know that we have non-standard printf specifiers and the like.) -Ben From owner-svn-src-all@freebsd.org Thu Aug 9 21:46:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBE1E10747BF for ; Thu, 9 Aug 2018 21:46:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7822E89B38 for ; Thu, 9 Aug 2018 21:46:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x243.google.com with SMTP id w11-v6so6055927iob.2 for ; Thu, 09 Aug 2018 14:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OhxqssZh8iDIvyrUE7Fx7pvHFBrbafoYnSoXYPYoUEA=; b=WTLbiMqANN/9Au6OtWT1MSa6GabMer/AHQ6+RfeBfKAF4VYadqEwMhU9r0aL/wx5YA TRHy4+R7EPqt0jGNTjAVJGOCIT6waYxaDIdD7Quc02fHHHDb3ykKtHS9GLCVwr9ukHY5 kfWv9kc9sXwE4qvV3b6RT5anrkvWSv/PWt8q4CB5AR1eLajQAW9QBxKCBeRM8gOX0qrm X2ipuxVih8awfdDgosrrX4E9z8UhHm9nMnKJuTx0qihntg2ghVY+8R+VCW5sZllIAvad fA9OAVq7MJOhNtPJNvr352GLKliJ7wOTVv0ADf62FayBCQwFqStG7Bq8axDNct1eVqW4 Mwgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OhxqssZh8iDIvyrUE7Fx7pvHFBrbafoYnSoXYPYoUEA=; b=ksC6UHiYvhFKS+A4E6TDkB+uFTgaXiOWvsjguC6L/cqJu0yPCRu5/ZnchJjF3PvsmU 9SR4iq4neR65dnnJMboTLO0kv44xOyGd4IZCihPh09eEFbu7fxs6tZQXmzyQ54ko0bIX WUrM9xmYVIhTPutIpk+J7AhxDmLsy4EfueEjCfLBCJ3/WL3qLSHn+pkbQEsAPMnzfUHO dLPIMpbdYcp74SmSQPr7/qdZ7b/P+Kavkq1g4cf+SAHxp3GG5DF2/ysFK7GJs3Ntyft+ QBRw2Rs8FVDG8isTfR66v+cu84WPcWh2BlSKOepTys34Cw7fu+uXS7pQpGajf5rqsSap 9zAA== X-Gm-Message-State: AOUpUlEJ14qynHV/fey73bJc3lxRmu3Mnufrok9D+PGEbr4vmRMaGwOF wwC7jeGRzAAagG/cdiH8+HUskHlzzUTudYdbcWBdAg== X-Google-Smtp-Source: AA+uWPzgf9TgJmkH3r3finTsczXd74gBCLMPui1DDPOXI57eoggE2W6Y6KimtodhEYYOy53Fg8182c7zhkAi0zQPTVE= X-Received: by 2002:a6b:f70f:: with SMTP id k15-v6mr3329482iog.37.1533851174688; Thu, 09 Aug 2018 14:46:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 14:46:14 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808091217.w79CH3gO096411@repo.freebsd.org> From: Warner Losh Date: Thu, 9 Aug 2018 15:46:14 -0600 X-Google-Sender-Auth: SPHOGHWTZSb114tZOqaFX6LVU44 Message-ID: Subject: Re: svn commit: r337535 - head/sbin/init To: Benjamin Kaduk Cc: "cem@FreeBSD.org" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:46:16 -0000 On Thu, Aug 9, 2018 at 3:41 PM, Benjamin Kaduk wrote: > On Thu, Aug 9, 2018 at 11:03 AM, Conrad Meyer wrote: > >> On Thu, Aug 9, 2018 at 5:52 AM, Benjamin Kaduk wrote= : >> > On Thu, Aug 9, 2018 at 7:17 AM, Edward Tomasz Napierala < >> trasz@freebsd.org> >> > wrote: >> >> Use NULLs instead of casted zeroes, for consistency. >> > >> > It's probably helpful to note explicitly that these are not in >> arguments to >> > varargs functions, >> >> I don't think it's helpful. >> >> > in which case the explicit cast is needed in order to produce a progra= m >> that >> > will have >> > correct behavior on all compliant compilers/systems. >> >> Here "compliant" means "minimally compliant to the C standard." Use >> of NULL in varargs is functionally correct on all FreeBSD systems. >> >> > (We do define NULL to >> > be a zero-with-cast, >> > but programs >> >> (Ones that care about portability to weird systems.) I don't think >> BSD's 500 line init =E2=80=94 hyper local to FreeBSD =E2=80=94 is a stro= ng candidate >> for portability. >> >> > should not assume that NULL will be of pointer type -- "An >> > integer constant >> > expression with the value 0, or such an expression cast to type void *= , >> is >> > called a null pointer constant".) >> >> Right. The problem only arises when both conditions are met: >> >> 1. The system's varargs representation is smaller than the pointer >> representation, and >> 2. The runtime headers do not defined NULL as a pointer-typed value. >> (3. The function being invoked is actually varargs?) >> >> Neither is true on FreeBSD and v7-style init is not a useful place to >> call for portability. >> > > I don't really feel a need to continue the discussion that was already > started in response > to r336835 (in addition to the current thread), so I'll limit myself to > asking whether we > want to be writing standard C or a FreeBSD-specific dialect of C. My > understanding was > that we had some experience with the latter (e.g., heavy patching of the > compiler) and > it ended up with us in a bad place, which would tend to support writing > standard C or > as close to it as we can. (Yes, I know that we have non-standard printf > specifiers and the like.) > The conventional wisdom is code as close to the standard(s) as we can, but not to the point of insanity. If there's a good reason to deviate, that's OK so long as it's intentional and the deviation makes sense. For example, we calloc a bunch of stuff, but that's not a strictly standards conforming way to initialize pointers to be NULL. While c->ptr =3D 0 is always standar= ds conforming, memset(&c->ptr, 0, sizeof(c->ptr)); isn't. Yet we do this everywhere because we know we'll never run on an architecture where the bitwise representation of a NULL pointer isn't all 0's. There's dozens of other similar examples. Warner From owner-svn-src-all@freebsd.org Thu Aug 9 21:52:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C9410749FD; Thu, 9 Aug 2018 21:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5725B89FEB; Thu, 9 Aug 2018 21:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3853E1F3BE; Thu, 9 Aug 2018 21:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LqqX3097916; Thu, 9 Aug 2018 21:52:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LqqWU097915; Thu, 9 Aug 2018 21:52:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808092152.w79LqqWU097915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Aug 2018 21:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337553 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:52:52 -0000 Author: np Date: Thu Aug 9 21:52:51 2018 New Revision: 337553 URL: https://svnweb.freebsd.org/changeset/base/337553 Log: cxgbe(4): Add a sysctl to control the tx credit reclaim mechanism for netmap tx queues. There is no change in default behavior. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Aug 9 21:28:31 2018 (r337552) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Aug 9 21:52:51 2018 (r337553) @@ -93,6 +93,14 @@ int starve_fl = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, starve_fl, CTLFLAG_RWTUN, &starve_fl, 0, "Don't ring fl db for netmap rx queues."); +/* + * Try to process tx credits in bulk. This may cause a delay in the return of + * tx credits and is suitable for bursty or non-stop tx only. + */ +int lazy_tx_credit_flush = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, lazy_tx_credit_flush, CTLFLAG_RWTUN, + &lazy_tx_credit_flush, 0, "lazy credit flush for netmap tx queues."); + static int alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) { @@ -571,8 +579,6 @@ ring_nm_txq_db(struct adapter *sc, struct sge_nm_txq * } nm_txq->dbidx = nm_txq->pidx; } - -int lazy_tx_credit_flush = 1; /* * Write work requests to send 'npkt' frames and ring the doorbell to send them From owner-svn-src-all@freebsd.org Thu Aug 9 21:53:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A51421074A4A; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6308A130; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3887D1F3BF; Thu, 9 Aug 2018 21:53:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79LrXDF097989; Thu, 9 Aug 2018 21:53:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79LrWEZ097986; Thu, 9 Aug 2018 21:53:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808092153.w79LrWEZ097986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 9 Aug 2018 21:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337554 - in head/sys/cam: . ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata nvme scsi X-SVN-Commit-Revision: 337554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:53:34 -0000 Author: cem Date: Thu Aug 9 21:53:32 2018 New Revision: 337554 URL: https://svnweb.freebsd.org/changeset/base/337554 Log: cam(4): Add an xpt-neutral flag indicating a valid panic CCB No functional change. Note that this change is careful to set the CCB header xflags after foo_fill_bar() routines, which generally zero existing flags. An earlier version of this patch mistakenly set the flag before the fill routines. Submitted by: Scott Ferris , jhibbits@ Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor Anton Rang Sponsored by: Dell EMC Isilon Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/ata/ata_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -1081,6 +1081,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical (u_int8_t *) virtual, length, ada_default_timeout*1000); + ataio.ccb_h.xflags |= CAM_CCB_DUMP; if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { @@ -1115,6 +1116,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical NULL, 0, 5*1000); + ataio.ccb_h.xflags |= CAM_CCB_DUMP; if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); @@ -3499,6 +3501,7 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); + local_ccb.ccb_h.xflags |= CAM_CCB_DUMP; ata_28bit_cmd(&local_ccb, cmd, 0, 0, 0); error = cam_periph_runccb((union ccb *)&local_ccb, adaerror, /*cam_flags*/0, /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/cam_ccb.h Thu Aug 9 21:53:32 2018 (r337554) @@ -116,7 +116,8 @@ typedef enum { typedef enum { CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ + CAM_UNMAPPED_BUF = 0x00000008,/* use unmapped I/O */ + CAM_CCB_DUMP = 0x00000010,/* polled ccb during dump */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/nvme/nvme_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -426,6 +426,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); + nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -439,6 +440,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); + nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Aug 9 21:52:51 2018 (r337553) +++ head/sys/cam/scsi/scsi_da.c Thu Aug 9 21:53:32 2018 (r337554) @@ -1847,6 +1847,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); + csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -1869,6 +1870,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*lb_count*/0, SSD_FULL_SIZE, 5 * 1000); + csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) From owner-svn-src-all@freebsd.org Thu Aug 9 21:56:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCCD1074B42; Thu, 9 Aug 2018 21:56:23 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 298368A2E6; Thu, 9 Aug 2018 21:56:22 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 23E66F26; Thu, 9 Aug 2018 17:56:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 09 Aug 2018 17:56:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=WbwFGFNLlcpoVAAJqW7bqV5WfgNYg /dGt/F+YrYfTd4=; b=A9vTlZpacdnlI9G9GPHAMqXrT653VVQvKkUIpzJ8uVpVC 8stVJNapu7YHUp5QUr7TNHPbejMeZtqCY5fVOSxVv4cOmNnKB8eoRi08NiKj81Nr s5mBjq06hIKynT+uiHpQVWAqjnvEabAlNeNMI2cIpOYaYmLAXzkw/djKPQNaaxmy GlSMWg+c9XnXNW1qRGe5q7IE9W5bWdU3HWWkaDXmaFvCYHHyXgL2hDvDP+CDrB9O 94jCt5rXhmZkJYHd/JY9qnPMAykjOLgVSs+CWX9wNUELPFWEWWhjPSuuRpQWVQPg iZX2i+/I3/WXcGhLTh8w08ipcO5rLKWlqeIUKznhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=WbwFGF NLlcpoVAAJqW7bqV5WfgNYg/dGt/F+YrYfTd4=; b=CkSpjNZNiQ/f7aFYY/E9ZQ paz+H9Fit6Snbaw69dZmk1OsDXYD2wDsWpRa88JT0AbvmPzizPG4KN9TE1muwiXO Gd5w0plhogMN+Zk2golbwFtLXLEUNCIZIO0HZkwkJxYeDUYKe+PT9jqDtHZvp9cG KA9//C/5H+c4AZlR6vwREya+l0IB0nHYL+2jgPHEU6cuI7E1+9vk9Z0ln8/pk580 YlY8TuQKhbM2nL9k8PwGdB5Gav+VbKAD3QCjRUwnN6zLwk1wVZaym5jnnuZ7KQMf O0UvC+inTIw8XbPvGRqmRaHEq1YbxOGSaUlxMfA/rBdio5eocHBoDbq3LytSKUTA == X-ME-Proxy: X-ME-Sender: Received: from [192.168.0.118] (unknown [161.97.249.191]) by mail.messagingengine.com (Postfix) with ESMTPA id 6E58C10261; Thu, 9 Aug 2018 17:56:15 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r337554 - in head/sys/cam: . ata nvme scsi From: Scott Long In-Reply-To: <201808092153.w79LrWEZ097986@repo.freebsd.org> Date: Thu, 9 Aug 2018 15:56:13 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201808092153.w79LrWEZ097986@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 21:56:23 -0000 > On Aug 9, 2018, at 3:53 PM, Conrad Meyer wrote: >=20 > Author: cem > Date: Thu Aug 9 21:53:32 2018 > New Revision: 337554 > URL: https://svnweb.freebsd.org/changeset/base/337554 >=20 > Log: > cam(4): Add an xpt-neutral flag indicating a valid panic CCB >=20 > No functional change. >=20 > Note that this change is careful to set the CCB header xflags after > foo_fill_bar() routines, which generally zero existing flags. An = earlier > version of this patch mistakenly set the flag before the fill = routines. >=20 > Submitted by: Scott Ferris , jhibbits@ > Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor = Anton Rang > Sponsored by: Dell EMC Isilon What=E2=80=99s the purpose of this flag? I see it gets set in plenty of = places, but never checked. Scott From owner-svn-src-all@freebsd.org Thu Aug 9 23:22:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F10E10767AF; Thu, 9 Aug 2018 23:22:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id A61F68CC0D; Thu, 9 Aug 2018 23:22:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 8C9B9104F163; Fri, 10 Aug 2018 09:22:12 +1000 (AEST) Date: Fri, 10 Aug 2018 09:22:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kyle Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: <201808090132.w791WAQm057199@repo.freebsd.org> Message-ID: <20180810081913.P1108@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=-dLe785RhlDCTkMXlmIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 23:22:25 -0000 On Thu, 9 Aug 2018, Kyle Evans wrote: > Log: > kern: Add a BOOT_TAG marker at the beginning of boot dmesg > > From the "newly licensed to drive" PR department, add a BOOT_TAG marker (by > default, --<>--, to the beginning of each boot's dmesg. This makes it > easier to do textproc magic to locate the start of each boot and, of > particular interest to some, the dmesg of the current boot. > > The PR has a dmesg(8) component as well that I've opted not to include for > the moment- it was the more contentious part of this PR. > > bde@ also made the statement that this boot tag should be written with an > ordinary printf, which I've- for the moment- declined to change about this > patch to keep it more transparent to observer of the boot process. Yes, it should be written with an ordinary printf. > Modified: head/sys/kern/subr_prf.c > ============================================================================== > --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) > +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) > @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) > cp = (char *)ptr; > msgbufp = (struct msgbuf *)(cp + size); > msgbuf_reinit(msgbufp, cp, size); > + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); > if (msgbufmapped && oldp != msgbufp) > msgbuf_copy(oldp, msgbufp); > msgbufmapped = 1; This seems to be wrong, since it writes the tag for all calls to msgbufinit(), giving multiple tags for multiple calls, but there should be only 1 per boot. msgbufinit() should be called multiple times to bootstrap it. My version does this. The only obvious bug in (a later version of) the output is a missing newline for the tag. My dmesg output on amd64: X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X KDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... In -current, all of the lines before the copyright except the tag are broken by printf() of them to an unmapped msgbuf. (The above output is without -v. Many more lines are lost with -v.) In my version, msgbufinit() is called earlier with a small message buffer to hold the early output. Output across reboots also works right except for the missing newline: X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X GDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... X Waiting (max 60 seconds) for system process `vnlru' to stop... done X Waiting (max 60 seconds) for system process `syncer' to stop... X Syncing disks, vnodes remaining... 0 0 0 done X Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-4' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-5' to stop... done X Waiting (max 60 seconds) for system thread `bufspacedaemon-6' to stop... done X All buffers synced. X ---<>------<>---Test of early printf to msgbuf X GDB: debug ports: sio X GDB: current port: sio X KDB: debugger backends: ddb gdb X KDB: current backend: ddb X Copyright (c) 1992-2018 The FreeBSD Project. X ... Bruce From owner-svn-src-all@freebsd.org Thu Aug 9 23:31:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42FF81076BA0; Thu, 9 Aug 2018 23:31:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED4D78CFEF; Thu, 9 Aug 2018 23:31:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE8B620364; Thu, 9 Aug 2018 23:31:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79NVIhp046488; Thu, 9 Aug 2018 23:31:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79NVIBD046486; Thu, 9 Aug 2018 23:31:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808092331.w79NVIBD046486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 9 Aug 2018 23:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337555 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 23:31:19 -0000 Author: gjb Date: Thu Aug 9 23:31:18 2018 New Revision: 337555 URL: https://svnweb.freebsd.org/changeset/base/337555 Log: Update and replace old rc daemons for GCE images. PR: 229000 Submitted by: helen.koike@collabora.com MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Thu Aug 9 21:53:32 2018 (r337554) +++ head/release/tools/gce.conf Thu Aug 9 23:31:18 2018 (r337555) @@ -12,8 +12,7 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update fir export VM_RC_LIST="ntpd sshd firstboot_growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ - google_instance_setup google_ip_forwarding_daemon \ - google_network_setup" + google_instance_setup google_network_daemon" vm_extra_install_base() { echo 'search google.internal' > ${DESTDIR}/etc/resolv.conf From owner-svn-src-all@freebsd.org Thu Aug 9 23:40:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162CE1076FAB for ; Thu, 9 Aug 2018 23:40:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C3F78D7F4 for ; Thu, 9 Aug 2018 23:40:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id l7-v6so6258294ioj.1 for ; Thu, 09 Aug 2018 16:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OzeLmNzbnQEmcYPW2qgN4jsi4hBfUJhRO9az51lZBLc=; b=ByN1XM8DVcMh6L8ScnK3ke5l/Swa/G0NENvQvn7YsRI1maJ4XpeW/mxDzKAm9IJOMN VEMxhVzPTsb2Yff8JQY2s2rO04Ke8WX3JpoSGVmYLPta/yEkSU1AyFcu6XetpCvGQ1z8 JtaSm6+08aSeGHZ4ZhYCC+8zVUlHfC7OF0M+FZ+tykTiHItMACdoB7uiphR9HpjJbGfC 7GKt0JmO77yFB/PDlhHHGtMvi3JIitmixPcQYS+GZD+at6sgMHPwN3z/SDETcI21YJ/J 1R6Jx/xl25B12xUUIKg8//f2Vs82QMeAT4cvgRMFgzDoPr/xcCWdFeVXHTaXoStu8adW sEqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OzeLmNzbnQEmcYPW2qgN4jsi4hBfUJhRO9az51lZBLc=; b=cu3Y9DCCQG+MoSKiGqNxFeIw0TJSVL3nFkng5LqzYZrwxW+eF+22VcGTdb4D8xcUVm YdFvjHxASLc4IPqwC+8IxALGY5TBEyXtAr7fSr3mHrLfepVjBHy9ihBd1lO1u2KlgQ/d Mu/sx23v9IBXQ9S/75ooxvkdTHozkpthZiC5Ch4CwUqb3LAzAOHs4y1zMm9SLpFOVgvP 0GdQnyWTafRdZj+LOZFAWz9xt98gQd51zi1mc4sCCHd8hYm2Wtf5dCZOxhR5tJOJF97K 6qkBvP/e8iqMTOlyCjjCh4cwwdrt3jc6Idi5D6ZQMm3qZ7GWIGbCD50hmXptELxghPI9 MdXA== X-Gm-Message-State: AOUpUlECEZYZcAl1jDRfhleAM3O90yJ4zRQmJ4afu7M6dyUVYIxb59dW lCEuElr1+Z2chTx2BR7FMNhTDYtxDYN7XbL1XGo7NA== X-Google-Smtp-Source: AA+uWPysgW0z64rJSEUoeopjcNdsZToG1m9uOtbcZcYsc5q+vPAO364yPGv7VunTFU2M9jZbaqXnQ/ty0ytP3vYMSiY= X-Received: by 2002:a6b:3902:: with SMTP id g2-v6mr3526579ioa.168.1533858055125; Thu, 09 Aug 2018 16:40:55 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:381a:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 16:40:54 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201808092153.w79LrWEZ097986@repo.freebsd.org> From: Warner Losh Date: Thu, 9 Aug 2018 17:40:54 -0600 X-Google-Sender-Auth: 3zCQiINs_CFf6Pyp-pnx-xNo8lA Message-ID: Subject: Re: svn commit: r337554 - in head/sys/cam: . ata nvme scsi To: Scott Long Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 23:40:57 -0000 On Thu, Aug 9, 2018 at 3:56 PM, Scott Long wrote: > > > > On Aug 9, 2018, at 3:53 PM, Conrad Meyer wrote: > > > > Author: cem > > Date: Thu Aug 9 21:53:32 2018 > > New Revision: 337554 > > URL: https://svnweb.freebsd.org/changeset/base/337554 > > > > Log: > > cam(4): Add an xpt-neutral flag indicating a valid panic CCB > > > > No functional change. > > > > Note that this change is careful to set the CCB header xflags after > > foo_fill_bar() routines, which generally zero existing flags. An > earlier > > version of this patch mistakenly set the flag before the fill routines= . > > > > Submitted by: Scott Ferris , jhibbits@ > > Reviewed by: bdrewery@, markj@, and non-committer FreeBSD contributor > Anton Rang > > Sponsored by: Dell EMC Isilon > > What=E2=80=99s the purpose of this flag? I see it gets set in plenty of = places, > but never checked. > It kinda looks like something I recall removing when I did the runccb fixes so they worked when we were dumping. We used to need this, but we don't anymore. I have the same question: Why? Maybe these CAM changes should go through phabricator? Warner From owner-svn-src-all@freebsd.org Thu Aug 9 23:43:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D32107715F; Thu, 9 Aug 2018 23:43:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 170558DA97; Thu, 9 Aug 2018 23:43:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6F4D20566; Thu, 9 Aug 2018 23:43:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w79NhAdE053627; Thu, 9 Aug 2018 23:43:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w79NhABG053626; Thu, 9 Aug 2018 23:43:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808092343.w79NhABG053626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 9 Aug 2018 23:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337556 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 337556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2018 23:43:11 -0000 Author: gjb Date: Thu Aug 9 23:43:10 2018 New Revision: 337556 URL: https://svnweb.freebsd.org/changeset/base/337556 Log: Invoke the growfs rc script for each boot on GCE. PR: 230275 Submitted by: gustavo.scalet@collabora.com MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Thu Aug 9 23:31:18 2018 (r337555) +++ head/release/tools/gce.conf Thu Aug 9 23:43:10 2018 (r337556) @@ -5,11 +5,10 @@ # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ - google-cloud-sdk panicmail sudo firstboot-growfs \ - sysutils/py-google-compute-engine" + google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="ntpd sshd firstboot_growfs \ +export VM_RC_LIST="ntpd sshd growfs\ firstboot_pkgs firstboot_freebsd_update google_startup \ google_accounts_daemon google_clock_skew_daemon \ google_instance_setup google_network_daemon" @@ -21,6 +20,10 @@ vm_extra_install_base() { } vm_extra_pre_umount() { + # Enable growfs on every boot, not only the first, as as instance's disk can + # be enlarged post-creation + sed -i -e '/KEYWORD: firstboot/d' /etc/rc.d/growfs + cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" ifconfig_DEFAULT="SYNCDHCP mtu 1460" From owner-svn-src-all@freebsd.org Fri Aug 10 00:01:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9D8310779B6; Fri, 10 Aug 2018 00:01:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F19548E36F; Fri, 10 Aug 2018 00:01:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D40B320843; Fri, 10 Aug 2018 00:01:21 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A01L2j062451; Fri, 10 Aug 2018 00:01:21 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A01LKu062450; Fri, 10 Aug 2018 00:01:21 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201808100001.w7A01LKu062450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 10 Aug 2018 00:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337557 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 337557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:01:22 -0000 Author: gjb Date: Fri Aug 10 00:01:21 2018 New Revision: 337557 URL: https://svnweb.freebsd.org/changeset/base/337557 Log: Rename head from -CURRENT to -ALPHA1 as part of the 12.0-RELEASE cycle. This commit marks the start of the code slush for the 12.0 cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Aug 9 23:43:10 2018 (r337556) +++ head/sys/conf/newvers.sh Fri Aug 10 00:01:21 2018 (r337557) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="CURRENT" +BRANCH="ALPHA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Aug 10 00:02:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AEA1077BA2; Fri, 10 Aug 2018 00:02:47 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C09908E81B; Fri, 10 Aug 2018 00:02:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5F14529DE8; Fri, 10 Aug 2018 00:02:46 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lj1-f178.google.com with SMTP id p10-v6so5852149ljg.2; Thu, 09 Aug 2018 17:02:46 -0700 (PDT) X-Gm-Message-State: AOUpUlEfdG+ZYFWOKB9NIzA18LZWJGmwk19Ws+mHRt/p69GbSw26L3v3 +kj5iRc1AaXBYtwANtORAWiETdtiET0Cie/2euQ= X-Google-Smtp-Source: AA+uWPwrH3M7/tnD6gsVzl43JBwUgDs5k57zk8pGqb0k8XSqfMsd1Xs17Easc/KP10w8AMf9i0mr699bVPKTvdkLAY0= X-Received: by 2002:a2e:144f:: with SMTP id 15-v6mr3177268lju.122.1533859364835; Thu, 09 Aug 2018 17:02:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 17:02:20 -0700 (PDT) In-Reply-To: <20180810081913.P1108@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> From: Kyle Evans Date: Thu, 9 Aug 2018 19:02:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337518 - in head/sys: kern sys To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:02:47 -0000 On Thu, Aug 9, 2018 at 6:22 PM, Bruce Evans wrote: > On Thu, 9 Aug 2018, Kyle Evans wrote: > >> Log: >> kern: Add a BOOT_TAG marker at the beginning of boot dmesg >> >> From the "newly licensed to drive" PR department, add a BOOT_TAG marker >> (by >> default, --<>--, to the beginning of each boot's dmesg. This makes >> it >> easier to do textproc magic to locate the start of each boot and, of >> particular interest to some, the dmesg of the current boot. >> >> The PR has a dmesg(8) component as well that I've opted not to include >> for >> the moment- it was the more contentious part of this PR. >> >> bde@ also made the statement that this boot tag should be written with an >> ordinary printf, which I've- for the moment- declined to change about >> this >> patch to keep it more transparent to observer of the boot process. > > > Yes, it should be written with an ordinary printf. > >> Modified: head/sys/kern/subr_prf.c >> >> ============================================================================== >> --- head/sys/kern/subr_prf.c Thu Aug 9 01:17:35 2018 (r337517) >> +++ head/sys/kern/subr_prf.c Thu Aug 9 01:32:09 2018 (r337518) >> @@ -1027,6 +1027,7 @@ msgbufinit(void *ptr, int size) >> cp = (char *)ptr; >> msgbufp = (struct msgbuf *)(cp + size); >> msgbuf_reinit(msgbufp, cp, size); >> + msgbuf_addstr(msgbufp, -1, BOOT_TAG, 0); >> if (msgbufmapped && oldp != msgbufp) >> msgbuf_copy(oldp, msgbufp); >> msgbufmapped = 1; > > > This seems to be wrong, since it writes the tag for all calls to > msgbufinit(), giving multiple tags for multiple calls, but there should be > only 1 per boot. msgbufinit() should be called multiple times to bootstrap > it. My version does this. > > The only obvious bug in (a later version of) the output is a missing newline > for the tag. > > My dmesg output on amd64: > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X KDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > > In -current, all of the lines before the copyright except the tag are broken > by printf() of them to an unmapped msgbuf. (The above output is without -v. > Many more lines are lost with -v.) In my version, msgbufinit() is called > earlier with a small message buffer to hold the early output. I've not seen a compelling reason to switch this to printf() rather than direct addition to the msgbuf after it's initialized, but I'll humor you on this one because I don't really care either way and you've been at this a lot longer than I have. When you say you call msgbufinit() earlier-- before the static environment is even setup, or at least after that? > Output across reboots also works right except for the missing newline: > > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X GDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > X Waiting (max 60 seconds) for system process `vnlru' to stop... done > X Waiting (max 60 seconds) for system process `syncer' to stop... X Syncing > disks, vnodes remaining... 0 0 0 done > X Waiting (max 60 seconds) for system thread `bufdaemon' to stop... done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-0' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-1' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-2' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-3' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-4' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-5' to stop... > done > X Waiting (max 60 seconds) for system thread `bufspacedaemon-6' to stop... > done > X All buffers synced. > X ---<>------<>---Test of early printf to msgbuf > X GDB: debug ports: sio > X GDB: current port: sio > X KDB: debugger backends: ddb gdb > X KDB: current backend: ddb > X Copyright (c) 1992-2018 The FreeBSD Project. > X ... > Right- I tried to maintain the form of the original patch and also overlooked this. My revised patch [1] prints the boot tag only upon first init of the message buffer, swaps it over to printf, and adds a newline to whatever's been chosen as the boot tag. Thanks, Kyle Evans [1] https://people.freebsd.org/~kevans/bde-boottag.diff From owner-svn-src-all@freebsd.org Fri Aug 10 00:04:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D732D1077D5E; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C79E8EA31; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5373C208AB; Fri, 10 Aug 2018 00:04:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A04XmH064245; Fri, 10 Aug 2018 00:04:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A04XuX064244; Fri, 10 Aug 2018 00:04:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808100004.w7A04XuX064244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Aug 2018 00:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337558 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:04:34 -0000 Author: cy Date: Fri Aug 10 00:04:32 2018 New Revision: 337558 URL: https://svnweb.freebsd.org/changeset/base/337558 Log: Identify the return value (rval) that led to the IPv4 NAT failure in ipf_nat_checkout() and report it in the frb_natv4out and frb_natv4in dtrace probes. This is currently being used to diagnose NAT failures in PR/208566. It's rather handy so this commit makes it available for future diagnosis and debugging efforts. PR: 208566 MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:01:21 2018 (r337557) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:04:32 2018 (r337558) @@ -4951,7 +4951,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto outmatchfail; case 1 : default : @@ -4996,7 +4996,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (nmsk < softn->ipf_nat_map_max)) { nmsk++; @@ -5021,15 +5021,23 @@ outmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4out, fr_info_t *, fin); + DT2(frb_natv4out, fr_info_t *, fin, int, rval); NBUMPSIDED(1, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(1, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(1, ns_ignored); @@ -5437,7 +5445,7 @@ retry_roundrobin: case 0 : continue; case -1 : - rval = -1; + rval = -3; goto inmatchfail; case 1 : default : @@ -5484,7 +5492,7 @@ retry_roundrobin: natfailed = 0; break; } - natfailed = -1; + natfailed = -2; } if ((np == NULL) && (rmsk < softn->ipf_nat_rdr_max)) { rmsk++; @@ -5509,15 +5517,23 @@ inmatchfail: switch (rval) { + case -3 : + /* ipf_nat_match() failure */ + /* FALLTHROUGH */ + case -2 : + /* retry_roundrobin loop failure */ + /* FALLTHROUGH */ case -1 : + /* proxy failure detected by ipf_nat_out() */ if (passp != NULL) { - DT1(frb_natv4in, fr_info_t *, fin); + DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); *passp = FR_BLOCK; fin->fin_reason = FRB_NATV4; } fin->fin_flx |= FI_BADNAT; NBUMPSIDED(0, ns_badnat); + rval = -1; /* We only return -1 on error. */ break; case 0 : NBUMPSIDE(0, ns_ignored); From owner-svn-src-all@freebsd.org Fri Aug 10 00:10:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F5E105202B; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2208EE9D; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B50F208DD; Fri, 10 Aug 2018 00:10:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A0AwXi066032; Fri, 10 Aug 2018 00:10:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A0AwWj066031; Fri, 10 Aug 2018 00:10:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808100010.w7A0AwWj066031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 00:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337559 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 337559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:10:58 -0000 Author: kevans Date: Fri Aug 10 00:10:57 2018 New Revision: 337559 URL: https://svnweb.freebsd.org/changeset/base/337559 Log: Makefile.inc1: Add libl to -legacy as well libl is needed for config(8), which is a bootstrap-tool. It is possible to build a system WITHOUT_TOOLCHAIN to exclude lex and thus, libl. We still need to support building from this kind of host, though. While here, group the config(8) dependencies together and add a small explanation. These can likely both be scoped more clearly, but this will need some further investigation. Reported by: rgrimes (not WITHOUT_TOOLCHAIN, but provoked investigation) MFC after: immediately Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Aug 10 00:04:32 2018 (r337558) +++ head/Makefile.inc1 Fri Aug 10 00:10:57 2018 (r337559) @@ -1943,13 +1943,17 @@ update: .PHONY _elftoolchain_libs= lib/libelf lib/libdwarf .endif +# libnv and libl are both requirements for config(8), which is an unconditional +# bootstrap-tool. +_config_deps= lib/libnv usr.bin/lex/lib + legacy: .PHONY .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false .endif -.for _tool in tools/build ${_elftoolchain_libs} lib/libnv +.for _tool in tools/build ${_elftoolchain_libs} ${_config_deps} ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,all,install)"; \ cd ${.CURDIR}/${_tool}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ From owner-svn-src-all@freebsd.org Fri Aug 10 00:26:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C6F81052718; Fri, 10 Aug 2018 00:26:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id A7FD18F56A; Fri, 10 Aug 2018 00:25:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 2DD3F4348F4; Fri, 10 Aug 2018 10:25:50 +1000 (AEST) Date: Fri, 10 Aug 2018 10:25:50 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337426 - head/sbin/ifconfig In-Reply-To: <201808071725.w77HPciT051597@repo.freebsd.org> Message-ID: <20180810092251.K1276@besplex.bde.org> References: <201808071725.w77HPciT051597@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=5lkVNKLIfOsGeeQGpCIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:26:00 -0000 On Tue, 7 Aug 2018, Mark Johnston wrote: > Log: > ifconfig: Fix use of _Noreturn. > > The _Noreturn is a function-specifier (like inline) which must preceed > the declarator. > > Submitted by: Sebastian Huber > MFC after: 1 week _Noreturn is even more broken than I knew. It should never be used. Here its use is wronger than usual. > Modified: head/sbin/ifconfig/ifconfig.c > ============================================================================== > --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) > +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > struct ifaddrs *ifa); > static void tunnel_status(int s); > -static void usage(void) _Noreturn; > +static _Noreturn void usage(void); > > static struct afswtch *af_getbyname(const char *name); > static struct afswtch *af_getbyfamily(int af); FreeBSD code should use __dead2 since it is more portable (within FreeBSD) and doesn't have so mean syntactical restrictions. However, it only exists at all since it had similar syntactial restrictions when it was new (FreeBSD-1 used __dead, which must be placed like _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed there when it was new), and the macro that hides the details was renamed to inhibit misuse. Changing __dead2 to _Noreturn and moving it to satisfy the restricted syntax of the latter mainly broke support for old compilers where __dead2 cannot be placed there. However, all declarations of static usage() as non-returning are bogus, and this one is more bogus than most since another style bug is to unsort usage() to before where it is used, so even 1-pass compilers can see that it doesn't return before generating code that uses it. Unsorting of inline functions is sometimes needed so that 1-pass compilers can optimize them, but optimizing usage() is especially not needed. Bruce From owner-svn-src-all@freebsd.org Fri Aug 10 00:30:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB7B10529A0; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7341A8F849; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55C3B20BD3; Fri, 10 Aug 2018 00:30:16 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A0UGod074532; Fri, 10 Aug 2018 00:30:16 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A0UG4e074531; Fri, 10 Aug 2018 00:30:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201808100030.w7A0UG4e074531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 10 Aug 2018 00:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337560 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 337560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 00:30:16 -0000 Author: cy Date: Fri Aug 10 00:30:15 2018 New Revision: 337560 URL: https://svnweb.freebsd.org/changeset/base/337560 Log: Correct a comment. Should have been detected by ipf_nat_in() not ipf_nat_out(). MFC after: 1 week X-MFC-with: r337558 Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:10:57 2018 (r337559) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 10 00:30:15 2018 (r337560) @@ -5524,7 +5524,7 @@ inmatchfail: /* retry_roundrobin loop failure */ /* FALLTHROUGH */ case -1 : - /* proxy failure detected by ipf_nat_out() */ + /* proxy failure detected by ipf_nat_in() */ if (passp != NULL) { DT2(frb_natv4in, fr_info_t *, fin, int, rval); NBUMPSIDED(0, ns_drop); From owner-svn-src-all@freebsd.org Fri Aug 10 01:43:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABFC51054AAF; Fri, 10 Aug 2018 01:43:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 407D771BB6; Fri, 10 Aug 2018 01:43:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C1C2218AC; Fri, 10 Aug 2018 01:43:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A1h5iM015641; Fri, 10 Aug 2018 01:43:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A1h5H2015640; Fri, 10 Aug 2018 01:43:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808100143.w7A1h5H2015640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 01:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337561 - stable/11/lib/libnv X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libnv X-SVN-Commit-Revision: 337561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 01:43:06 -0000 Author: kevans Date: Fri Aug 10 01:43:05 2018 New Revision: 337561 URL: https://svnweb.freebsd.org/changeset/base/337561 Log: MFC r337549: libnv: Remove -I${SRCTOP}/sys This should have been done as part of r336019 -- including ${SRCTOP}/sys is not a good business model for something that's build in legacy/bootstrap stages. Beyond that, libnv seems to build quite alright as legacy, part of buildworld, and standalone without. Axe it. Approved by: re (bdrewery) Modified: stable/11/lib/libnv/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libnv/Makefile ============================================================================== --- stable/11/lib/libnv/Makefile Fri Aug 10 00:30:15 2018 (r337560) +++ stable/11/lib/libnv/Makefile Fri Aug 10 01:43:05 2018 (r337561) @@ -9,7 +9,7 @@ LIB= nv SHLIB_MAJOR= 0 .PATH: ${SRCTOP}/sys/contrib/libnv ${SRCTOP}/sys/sys -CFLAGS+=-I${SRCTOP}/sys -I${.CURDIR} +CFLAGS+=-I${.CURDIR} SRCS= cnvlist.c SRCS+= dnvlist.c From owner-svn-src-all@freebsd.org Fri Aug 10 01:49:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774B91054CCF; Fri, 10 Aug 2018 01:49:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id C4F0D71DDA; Fri, 10 Aug 2018 01:49:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A92A93CA0D1; Fri, 10 Aug 2018 11:49:04 +1000 (AEST) Date: Fri, 10 Aug 2018 11:49:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kyle Evans cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: Message-ID: <20180810105239.J1482@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=EseilWUA c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=QtvNg27y_NiTNPgunEoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 01:49:15 -0000 On Thu, 9 Aug 2018, Kyle Evans wrote: > On Thu, Aug 9, 2018 at 6:22 PM, Bruce Evans wrote: >> ... >> The only obvious bug in (a later version of) the output is a missing newline >> for the tag. >> >> My dmesg output on amd64: >> X ---<>------<>---Test of early printf to msgbuf >> X GDB: debug ports: sio >> X KDB: current port: sio >> X KDB: debugger backends: ddb gdb >> X KDB: current backend: ddb >> X Copyright (c) 1992-2018 The FreeBSD Project. >> X ... >> >> In -current, all of the lines before the copyright except the tag are broken >> by printf() of them to an unmapped msgbuf. (The above output is without -v. >> Many more lines are lost with -v.) In my version, msgbufinit() is called >> earlier with a small message buffer to hold the early output. > > I've not seen a compelling reason to switch this to printf() rather > than direct addition to the msgbuf after it's initialized, but I'll > humor you on this one because I don't really care either way and > you've been at this a lot longer than I have. Thanks. > When you say you call msgbufinit() earlier-- before the static > environment is even setup, or at least after that? The above is with a simplified version that first calls msgbufinit() after the static env is set up. In other working versions, msgbufinit() is called long before the static env is set up. In a commented out version, a small MI msgbuf is statically initalized so that some msgbuf is always mapped, but msgbufmapped still starts as 0 and msgbufinit() must still be called to synchronize. Some synchronization is needed since the msgbuf uses broken mutex locking and mutexes use curthread and curthread is not initialized early. The simplified versions delay the msgbufinit() calls until mutexes are initialized enough, and this accidentally moves them after other initializations. So the tunable is unavailable in the best version :-(. The small initial msgbuf could even start with the statically initialized buffer containing the tag, and must if it is to be ready to go without a synchronization call. I haven't really noticed the need for this feature. I edit /var/log/messages a lot and need to find the start of the data for each boot, and just grep for kern.bootfile. But this depends on the message buffer being clobbered by reboot, so that syslogd always adds the kern.bootfile message before the data for the new boot. When the data spans multiple boots, the kern.bootfile message is very misplaced timestamps are wrong for the old data, and ... >> Output across reboots also works right except for the missing newline: >> >> X ---<>------<>---Test of early printf to msgbuf >> .... >> X All buffers synced. >> X ---<>------<>---Test of early printf to msgbuf ... actually, the output across reboots doesn't work write (unless you modified dmesg and syslogd to use the tag to drop duplicates). dmesg show the old boot messages by default, but syslogd shouldn't log them again by default. > Right- I tried to maintain the form of the original patch and also > overlooked this. My revised patch [1] prints the boot tag only upon > first init of the message buffer, swaps it over to printf, and adds a > newline to whatever's been chosen as the boot tag. > > [1] https://people.freebsd.org/~kevans/bde-boottag.diff I won't have much time to check it for a few weeks. Bruce From owner-svn-src-all@freebsd.org Fri Aug 10 02:12:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B350F1055583; Fri, 10 Aug 2018 02:12:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 30E06728E9; Fri, 10 Aug 2018 02:12:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B0AA8D733C6; Fri, 10 Aug 2018 12:12:43 +1000 (AEST) Date: Fri, 10 Aug 2018 12:12:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Kyle Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337518 - in head/sys: kern sys In-Reply-To: <20180810105239.J1482@besplex.bde.org> Message-ID: <20180810115339.X1652@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> <20180810105239.J1482@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=x7bEGLp0ZPQA:10 a=8fF8oHDZ2iCZZMA05wEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 02:12:53 -0000 On Fri, 10 Aug 2018, Bruce Evans wrote: > On Thu, 9 Aug 2018, Kyle Evans wrote: > ... >> When you say you call msgbufinit() earlier-- before the static >> environment is even setup, or at least after that? > > The above is with a simplified version that first calls msgbufinit() > after the static env is set up. In other working versions, msgbufinit() > is called long before the static env is set up. In a commented out > version, a small MI msgbuf is statically initalized so that some msgbuf > is always mapped, but msgbufmapped still starts as 0 and msgbufinit() > must still be called to synchronize. Some synchronization is needed > since the msgbuf uses broken mutex locking and mutexes use curthread and > curthread is not initialized early. The simplified versions delay the > msgbufinit() calls until mutexes are initialized enough, and this > accidentally moves them after other initializations. > > So the tunable is unavailable in the best version :-(. The small initial > msgbuf could even start with the statically initialized buffer containing > the tag, and must if it is to be ready to go without a synchronization call. The tag can be added later fairly easily, and this order corresponds to the problem being solved (that we don't know where the data for the new boot starts iff there is old data): - start with a small statically initialized msgbuf. No need for a tag; the new data starts at the start of the buffer - write new data to this buffer - reinit is not really initialization, but supplies data from the previous boot. Construct the new buffer as the concatenation of the old data, a tag to delimit the new data, then the new data. But I think a variable tag is worse than a fixed tag. With a fixed tag, it is easy for dmesg, syslogd and users to search for the tag and replace it by a better one determined using full runtime resources. E.g., use sed on /var/log/messages to find the last instance of the tag and replace it by something depending on the current context, while a tunable tag must be set earlier and then all utilities and methods for finding and modifying must understand its variations. Bruce From owner-svn-src-all@freebsd.org Fri Aug 10 02:25:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4C33105600D; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77AC2730F9; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 142C72ABF8; Fri, 10 Aug 2018 02:25:35 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f44.google.com with SMTP id u14-v6so5533237lfu.0; Thu, 09 Aug 2018 19:25:35 -0700 (PDT) X-Gm-Message-State: AOUpUlGW7On0+0sHVYAskVS99GUSqC5lUKhn1hVbfygEKGu1zIKX0jy6 13R/u6eZLU68YtJuTzqacWSxx2R7oU+wHfdMKGs= X-Google-Smtp-Source: AA+uWPzMprydIxEsZvtQv3l/RCInGPF6P47UNrHbFXMrpZCwsvvMEC7xgJ32dqLksIqFrjIE60XZ1ujgUd/YdE9ompc= X-Received: by 2002:a19:1586:: with SMTP id 6-v6mr2879549lfv.51.1533867933683; Thu, 09 Aug 2018 19:25:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Thu, 9 Aug 2018 19:25:13 -0700 (PDT) In-Reply-To: <20180810115339.X1652@besplex.bde.org> References: <201808090132.w791WAQm057199@repo.freebsd.org> <20180810081913.P1108@besplex.bde.org> <20180810105239.J1482@besplex.bde.org> <20180810115339.X1652@besplex.bde.org> From: Kyle Evans Date: Thu, 9 Aug 2018 21:25:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337518 - in head/sys: kern sys To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 02:25:36 -0000 On Thu, Aug 9, 2018 at 9:12 PM, Bruce Evans wrote: > On Fri, 10 Aug 2018, Bruce Evans wrote: > >> On Thu, 9 Aug 2018, Kyle Evans wrote: >> ... >>> >>> When you say you call msgbufinit() earlier-- before the static >>> environment is even setup, or at least after that? >> >> >> The above is with a simplified version that first calls msgbufinit() >> after the static env is set up. In other working versions, msgbufinit() >> is called long before the static env is set up. In a commented out >> version, a small MI msgbuf is statically initalized so that some msgbuf >> is always mapped, but msgbufmapped still starts as 0 and msgbufinit() >> must still be called to synchronize. Some synchronization is needed >> since the msgbuf uses broken mutex locking and mutexes use curthread and >> curthread is not initialized early. The simplified versions delay the >> msgbufinit() calls until mutexes are initialized enough, and this >> accidentally moves them after other initializations. >> >> So the tunable is unavailable in the best version :-(. The small initial >> msgbuf could even start with the statically initialized buffer containing >> the tag, and must if it is to be ready to go without a synchronization >> call. > > > The tag can be added later fairly easily, and this order corresponds to > the problem being solved (that we don't know where the data for the new boot > starts iff there is old data): > > - start with a small statically initialized msgbuf. No need for a tag; the > new data starts at the start of the buffer > - write new data to this buffer > - reinit is not really initialization, but supplies data from the previous > boot. Construct the new buffer as the concatenation of the old data, a > tag to delimit the new data, then the new data. > > But I think a variable tag is worse than a fixed tag. With a fixed tag, > it is easy for dmesg, syslogd and users to search for the tag and replace > it by a better one determined using full runtime resources. E.g., use > sed on /var/log/messages to find the last instance of the tag and replace > it by something depending on the current context, while a tunable tag must > be set earlier and then all utilities and methods for finding and modifying > must understand its variations. > I honestly have very low expectations for the tunable's use, but it's a low-cost addition and I find it more useful in a less automated context. One that I've had recently would have been implemented with the following process: 1. Boot -v into installed kernel with normal tag, ---<>-- 2. Briefly review `dmesg`, notice issue with clock driver 3. Install new kernel with changes to said clock driver. Tag it ---<>--, boot -v 4. Review `dmesg` again to observe changes The non-standard tag would certainly be an anomaly, but it gives me the benefit of discerning a standard boot from this one in which I fiddled with the A20 clock driver without having to compile a non-standard boot tag into the kernel. It also gives me a clear indicator as I'm paging through output to quickly at-a-glance realize that I've reached a new (or the correct) boot. I'll likely commit the modified version soon, anyways, and we can hash out any further details after 12 branches. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Fri Aug 10 03:28:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C1A9105794B; Fri, 10 Aug 2018 03:28:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D30A875C19; Fri, 10 Aug 2018 03:28:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B439B22961; Fri, 10 Aug 2018 03:28:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A3SecG067472; Fri, 10 Aug 2018 03:28:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A3Sebe067471; Fri, 10 Aug 2018 03:28:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201808100328.w7A3Sebe067471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Aug 2018 03:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337562 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 337562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 03:28:41 -0000 Author: jhibbits Date: Fri Aug 10 03:28:40 2018 New Revision: 337562 URL: https://svnweb.freebsd.org/changeset/base/337562 Log: powerpc: Add lwsync and ptesync 'sync' opcode variants to ddb disassembler The canonical form of sync is: sync L, E (if Category Elemental Memory Barriers implemented) The L bits (2) denote the type of sync: 0 -- hwsync 1 -- lwsync 2 -- ptesync or hwsync It's been found that most 32-bit CPUs designed prior to the introduction of lwsync will ignore the L bits. However, some cores, particularly the e500 core, will trigger an illegal instruction exception. Adding these variants will make it easier to see which sync variant is actually being used in case of a trap. Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Fri Aug 10 01:43:05 2018 (r337561) +++ head/sys/powerpc/powerpc/db_disasm.c Fri Aug 10 03:28:40 2018 (r337562) @@ -310,7 +310,9 @@ const struct opcode opcodes_1f[] = { { "lfsux", 0xfc0007fe, 0x7c00046e, Op_D | Op_A | Op_B }, { "mfsr", 0xfc0007fe, 0x7c0004a6, Op_D | Op_SR }, { "lswi", 0xfc0007fe, 0x7c0004aa, Op_D | Op_A | Op_NB }, - { "sync", 0xfc0007fe, 0x7c0004ac, 0 }, + { "sync", 0xfc6007fe, 0x7c0004ac, 0 }, + { "lwsync", 0xfc6007fe, 0x7c2004ac, 0 }, + { "ptesync", 0xfc6007fe, 0x7c4004ac, 0 }, { "lfdx", 0xfc0007fe, 0x7c0004ae, Op_D | Op_A | Op_B }, { "lfdux", 0xfc0007fe, 0x7c0004ee, Op_D | Op_A | Op_B }, { "mfsrin", 0xfc0007fe, 0x7c000526, Op_D | Op_B }, From owner-svn-src-all@freebsd.org Fri Aug 10 06:11:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BB7B105D6C5; Fri, 10 Aug 2018 06:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0181D7AB97; Fri, 10 Aug 2018 06:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D86FC24358; Fri, 10 Aug 2018 06:11:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A6B466052963; Fri, 10 Aug 2018 06:11:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A6B45g052949; Fri, 10 Aug 2018 06:11:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201808100611.w7A6B45g052949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Aug 2018 06:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337565 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 337565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 06:11:05 -0000 Author: kib Date: Fri Aug 10 06:11:04 2018 New Revision: 337565 URL: https://svnweb.freebsd.org/changeset/base/337565 Log: MFC r337236: Some updates to vm_map(9). Modified: stable/11/share/man/man9/vm_map.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/vm_map.9 ============================================================================== --- stable/11/share/man/man9/vm_map.9 Fri Aug 10 04:23:13 2018 (r337564) +++ stable/11/share/man/man9/vm_map.9 Fri Aug 10 06:11:04 2018 (r337565) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2011 +.Dd July 3, 2018 .Dt VM_MAP 9 .Os .Sh NAME @@ -62,8 +62,7 @@ struct vm_map { vm_flags_t flags; vm_map_entry_t root; pmap_t pmap; -#define min_offset header.start -#define max_offset header.end + int busy; }; .Ed .Pp @@ -99,29 +98,16 @@ Root node of a binary search tree used for fast lookup .It Va pmap Pointer to the underlying physical map with which this virtual map is associated. -.It Va min_offset -The minimum -.Vt vm_offset_t -in this map. -Programs should never use -.Va header.start -or -.Va header.end -directly, use -.Va min_offset -and -.Va max_offset -instead. -.It Va max_offset -The maximum -.Vt vm_offset_t -in this map. +.It Va busy +Map busy counter, prevents forks. .El .Pp -There is one possible map flag: +Possible map flags: .Bl -tag -width ".Dv MAP_PREFAULT_MADVISE" .It Dv MAP_WIREFUTURE Wire all future pages in this map. +.It Dv MAP_BUSY_WAKEUP +There are waiters for the map busy status. .El .Pp The following flags can be passed to From owner-svn-src-all@freebsd.org Fri Aug 10 06:28:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86057105DDB8; Fri, 10 Aug 2018 06:28:26 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 261CC7B4E5; Fri, 10 Aug 2018 06:28:26 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE64E24657; Fri, 10 Aug 2018 06:28:25 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A6SPYR059662; Fri, 10 Aug 2018 06:28:25 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A6SPvl059661; Fri, 10 Aug 2018 06:28:25 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201808100628.w7A6SPvl059661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Fri, 10 Aug 2018 06:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337566 - head/tools/tools/sysbuild X-SVN-Group: head X-SVN-Commit-Author: phk X-SVN-Commit-Paths: head/tools/tools/sysbuild X-SVN-Commit-Revision: 337566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 06:28:26 -0000 Author: phk Date: Fri Aug 10 06:28:25 2018 New Revision: 337566 URL: https://svnweb.freebsd.org/changeset/base/337566 Log: Make distribution now happens from top of source tree. Silence debugging output Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Fri Aug 10 06:11:04 2018 (r337565) +++ head/tools/tools/sysbuild/sysbuild.sh Fri Aug 10 06:28:25 2018 (r337566) @@ -204,7 +204,7 @@ ports_recurse() ( echo "Missing port $d ($t) (fl $fl) (bd $bd)" 1>&2 continue fi - echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2 + # echo "Flavored port $d ($t) (fl $fl) (bd $bd)" 1>&2 d=$bd fi d=`cd /usr/ports && cd $d && /bin/pwd` @@ -549,7 +549,7 @@ log_it Installworld > ${SBMNT}/_.iw 2>&1 log_it distribution -(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} ${SRCCONF} ) \ +(cd /usr/src && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} ${SRCCONF} ) \ > ${SBMNT}/_.dist 2>&1 log_it Installkernel From owner-svn-src-all@freebsd.org Fri Aug 10 06:42:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9CA2105EEDE; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2567BF02; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB6924989; Fri, 10 Aug 2018 06:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A6gDxl066714; Fri, 10 Aug 2018 06:42:13 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A6g9Mq066690; Fri, 10 Aug 2018 06:42:09 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808100642.w7A6g9Mq066690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 10 Aug 2018 06:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337567 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolari... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys s... X-SVN-Commit-Revision: 337567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 06:42:14 -0000 Author: mmacy Date: Fri Aug 10 06:42:08 2018 New Revision: 337567 URL: https://svnweb.freebsd.org/changeset/base/337567 Log: Performance optimization of AVL tree comparator functions MFV: commit ee36c709c3d5f7040e1bd11f5c75318aa03e789f Author: Gvozden Neskovic Date: Sat Aug 27 20:12:53 2016 +0200 perf: 2.75x faster ddt_entry_compare() First 256bits of ddt_key_t is a block checksum, which are expected to be close to random data. Hence, on average, comparison only needs to look at first few bytes of the keys. To reduce number of conditional jump instructions, the result is computed as: sign(memcmp(k1, k2)). Sign of an integer 'a' can be obtained as: `(0 < a) - (a < 0)` := {-1, 0, 1} , which is computed efficiently. Synthetic performance evaluation of original and new algorithm over 1G random keys on 2.6GHz Intel(R) Xeon(R) CPU E5-2660 v3: old 6.85789 s new 2.49089 s perf: 2.8x faster vdev_queue_offset_compare() and vdev_queue_timestamp_compare() Compute the result directly instead of using conditionals perf: zfs_range_compare() Speedup between 1.1x - 2.5x, depending on compiler version and optimization level. perf: spa_error_entry_compare() `bcmp()` is not suitable for comparator use. Use `memcmp()` instead. perf: 2.8x faster metaslab_compare() and metaslab_rangesize_compare() perf: 2.8x faster zil_bp_compare() perf: 2.8x faster mze_compare() perf: faster dbuf_compare() perf: faster compares in spa_misc perf: 2.8x faster layout_hash_compare() perf: 2.8x faster space_reftree_compare() perf: libzfs: faster avl tree comparators perf: guid_compare() perf: dsl_deadlist_compare() perf: perm_set_compare() perf: 2x faster range_tree_seg_compare() perf: faster unique_compare() perf: faster vdev_cache _compare() perf: faster vdev_uberblock_compare() perf: faster fuid _compare() perf: faster zfs_znode_hold_compare() Signed-off-by: Gvozden Neskovic Signed-off-by: Richard Elling Signed-off-by: Brian Behlendorf Closes #5033 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Aug 10 06:42:08 2018 (r337567) @@ -787,15 +787,13 @@ typedef struct mnttab_node { static int libzfs_mnttab_cache_compare(const void *arg1, const void *arg2) { - const mnttab_node_t *mtn1 = arg1; - const mnttab_node_t *mtn2 = arg2; + const mnttab_node_t *mtn1 = (const mnttab_node_t *)arg1; + const mnttab_node_t *mtn2 = (const mnttab_node_t *)arg2; int rv; rv = strcmp(mtn1->mtn_mt.mnt_special, mtn2->mtn_mt.mnt_special); - if (rv == 0) - return (0); - return (rv > 0 ? 1 : -1); + return (AVL_ISIGN(rv)); } void Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c Fri Aug 10 06:42:08 2018 (r337567) @@ -272,12 +272,7 @@ zfs_snapshot_compare(const void *larg, const void *rar lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG); rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG); - if (lcreate < rcreate) - return (-1); - else if (lcreate > rcreate) - return (+1); - else - return (0); + return (AVL_CMP(lcreate, rcreate)); } int Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Aug 10 06:42:08 2018 (r337567) @@ -489,15 +489,10 @@ typedef struct fsavl_node { static int fsavl_compare(const void *arg1, const void *arg2) { - const fsavl_node_t *fn1 = arg1; - const fsavl_node_t *fn2 = arg2; + const fsavl_node_t *fn1 = (const fsavl_node_t *)arg1; + const fsavl_node_t *fn2 = (const fsavl_node_t *)arg2; - if (fn1->fn_guid > fn2->fn_guid) - return (+1); - else if (fn1->fn_guid < fn2->fn_guid) - return (-1); - else - return (0); + return (AVL_CMP(fn1->fn_guid, fn2->fn_guid)); } /* Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Aug 10 06:42:08 2018 (r337567) @@ -670,6 +670,9 @@ extern zoneid_t getzoneid(void); #define root_mount_wait() do { } while (0) #define root_mounted() (1) +#define noinline __attribute__((noinline)) +#define likely(x) __builtin_expect((x), 1) + struct file { void *dummy; }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1906,14 +1906,10 @@ typedef struct guid_map_entry { static int guid_compare(const void *arg1, const void *arg2) { - const guid_map_entry_t *gmep1 = arg1; - const guid_map_entry_t *gmep2 = arg2; + const guid_map_entry_t *gmep1 = (const guid_map_entry_t *)arg1; + const guid_map_entry_t *gmep2 = (const guid_map_entry_t *)arg2; - if (gmep1->guid < gmep2->guid) - return (-1); - else if (gmep1->guid > gmep2->guid) - return (1); - return (0); + return (AVL_CMP(gmep1->guid, gmep2->guid)); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Aug 10 06:42:08 2018 (r337567) @@ -78,19 +78,13 @@ dbuf_compare(const void *x1, const void *x2) const dmu_buf_impl_t *d1 = x1; const dmu_buf_impl_t *d2 = x2; - if (d1->db_level < d2->db_level) { - return (-1); - } - if (d1->db_level > d2->db_level) { - return (1); - } + int cmp = AVL_CMP(d1->db_level, d2->db_level); + if (likely(cmp)) + return (cmp); - if (d1->db_blkid < d2->db_blkid) { - return (-1); - } - if (d1->db_blkid > d2->db_blkid) { - return (1); - } + cmp = AVL_CMP(d1->db_blkid, d2->db_blkid); + if (likely(cmp)) + return (cmp); if (d1->db_state == DB_SEARCH) { ASSERT3S(d2->db_state, !=, DB_SEARCH); @@ -100,13 +94,7 @@ dbuf_compare(const void *x1, const void *x2) return (1); } - if ((uintptr_t)d1 < (uintptr_t)d2) { - return (-1); - } - if ((uintptr_t)d1 > (uintptr_t)d2) { - return (1); - } - return (0); + return (AVL_PCMP(d1, d2)); } /* ARGSUSED */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c Fri Aug 10 06:42:08 2018 (r337567) @@ -55,15 +55,10 @@ static int dsl_deadlist_compare(const void *arg1, const void *arg2) { - const dsl_deadlist_entry_t *dle1 = arg1; - const dsl_deadlist_entry_t *dle2 = arg2; + const dsl_deadlist_entry_t *dle1 = (const dsl_deadlist_entry_t *)arg1; + const dsl_deadlist_entry_t *dle2 = (const dsl_deadlist_entry_t *)arg2; - if (dle1->dle_mintxg < dle2->dle_mintxg) - return (-1); - else if (dle1->dle_mintxg > dle2->dle_mintxg) - return (+1); - else - return (0); + return (AVL_CMP(dle1->dle_mintxg, dle2->dle_mintxg)); } static void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c Fri Aug 10 06:42:08 2018 (r337567) @@ -384,14 +384,13 @@ typedef struct perm_set { static int perm_set_compare(const void *arg1, const void *arg2) { - const perm_set_t *node1 = arg1; - const perm_set_t *node2 = arg2; + const perm_set_t *node1 = (const perm_set_t *)arg1; + const perm_set_t *node2 = (const perm_set_t *)arg2; int val; val = strcmp(node1->p_setname, node2->p_setname); - if (val == 0) - return (0); - return (val > 0 ? 1 : -1); + + return (AVL_ISIGN(val)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Aug 10 06:42:08 2018 (r337567) @@ -541,8 +541,8 @@ metaslab_class_expandable_space(metaslab_class_t *mc) static int metaslab_compare(const void *x1, const void *x2) { - const metaslab_t *m1 = x1; - const metaslab_t *m2 = x2; + const metaslab_t *m1 = (const metaslab_t *)x1; + const metaslab_t *m2 = (const metaslab_t *)x2; int sort1 = 0; int sort2 = 0; @@ -568,22 +568,13 @@ metaslab_compare(const void *x1, const void *x2) if (sort1 > sort2) return (1); - if (m1->ms_weight < m2->ms_weight) - return (1); - if (m1->ms_weight > m2->ms_weight) - return (-1); + int cmp = AVL_CMP(m2->ms_weight, m1->ms_weight); + if (likely(cmp)) + return (cmp); - /* - * If the weights are identical, use the offset to force uniqueness. - */ - if (m1->ms_start < m2->ms_start) - return (-1); - if (m1->ms_start > m2->ms_start) - return (1); + IMPLY(AVL_CMP(m1->ms_start, m2->ms_start) == 0, m1 == m2); - ASSERT3P(m1, ==, m2); - - return (0); + return (AVL_CMP(m1->ms_start, m2->ms_start)); } /* @@ -1195,18 +1186,14 @@ metaslab_rangesize_compare(const void *x1, const void uint64_t rs_size1 = r1->rs_end - r1->rs_start; uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (rs_size1 < rs_size2) - return (-1); - if (rs_size1 > rs_size2) - return (1); + int cmp = AVL_CMP(rs_size1, rs_size2); + if (likely(cmp)) + return (cmp); if (r1->rs_start < r2->rs_start) return (-1); - if (r1->rs_start > r2->rs_start) - return (1); - - return (0); + return (AVL_CMP(r1->rs_start, r2->rs_start)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Aug 10 06:42:08 2018 (r337567) @@ -242,31 +242,23 @@ sa_cache_fini(void) static int layout_num_compare(const void *arg1, const void *arg2) { - const sa_lot_t *node1 = arg1; - const sa_lot_t *node2 = arg2; + const sa_lot_t *node1 = (const sa_lot_t *)arg1; + const sa_lot_t *node2 = (const sa_lot_t *)arg2; - if (node1->lot_num > node2->lot_num) - return (1); - else if (node1->lot_num < node2->lot_num) - return (-1); - return (0); + return (AVL_CMP(node1->lot_num, node2->lot_num)); } static int layout_hash_compare(const void *arg1, const void *arg2) { - const sa_lot_t *node1 = arg1; - const sa_lot_t *node2 = arg2; + const sa_lot_t *node1 = (const sa_lot_t *)arg1; + const sa_lot_t *node2 = (const sa_lot_t *)arg2; - if (node1->lot_hash > node2->lot_hash) - return (1); - if (node1->lot_hash < node2->lot_hash) - return (-1); - if (node1->lot_instance > node2->lot_instance) - return (1); - if (node1->lot_instance < node2->lot_instance) - return (-1); - return (0); + int cmp = AVL_CMP(node1->lot_hash, node2->lot_hash); + if (likely(cmp)) + return (cmp); + + return (AVL_CMP(node1->lot_instance, node2->lot_instance)); } boolean_t Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 06:42:08 2018 (r337567) @@ -905,19 +905,14 @@ spa_change_guid(spa_t *spa) static int spa_error_entry_compare(const void *a, const void *b) { - spa_error_entry_t *sa = (spa_error_entry_t *)a; - spa_error_entry_t *sb = (spa_error_entry_t *)b; + const spa_error_entry_t *sa = (const spa_error_entry_t *)a; + const spa_error_entry_t *sb = (const spa_error_entry_t *)b; int ret; - ret = bcmp(&sa->se_bookmark, &sb->se_bookmark, + ret = memcmp(&sa->se_bookmark, &sb->se_bookmark, sizeof (zbookmark_phys_t)); - if (ret < 0) - return (-1); - else if (ret > 0) - return (1); - else - return (0); + return (AVL_ISIGN(ret)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1016,18 +1016,13 @@ typedef struct spa_aux { int aux_count; } spa_aux_t; -static int +static inline int spa_aux_compare(const void *a, const void *b) { - const spa_aux_t *sa = a; - const spa_aux_t *sb = b; + const spa_aux_t *sa = (const spa_aux_t *)a; + const spa_aux_t *sb = (const spa_aux_t *)b; - if (sa->aux_guid < sb->aux_guid) - return (-1); - else if (sa->aux_guid > sb->aux_guid) - return (1); - else - return (0); + return (AVL_CMP(sa->aux_guid, sb->aux_guid)); } void @@ -2053,11 +2048,8 @@ spa_name_compare(const void *a1, const void *a2) int s; s = strcmp(s1->spa_name, s2->spa_name); - if (s > 0) - return (1); - if (s < 0) - return (-1); - return (0); + + return (AVL_ISIGN(s)); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c Fri Aug 10 06:42:08 2018 (r337567) @@ -54,20 +54,14 @@ static int space_reftree_compare(const void *x1, const void *x2) { - const space_ref_t *sr1 = x1; - const space_ref_t *sr2 = x2; + const space_ref_t *sr1 = (const space_ref_t *)x1; + const space_ref_t *sr2 = (const space_ref_t *)x2; - if (sr1->sr_offset < sr2->sr_offset) - return (-1); - if (sr1->sr_offset > sr2->sr_offset) - return (1); + int cmp = AVL_CMP(sr1->sr_offset, sr2->sr_offset); + if (likely(cmp)) + return (cmp); - if (sr1 < sr2) - return (-1); - if (sr1 > sr2) - return (1); - - return (0); + return (AVL_PCMP(sr1, sr2)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Fri Aug 10 06:42:08 2018 (r337567) @@ -146,4 +146,7 @@ extern struct mtx zfs_debug_mtx; #define sys_shutdown rebooting +#define noinline __attribute__((noinline)) +#define likely(x) __builtin_expect((x), 1) + #endif /* _SYS_ZFS_CONTEXT_H */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/unique.c Fri Aug 10 06:42:08 2018 (r337567) @@ -42,14 +42,10 @@ typedef struct unique { static int unique_compare(const void *a, const void *b) { - const unique_t *una = a; - const unique_t *unb = b; + const unique_t *una = (const unique_t *)a; + const unique_t *unb = (const unique_t *)b; - if (una->un_value < unb->un_value) - return (-1); - if (una->un_value > unb->un_value) - return (+1); - return (0); + return (AVL_CMP(una->un_value, unb->un_value)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Aug 10 06:42:08 2018 (r337567) @@ -1047,19 +1047,13 @@ retry: * among uberblocks with equal txg, choose the one with the latest timestamp. */ static int -vdev_uberblock_compare(uberblock_t *ub1, uberblock_t *ub2) +vdev_uberblock_compare(const uberblock_t *ub1, const uberblock_t *ub2) { - if (ub1->ub_txg < ub2->ub_txg) - return (-1); - if (ub1->ub_txg > ub2->ub_txg) - return (1); + int cmp = AVL_CMP(ub1->ub_txg, ub2->ub_txg); + if (likely(cmp)) + return (cmp); - if (ub1->ub_timestamp < ub2->ub_timestamp) - return (-1); - if (ub1->ub_timestamp > ub2->ub_timestamp) - return (1); - - return (0); + return (AVL_CMP(ub1->ub_timestamp, ub2->ub_timestamp)); } struct ubl_cbdata { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Aug 10 06:42:08 2018 (r337567) @@ -311,20 +311,15 @@ sysctl_zfs_async_write_active_max_dirty_percent(SYSCTL int vdev_queue_offset_compare(const void *x1, const void *x2) { - const zio_t *z1 = x1; - const zio_t *z2 = x2; + const zio_t *z1 = (const zio_t *)x1; + const zio_t *z2 = (const zio_t *)x2; - if (z1->io_offset < z2->io_offset) - return (-1); - if (z1->io_offset > z2->io_offset) - return (1); + int cmp = AVL_CMP(z1->io_offset, z2->io_offset); - if (z1 < z2) - return (-1); - if (z1 > z2) - return (1); + if (likely(cmp)) + return (cmp); - return (0); + return (AVL_PCMP(z1, z2)); } static inline avl_tree_t * Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c Fri Aug 10 06:42:08 2018 (r337567) @@ -281,15 +281,11 @@ mze_compare(const void *arg1, const void *arg2) const mzap_ent_t *mze1 = arg1; const mzap_ent_t *mze2 = arg2; - if (mze1->mze_hash > mze2->mze_hash) - return (+1); - if (mze1->mze_hash < mze2->mze_hash) - return (-1); - if (mze1->mze_cd > mze2->mze_cd) - return (+1); - if (mze1->mze_cd < mze2->mze_cd) - return (-1); - return (0); + int cmp = AVL_CMP(mze1->mze_hash, mze2->mze_hash); + if (likely(cmp)) + return (cmp); + + return (AVL_CMP(mze1->mze_cd, mze2->mze_cd)); } static int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c Fri Aug 10 06:42:08 2018 (r337567) @@ -71,14 +71,10 @@ static char *nulldomain = ""; static int idx_compare(const void *arg1, const void *arg2) { - const fuid_domain_t *node1 = arg1; - const fuid_domain_t *node2 = arg2; + const fuid_domain_t *node1 = (const fuid_domain_t *)arg1; + const fuid_domain_t *node2 = (const fuid_domain_t *)arg2; - if (node1->f_idx < node2->f_idx) - return (-1); - else if (node1->f_idx > node2->f_idx) - return (1); - return (0); + return (AVL_CMP(node1->f_idx, node2->f_idx)); } /* @@ -87,14 +83,13 @@ idx_compare(const void *arg1, const void *arg2) static int domain_compare(const void *arg1, const void *arg2) { - const fuid_domain_t *node1 = arg1; - const fuid_domain_t *node2 = arg2; + const fuid_domain_t *node1 = (const fuid_domain_t *)arg1; + const fuid_domain_t *node2 = (const fuid_domain_t *)arg2; int val; val = strcmp(node1->f_ksid->kd_name, node2->f_ksid->kd_name); - if (val == 0) - return (0); - return (val > 0 ? 1 : -1); + + return (AVL_ISIGN(val)); } void Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Aug 10 06:42:08 2018 (r337567) @@ -594,12 +594,8 @@ zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len) int zfs_range_compare(const void *arg1, const void *arg2) { - const rl_t *rl1 = arg1; - const rl_t *rl2 = arg2; + const rl_t *rl1 = (const rl_t *)arg1; + const rl_t *rl2 = (const rl_t *)arg2; - if (rl1->r_off > rl2->r_off) - return (1); - if (rl1->r_off < rl2->r_off) - return (-1); - return (0); + return (AVL_CMP(rl1->r_off, rl2->r_off)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Fri Aug 10 06:42:08 2018 (r337567) @@ -131,17 +131,11 @@ zil_bp_compare(const void *x1, const void *x2) const dva_t *dva1 = &((zil_bp_node_t *)x1)->zn_dva; const dva_t *dva2 = &((zil_bp_node_t *)x2)->zn_dva; - if (DVA_GET_VDEV(dva1) < DVA_GET_VDEV(dva2)) - return (-1); - if (DVA_GET_VDEV(dva1) > DVA_GET_VDEV(dva2)) - return (1); + int cmp = AVL_CMP(DVA_GET_VDEV(dva1), DVA_GET_VDEV(dva2)); + if (likely(cmp)) + return (cmp); - if (DVA_GET_OFFSET(dva1) < DVA_GET_OFFSET(dva2)) - return (-1); - if (DVA_GET_OFFSET(dva1) > DVA_GET_OFFSET(dva2)) - return (1); - - return (0); + return (AVL_CMP(DVA_GET_OFFSET(dva1), DVA_GET_OFFSET(dva2))); } static void @@ -503,12 +497,7 @@ zil_lwb_vdev_compare(const void *x1, const void *x2) const uint64_t v1 = ((zil_vdev_node_t *)x1)->zv_vdev; const uint64_t v2 = ((zil_vdev_node_t *)x2)->zv_vdev; - if (v1 < v2) - return (-1); - if (v1 > v2) - return (1); - - return (0); + return (AVL_CMP(v1, v2)); } static lwb_t * @@ -1626,12 +1615,7 @@ zil_aitx_compare(const void *x1, const void *x2) const uint64_t o1 = ((itx_async_node_t *)x1)->ia_foid; const uint64_t o2 = ((itx_async_node_t *)x2)->ia_foid; - if (o1 < o2) - return (-1); - if (o1 > o2) - return (1); - - return (0); + return (AVL_CMP(o1, o2)); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri Aug 10 06:28:25 2018 (r337566) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h Fri Aug 10 06:42:08 2018 (r337567) @@ -107,6 +107,14 @@ extern "C" { /* + * AVL comparator helpers + */ +#define AVL_ISIGN(a) (((a) > 0) - ((a) < 0)) +#define AVL_CMP(a, b) (((a) > (b)) - ((a) < (b))) +#define AVL_PCMP(a, b) \ + (((uintptr_t)(a) > (uintptr_t)(b)) - ((uintptr_t)(a) < (uintptr_t)(b))) + +/* * Type used for the root of the AVL tree. */ typedef struct avl_tree avl_tree_t; From owner-svn-src-all@freebsd.org Fri Aug 10 07:24:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C54F105F9C4; Fri, 10 Aug 2018 07:24:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDF777CF61; Fri, 10 Aug 2018 07:24:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C96C825019; Fri, 10 Aug 2018 07:24:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7A7O1rr090208; Fri, 10 Aug 2018 07:24:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7A7O1aQ090207; Fri, 10 Aug 2018 07:24:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808100724.w7A7O1aQ090207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Aug 2018 07:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337568 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 337568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 07:24:02 -0000 Author: ae Date: Fri Aug 10 07:24:01 2018 New Revision: 337568 URL: https://svnweb.freebsd.org/changeset/base/337568 Log: Remove unneeded ipsec-related includes. Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D16637 Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Fri Aug 10 06:42:08 2018 (r337567) +++ head/sys/netinet/tcp_hpts.c Fri Aug 10 07:24:01 2018 (r337568) @@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipsec.h" #include "opt_tcpdebug.h" /** * Some notes about usage. @@ -164,10 +163,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef ipsec -#include -#include -#endif /* ipsec */ #include "opt_rss.h" MALLOC_DEFINE(M_TCPHPTS, "tcp_hpts", "TCP hpts"); From owner-svn-src-all@freebsd.org Fri Aug 10 10:37:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46F1310661F2; Fri, 10 Aug 2018 10:37:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECFF98470E; Fri, 10 Aug 2018 10:37:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE02526F72; Fri, 10 Aug 2018 10:37:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AAbPIP091446; Fri, 10 Aug 2018 10:37:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AAbPjX091445; Fri, 10 Aug 2018 10:37:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201808101037.w7AAbPjX091445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Aug 2018 10:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337569 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 337569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 10:37:26 -0000 Author: emaste Date: Fri Aug 10 10:37:25 2018 New Revision: 337569 URL: https://svnweb.freebsd.org/changeset/base/337569 Log: readelf: display NT_GNU_PROPERTY_TYPE_0 note name NT_GNU_PROPERTY_TYPE_0 in a .note.gnu.property section "contains a program property note which describes special handling requirements for linker and run-time loader." (from the System V Application Binary Interface - Linux Extensions") Intel CET uses two processor-specific program properties in NT_GNU_PROPERTY_TYPE_0: GNU_PROPERTY_X86_FEATURE_1_IBT to indicate that all executable sections are compatible with Indirect Branch Tracking, and GNU_PROPERTY_X86_FEATURE_1_SHSTK to indicate that sections are compatible with shadow stack. A later change should add decoding of the individual properties. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 07:24:01 2018 (r337568) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Aug 10 10:37:25 2018 (r337569) @@ -1189,6 +1189,7 @@ note_type_gnu(unsigned int nt) case 2: return "NT_GNU_HWCAP (Hardware capabilities)"; case 3: return "NT_GNU_BUILD_ID (Build id set by ld(1))"; case 4: return "NT_GNU_GOLD_VERSION (GNU gold version)"; + case 5: return "NT_GNU_PROPERTY_TYPE_0"; default: return (note_type_unknown(nt)); } } From owner-svn-src-all@freebsd.org Fri Aug 10 13:06:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED4F4106A78E; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95E258A0CD; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7234E836; Fri, 10 Aug 2018 13:06:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AD6Eof068613; Fri, 10 Aug 2018 13:06:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AD6EnG068612; Fri, 10 Aug 2018 13:06:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101306.w7AD6EnG068612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337570 - head/sys/dev/bwi X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/bwi X-SVN-Commit-Revision: 337570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 13:06:15 -0000 Author: kevans Date: Fri Aug 10 13:06:14 2018 New Revision: 337570 URL: https://svnweb.freebsd.org/changeset/base/337570 Log: bwi(4): Set ic->ic_softc before bwi_getradiocaps to avoid bad deref Submitted by: François Revol Obtained from: Haiku (ba88131cfde64e21bedb4ebedd699cfa5e7fd314) MFC after: 1 week Modified: head/sys/dev/bwi/if_bwi.c Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Fri Aug 10 10:37:25 2018 (r337569) +++ head/sys/dev/bwi/if_bwi.c Fri Aug 10 13:06:14 2018 (r337570) @@ -490,10 +490,12 @@ bwi_attach(struct bwi_softc *sc) BWI_SPROM_CARD_INFO_LOCALE); DPRINTF(sc, BWI_DBG_ATTACH, "locale: %d\n", sc->sc_locale); /* XXX use locale */ + + ic->ic_softc = sc; + bwi_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, ic->ic_channels); - ic->ic_softc = sc; ic->ic_name = device_get_nameunit(dev); ic->ic_caps = IEEE80211_C_STA | IEEE80211_C_SHSLOT | From owner-svn-src-all@freebsd.org Fri Aug 10 13:32:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0077C106B264; Fri, 10 Aug 2018 13:32:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB3BC8AE01; Fri, 10 Aug 2018 13:32:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D072CC9; Fri, 10 Aug 2018 13:32:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADW24k081557; Fri, 10 Aug 2018 13:32:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADW2Z6081556; Fri, 10 Aug 2018 13:32:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101332.w7ADW2Z6081556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337571 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 337571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 13:32:03 -0000 Author: kevans Date: Fri Aug 10 13:32:02 2018 New Revision: 337571 URL: https://svnweb.freebsd.org/changeset/base/337571 Log: net80211: Drain ageq before cleaning it up. The comment above ieee80211_ageq_cleanup specifically notes that the queue is assumed to be empty, and in order to make it so, ieee80211_ageq_drain must be used. Submitted by: Augustin Cavalier Obtained from: Haiku (dffc3e235360cd7b71261239ee8507b7d62a1471) MFC after: 1 week Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Aug 10 13:06:14 2018 (r337570) +++ head/sys/net80211/ieee80211_node.c Fri Aug 10 13:32:02 2018 (r337571) @@ -137,6 +137,7 @@ ieee80211_node_detach(struct ieee80211com *ic) callout_drain(&ic->ic_inact); ieee80211_node_table_cleanup(&ic->ic_sta); + ieee80211_ageq_drain(&ic->ic_stageq); ieee80211_ageq_cleanup(&ic->ic_stageq); } From owner-svn-src-all@freebsd.org Fri Aug 10 13:34:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2AC4106B339; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 636938AFFF; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E9C1CFE; Fri, 10 Aug 2018 13:34:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADYO3K084144; Fri, 10 Aug 2018 13:34:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADYOBr084143; Fri, 10 Aug 2018 13:34:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101334.w7ADYOBr084143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337572 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 337572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 13:34:24 -0000 Author: kevans Date: Fri Aug 10 13:34:23 2018 New Revision: 337572 URL: https://svnweb.freebsd.org/changeset/base/337572 Log: ieee8021_node: fix whitespace issues Submitted by: Augustin Cavalier Obtained from: Haiku (dffc3e235360cd7b71261239ee8507b7d62a1471) MFC after: 1 week Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Fri Aug 10 13:32:02 2018 (r337571) +++ head/sys/net80211/ieee80211_node.c Fri Aug 10 13:34:23 2018 (r337572) @@ -32,13 +32,13 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" #include -#include -#include +#include +#include #include #include #include - + #include #include #include @@ -203,7 +203,7 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) } } -/* +/* * Port authorize/unauthorize interfaces for use by an authenticator. */ @@ -379,7 +379,7 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen); #endif } - /* + /* * Fix the channel and related attributes. */ /* clear DFS CAC state on previous channel */ @@ -571,8 +571,8 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee8 printf("%s\n", fail & 0x10 ? "!" : ""); } #endif /* IEEE80211_DEBUG */ - + int ieee80211_ibss_merge_check(struct ieee80211_node *ni) { @@ -880,7 +880,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the * mode is locked. - */ + */ ieee80211_reset_erp(ic); ieee80211_wme_initparams(vap); @@ -1678,7 +1678,7 @@ ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap, /* * In adhoc demo mode there are no management * frames to use to discover neighbor capabilities, - * so blindly propagate the local configuration + * so blindly propagate the local configuration * so we can do interesting things (e.g. use * WME to disable ACK's). */ @@ -2352,7 +2352,7 @@ timeout_stations(void *arg __unused, struct ieee80211_ /* XXX before inact decrement? */ if (ni == vap->iv_bss) return; - if (ni->ni_associd != 0 || + if (ni->ni_associd != 0 || (vap->iv_opmode == IEEE80211_M_IBSS || vap->iv_opmode == IEEE80211_M_AHDEMO)) { /* From owner-svn-src-all@freebsd.org Fri Aug 10 13:38:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6315106B3EC; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE898B1F3; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CD20D06; Fri, 10 Aug 2018 13:38:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ADcNkJ084396; Fri, 10 Aug 2018 13:38:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ADcNZr084395; Fri, 10 Aug 2018 13:38:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101338.w7ADcNZr084395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 13:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337573 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 337573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 13:38:25 -0000 Author: kevans Date: Fri Aug 10 13:38:23 2018 New Revision: 337573 URL: https://svnweb.freebsd.org/changeset/base/337573 Log: ath: Minor style cleanups device_printf => DPRINTF and two whitespace adjustments Submitted by: Augustin Cavalier Obtained from: Haiku (4a88aa503ad4155a20931e263d24343043994ea9) MFC after: 1 week Modified: head/sys/dev/ath/if_ath_rx_edma.c Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Fri Aug 10 13:34:23 2018 (r337572) +++ head/sys/dev/ath/if_ath_rx_edma.c Fri Aug 10 13:38:23 2018 (r337573) @@ -168,7 +168,7 @@ ath_edma_stoprecv(struct ath_softc *sc, int dodelay) ath_hal_setrxfilter(ah, 0); /* - * + * */ if (ath_hal_stopdmarecv(ah) == AH_TRUE) sc->sc_rx_stopped = 1; @@ -729,7 +729,7 @@ ath_edma_rxbuf_alloc(struct ath_softc *sc) bf = TAILQ_FIRST(&sc->sc_rxbuf); /* XXX shouldn't happen upon startup? */ if (bf == NULL) { - device_printf(sc->sc_dev, "%s: nothing on rxbuf?!\n", + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: nothing on rxbuf?!\n", __func__); return (NULL); } @@ -810,7 +810,7 @@ ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUE bf = ath_edma_rxbuf_alloc(sc); /* XXX should ensure the FIFO is not NULL? */ if (bf == NULL) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_EDMA_RX, "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n", __func__, qtype, @@ -927,7 +927,7 @@ ath_edma_rxfifo_free(struct ath_softc *sc, HAL_RX_QUEU device_printf(sc->sc_dev, "%s: called; qtype=%d\n", __func__, qtype); - + free(re->m_fifo, M_ATHDEV); return (0); From owner-svn-src-all@freebsd.org Fri Aug 10 14:10:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744E1106BE1F; Fri, 10 Aug 2018 14:10:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B0438C440; Fri, 10 Aug 2018 14:10:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082FB120C; Fri, 10 Aug 2018 14:10:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AEAMTo000391; Fri, 10 Aug 2018 14:10:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AEAMl0000389; Fri, 10 Aug 2018 14:10:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201808101410.w7AEAMl0000389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Aug 2018 14:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337574 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 337574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 14:10:23 -0000 Author: ae Date: Fri Aug 10 14:10:22 2018 New Revision: 337574 URL: https://svnweb.freebsd.org/changeset/base/337574 Log: Restore the behaviour changed in r337536, when bad `ipfw delete` command returns error. Now -q option only makes it quiet. And when -f flag is specified, the command will ignore errors and continue executing with next batched command. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Aug 10 13:38:23 2018 (r337573) +++ head/sbin/ipfw/ipfw.8 Fri Aug 10 14:10:22 2018 (r337574) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2018 +.Dd August 10, 2018 .Dt IPFW 8 .Os .Sh NAME @@ -315,10 +315,15 @@ When listing and .Fl d is specified, also show expired dynamic rules. .It Fl f -Do not ask for confirmation for commands that can cause problems -if misused, i.e., +Run without prompting for confirmation for commands that can cause problems if misused, +i.e., .Cm flush . If there is no tty associated with the process, this is implied. +The +.Cm delete +command with this flag ignores possible errors, +i.e., nonexistent rule number. +And for batched commands execution continues with the next command. .It Fl i When listing a table (see the .Sx LOOKUP TABLES Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Aug 10 13:38:23 2018 (r337573) +++ head/sbin/ipfw/ipfw2.c Fri Aug 10 14:10:22 2018 (r337574) @@ -3314,7 +3314,7 @@ ipfw_delete(char *av[]) } } } - if (exitval != EX_OK && co.do_quiet == 0) + if (exitval != EX_OK && co.do_force == 0) exit(exitval); } From owner-svn-src-all@freebsd.org Fri Aug 10 14:47:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B50D8106CE2B; Fri, 10 Aug 2018 14:47:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B1B08DBD4; Fri, 10 Aug 2018 14:47:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D9E5187D; Fri, 10 Aug 2018 14:47:17 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AElH42021335; Fri, 10 Aug 2018 14:47:17 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AElHrV021334; Fri, 10 Aug 2018 14:47:17 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201808101447.w7AElHrV021334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 10 Aug 2018 14:47:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337575 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 337575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 14:47:17 -0000 Author: oshogbo Date: Fri Aug 10 14:47:16 2018 New Revision: 337575 URL: https://svnweb.freebsd.org/changeset/base/337575 Log: MFC r337189: bhyve: set title before entering capability mode PR: 230082 Submitted by: Yuichiro NAITO Modified: stable/11/usr.sbin/bhyve/bhyverun.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/11/usr.sbin/bhyve/bhyverun.c Fri Aug 10 14:10:22 2018 (r337574) +++ stable/11/usr.sbin/bhyve/bhyverun.c Fri Aug 10 14:47:16 2018 (r337575) @@ -1026,6 +1026,11 @@ main(int argc, char *argv[]) if (lpc_bootrom()) fwctl_init(); + /* + * Change the proc title to include the VM name. + */ + setproctitle("%s", vmname); + #ifndef WITHOUT_CAPSICUM bhyve_caph_cache_catpages(); @@ -1036,11 +1041,6 @@ main(int argc, char *argv[]) errx(EX_OSERR, "cap_enter() failed"); #endif - /* - * Change the proc title to include the VM name. - */ - setproctitle("%s", vmname); - /* * Add CPU 0 */ From owner-svn-src-all@freebsd.org Fri Aug 10 15:16:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6024106DB46; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88C348F100; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EFBD1D6D; Fri, 10 Aug 2018 15:16:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGWOD037304; Fri, 10 Aug 2018 15:16:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGV3n037298; Fri, 10 Aug 2018 15:16:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGV3n037298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337576 - in head: include lib/libc/gen sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: include lib/libc/gen sys/sys X-SVN-Commit-Revision: 337576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:16:33 -0000 Author: imp Date: Fri Aug 10 15:16:30 2018 New Revision: 337576 URL: https://svnweb.freebsd.org/changeset/base/337576 Log: Bring in timespce_get form NetBSD. Bring in the functionality for timespec_get from NetBSD. I've lightly edited the .c file to remove _DIAGASSERT because FreeBSD doesn't have that functionality and the typical #define'ing it to assert isn't right here. The man page is verbatim from NetBSD, but will be revised as part of a larger cleanup of the time man pages (they are inconsistent and vague in all the wrong places). Differential Review: https://reviews.freebsd.org/D16649 Added: head/lib/libc/gen/timespec_get.3 (contents, props changed) head/lib/libc/gen/timespec_get.c (contents, props changed) Modified: head/include/time.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/sys/sys/param.h Modified: head/include/time.h ============================================================================== --- head/include/time.h Fri Aug 10 14:47:16 2018 (r337575) +++ head/include/time.h Fri Aug 10 15:16:30 2018 (r337576) @@ -206,6 +206,11 @@ time_t posix2time(time_t t); #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include #endif + +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ +#define TIME_UTC 1 /* time elapsed since epoch */ +int timespec_get(struct timespec *ts, int base); + __END_DECLS #endif /* !_TIME_H_ */ Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Aug 10 14:47:16 2018 (r337575) +++ head/lib/libc/gen/Makefile.inc Fri Aug 10 15:16:30 2018 (r337576) @@ -135,6 +135,7 @@ SRCS+= __getosreldate.c \ termios.c \ time.c \ times.c \ + timespec_get.c \ timezone.c \ tls.c \ ttyname.c \ @@ -299,6 +300,7 @@ MAN+= alarm.3 \ tcsetsid.3 \ time.3 \ times.3 \ + timespec_get.3 \ timezone.3 \ ttyname.3 \ tzset.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Aug 10 14:47:16 2018 (r337575) +++ head/lib/libc/gen/Symbol.map Fri Aug 10 15:16:30 2018 (r337576) @@ -420,6 +420,7 @@ FBSD_1.5 { scandir_b; sem_clockwait_np; setproctitle_fast; + timespec_get; }; FBSDprivate_1.0 { Added: head/lib/libc/gen/timespec_get.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:30 2018 (r337576) @@ -0,0 +1,76 @@ +.\" $NetBSD: timespec_get.3,v 1.2 2016/10/04 10:46:40 wiz Exp $ +.\" +.\" Copyright (c) 2016 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Kamil Rytarowski. +.\" +.\" 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 4, 2016 +.Dt TIMESPEC_GET 3 +.Os +.Sh NAME +.Nm timespec_get +.Nd get current calendar time +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In time.h +.Vt #define TIME_UTC 1 +.Ft int +.Fn timespec_get "struct timespec *ts" "int base" +.Sh DESCRIPTION +The +.Nm +function sets the interval pointed to by +.Fa ts +to hold the current calendar time based on the specified time base in +.Fa base . +.Pp +Currently the only supported valid base is +.Dv TIME_UTC . +It returns time elapsed since epoch. +.Sh RETURN VALUES +The +.Nm +function returns the passed value of +.Fa base +if successful, otherwise +.Dv 0 +on failure. +.\" .Sh ERRORS +.Sh SEE ALSO +.Xr clock_gettime 2 +.Sh STANDARDS +The +.Nm +function conforms to +.St -isoC-2011 . +.Sh HISTORY +This interface first appeared in +.Nx 8 . +.Sh AUTHORS +.An Kamil Rytarowski Aq Mt kamil@NetBSD.org Added: head/lib/libc/gen/timespec_get.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:30 2018 (r337576) @@ -0,0 +1,57 @@ +/* $NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $ */ + +/*- + * Copyright (c) 2016 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Kamil Rytarowski. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 +__RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); +__FBSDID("$FreeBSD$"); + +#include +#include + +/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ + +int +timespec_get(struct timespec *ts, int base) +{ + +/* _DIAGASSERT(ts != NULL); */ + + switch (base) { + case TIME_UTC: + if (clock_gettime(CLOCK_REALTIME, ts) == -1) + return 0; + break; + default: + return 0; + } + + return base; +} Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Aug 10 14:47:16 2018 (r337575) +++ head/sys/sys/param.h Fri Aug 10 15:16:30 2018 (r337576) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200076 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200077 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Aug 10 15:16:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63660106DB68; Fri, 10 Aug 2018 15:16:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A13A58F1AE; Fri, 10 Aug 2018 15:16:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 074BF1D6E; Fri, 10 Aug 2018 15:16:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGa2H037357; Fri, 10 Aug 2018 15:16:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGakX037356; Fri, 10 Aug 2018 15:16:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGakX037356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337577 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:16:39 -0000 Author: imp Date: Fri Aug 10 15:16:36 2018 New Revision: 337577 URL: https://svnweb.freebsd.org/changeset/base/337577 Log: Remove assert.h and commented out _DIAGASSERT. Remove assert.h and _DIAGASSERT to create a paper-trail of changes from NetBSD. Specifically didn't fix other style issues since I don't want this to diverge from the NetBSD original too much and that's too niggling a change to be worth future merge hassles. Differential Review: https://reviews.freebsd.org/D16649 Modified: head/lib/libc/gen/timespec_get.c Modified: head/lib/libc/gen/timespec_get.c ============================================================================== --- head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:30 2018 (r337576) +++ head/lib/libc/gen/timespec_get.c Fri Aug 10 15:16:36 2018 (r337577) @@ -33,7 +33,6 @@ __RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); __FBSDID("$FreeBSD$"); -#include #include /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ @@ -41,8 +40,6 @@ __FBSDID("$FreeBSD$"); int timespec_get(struct timespec *ts, int base) { - -/* _DIAGASSERT(ts != NULL); */ switch (base) { case TIME_UTC: From owner-svn-src-all@freebsd.org Fri Aug 10 15:16:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6E0B106DB83; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C20D8F1E6; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EF191D6F; Fri, 10 Aug 2018 15:16:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFGfOJ037411; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFGfjx037410; Fri, 10 Aug 2018 15:16:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201808101516.w7AFGfjx037410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Aug 2018 15:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337578 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 337578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:16:42 -0000 Author: imp Date: Fri Aug 10 15:16:41 2018 New Revision: 337578 URL: https://svnweb.freebsd.org/changeset/base/337578 Log: Update man page to include FreeBSD-specific details. While this implements a standards-conforming C11 function, there's implementation details the programmer needs to know. Include those here. Make changes inspired by comments on the initial review as well, though mostly this involves stealing the epoch verbage from gettimeofday(2). Add myself to authors since I've now changed a substantial amount of this man page. Modified: head/lib/libc/gen/timespec_get.3 Modified: head/lib/libc/gen/timespec_get.3 ============================================================================== --- head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:36 2018 (r337577) +++ head/lib/libc/gen/timespec_get.3 Fri Aug 10 15:16:41 2018 (r337578) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 4, 2016 +.Dd August 10, 2018 .Dt TIMESPEC_GET 3 .Os .Sh NAME @@ -39,7 +39,6 @@ .Lb libc .Sh SYNOPSIS .In time.h -.Vt #define TIME_UTC 1 .Ft int .Fn timespec_get "struct timespec *ts" "int base" .Sh DESCRIPTION @@ -50,9 +49,14 @@ function sets the interval pointed to by to hold the current calendar time based on the specified time base in .Fa base . .Pp -Currently the only supported valid base is -.Dv TIME_UTC . -It returns time elapsed since epoch. +The base +.Dv TIME_UTC +returns the time since the epoch. +This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970. +In +.Fx , +this corresponds to +.Dv CLOCK_REALTIME . .Sh RETURN VALUES The .Nm @@ -61,16 +65,22 @@ function returns the passed value of if successful, otherwise .Dv 0 on failure. -.\" .Sh ERRORS .Sh SEE ALSO -.Xr clock_gettime 2 +.Xr gettimeofday 2 , +.Xr clock_gettime 2 , +.Xr time 3 .Sh STANDARDS The .Nm -function conforms to +function with a +.Fa base +of +.Dv TIME_UTC +conforms to .St -isoC-2011 . .Sh HISTORY This interface first appeared in -.Nx 8 . +.Fx 12 . .Sh AUTHORS .An Kamil Rytarowski Aq Mt kamil@NetBSD.org +.An Warner Losh Aq Mt imp@FreeBSD.org From owner-svn-src-all@freebsd.org Fri Aug 10 15:29:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CCFB106E08F; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 413898FAEB; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E7141F05; Fri, 10 Aug 2018 15:29:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFT674042415; Fri, 10 Aug 2018 15:29:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFT69Y042414; Fri, 10 Aug 2018 15:29:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101529.w7AFT69Y042414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 15:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337579 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:29:07 -0000 Author: kevans Date: Fri Aug 10 15:29:06 2018 New Revision: 337579 URL: https://svnweb.freebsd.org/changeset/base/337579 Log: boot tagging: minor fixes msgbufinit may be called multiple times as we initialize the msgbuf into a progressively larger buffer. This doesn't happen as of now on head, but it may happen in the future and we generally support this. As such, only print the boot tag if we've just initialized the buffer for the first time. The boot tag also now has a newline appended to it for better visibility, and has been switched to a normal printf, by requesto f bde, after we've denoted that the msgbuf is mapped. Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 10 15:16:41 2018 (r337578) +++ head/sys/kern/subr_prf.c Fri Aug 10 15:29:06 2018 (r337579) @@ -1033,20 +1033,24 @@ void msgbufinit(void *ptr, int size) { char *cp; - static struct msgbuf *oldp = NULL; + static struct msgbuf *oldp; + bool print_boot_tag; + oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; + print_boot_tag = !msgbufmapped; /* Attempt to fetch kern.boot_tag tunable on first mapping */ if (!msgbufmapped) TUNABLE_STR_FETCH("kern.boot_tag", current_boot_tag, sizeof(current_boot_tag)); msgbufp = (struct msgbuf *)(cp + size); msgbuf_reinit(msgbufp, cp, size); - msgbuf_addstr(msgbufp, -1, current_boot_tag, 0); if (msgbufmapped && oldp != msgbufp) msgbuf_copy(oldp, msgbufp); msgbufmapped = true; + if (print_boot_tag) + printf("%s\n", current_boot_tag); oldp = msgbufp; } From owner-svn-src-all@freebsd.org Fri Aug 10 15:35:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEB40106E4CB; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 750DC701A4; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534F02092; Fri, 10 Aug 2018 15:35:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AFZ34V047364; Fri, 10 Aug 2018 15:35:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AFZ3gf047363; Fri, 10 Aug 2018 15:35:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808101535.w7AFZ3gf047363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 15:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337580 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 337580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 15:35:03 -0000 Author: kevans Date: Fri Aug 10 15:35:02 2018 New Revision: 337580 URL: https://svnweb.freebsd.org/changeset/base/337580 Log: subr_prf: remove think-o that had returned to local patch Reported by: cognet Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Fri Aug 10 15:29:06 2018 (r337579) +++ head/sys/kern/subr_prf.c Fri Aug 10 15:35:02 2018 (r337580) @@ -1033,10 +1033,9 @@ void msgbufinit(void *ptr, int size) { char *cp; - static struct msgbuf *oldp; + static struct msgbuf *oldp = NULL; bool print_boot_tag; - oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; From owner-svn-src-all@freebsd.org Fri Aug 10 16:34:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BCBA106FB93; Fri, 10 Aug 2018 16:34:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E4E3720BA; Fri, 10 Aug 2018 16:34:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 103AB2A37; Fri, 10 Aug 2018 16:34:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AGYS0x078358; Fri, 10 Aug 2018 16:34:28 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AGYO4Q078334; Fri, 10 Aug 2018 16:34:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808101634.w7AGYO4Q078334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Aug 2018 16:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337581 - in vendor-sys/acpica/dist: . source/components/debugger source/components/dispatcher source/components/hardware source/components/namespace source/components/parser source/com... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . source/components/debugger source/components/dispatcher source/components/hardware source/components/namespace source/components/parser source/components/tables source/com... X-SVN-Commit-Revision: 337581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 16:34:30 -0000 Author: jkim Date: Fri Aug 10 16:34:24 2018 New Revision: 337581 URL: https://svnweb.freebsd.org/changeset/base/337581 Log: Import ACPICA 20180810. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/hardware/hwregs.c vendor-sys/acpica/dist/source/components/hardware/hwsleep.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/tables/tbdata.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/uterror.c vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c vendor-sys/acpica/dist/source/components/utilities/utstrtoul64.c vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/changes.txt Fri Aug 10 16:34:24 2018 (r337581) @@ -1,4 +1,51 @@ ---------------------------------------- +10 August 2018. Summary of changes for version 20180810: + + +1) ACPICA kernel-resident subsystem: + +Initial ACPI table loading: Attempt to continue loading ACPI tables +regardless of malformed AML. Since migrating table initialization to the +new module-level code support, the AML interpreter rejected tables upon +any ACPI error encountered during table load. This is a problem because +non-serious ACPI errors during table load do not necessarily mean that +the entire definition block (DSDT or SSDT) is invalid. This change +improves the table loading by ignoring some types of errors that can be +generated by incorrect AML. This can range from object type errors, scope +errors, and index errors. + +Suspend/Resume support: Update to stop unconditionally clearing ACPI IRQs +during suspend/resume. The status of ACPI events is no longer cleared +when entering the ACPI S5 system state (power off) which caused some +systems to power up immediately after turning off power in certain +situations. This was a functional regression. It was fixed by clearing +the status of all ACPI events again when entering S5 (for system-wide +suspend or hibernation the clearing of the status of all events is not +desirable, as it might cause the kernel to miss wakeup events sometimes). +Rafael Wysocki. + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Enhanced the -fi option (Namespace initialization file). Field +elements listed in the initialization file were previously initialized +after the table load and before executing module-level code blocks. +Recent changes in the module-level code support means that the table load +becomes a large control method execution. If fields are used within +module-level code and we are executing with the -fi option, the +initialization values were used to initialize the namespace object(s) +only after the table was finished loading. This change Provides an early +initialization of objects specified in the initialization file so that +field unit values are populated during the table load (not after the +load). + +AcpiExec: Fixed a small memory leak regression that could result in +warnings during exit of the utility. These warnings were similar to +these: + 0002D690 Length 0x0006 nsnames-0502 [Not a Descriptor - too small] + 0002CD70 Length 0x002C utcache-0453 [Operand] Integer RefCount 0x0001 + +---------------------------------------- 29 June 2018. Summary of changes for version 20180629: Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Aug 10 16:34:24 2018 (r337581) @@ -969,7 +969,11 @@ AcpiDbCommandDispatch ( case CMD_DISASSEMBLE: case CMD_DISASM: +#ifdef ACPI_DISASSEMBLER (void) AcpiDbDisassembleMethod (AcpiGbl_DbArgs[1]); +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_DUMP: @@ -1083,7 +1087,11 @@ AcpiDbCommandDispatch ( case CMD_LIST: - AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); +#ifdef ACPI_DISASSEMBLER + AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op);; +#else + AcpiOsPrintf ("The AML Disassembler is not configured/present\n"); +#endif break; case CMD_LOCKS: Modified: vendor-sys/acpica/dist/source/components/debugger/dbmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbmethod.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/debugger/dbmethod.c Fri Aug 10 16:34:24 2018 (r337581) @@ -393,6 +393,7 @@ Cleanup: } +#ifdef ACPI_DISASSEMBLER /******************************************************************************* * * FUNCTION: AcpiDbDisassembleAml @@ -426,9 +427,7 @@ AcpiDbDisassembleAml ( NumStatements = strtoul (Statements, NULL, 0); } -#ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (NULL, Op, NumStatements); -#endif } @@ -511,8 +510,6 @@ AcpiDbDisassembleMethod ( WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE; Status = AcpiPsParseAml (WalkState); - -#ifdef ACPI_DISASSEMBLER (void) AcpiDmParseDeferredOps (Op); /* Now we can disassemble the method */ @@ -520,7 +517,6 @@ AcpiDbDisassembleMethod ( AcpiGbl_DmOpt_Verbose = FALSE; AcpiDmDisassemble (NULL, Op, 0); AcpiGbl_DmOpt_Verbose = TRUE; -#endif AcpiPsDeleteParseTree (Op); @@ -531,6 +527,7 @@ AcpiDbDisassembleMethod ( AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId); return (AE_OK); } +#endif /******************************************************************************* Modified: vendor-sys/acpica/dist/source/components/debugger/dbxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbxface.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/debugger/dbxface.c Fri Aug 10 16:34:24 2018 (r337581) @@ -154,6 +154,7 @@ #include "amlcode.h" #include "acdebug.h" #include "acinterp.h" +#include "acparser.h" #define _COMPONENT ACPI_CA_DEBUGGER @@ -435,10 +436,17 @@ AcpiDbSingleStep ( } } - /* Now we can display it */ + /* Now we can disassemble and display it */ #ifdef ACPI_DISASSEMBLER AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX); +#else + /* + * The AML Disassembler is not configured - at least we can + * display the opcode value and name + */ + AcpiOsPrintf ("AML Opcode: %4.4X %s\n", Op->Common.AmlOpcode, + AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); #endif if ((Op->Common.AmlOpcode == AML_IF_OP) || Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Aug 10 16:34:24 2018 (r337581) @@ -157,7 +157,11 @@ #include "acnamesp.h" #include "acparser.h" +#ifdef ACPI_EXEC_APP +#include "aecommon.h" +#endif + #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsfield") @@ -430,7 +434,14 @@ AcpiDsGetFieldNames ( UINT64 Position; ACPI_PARSE_OBJECT *Child; +#ifdef ACPI_EXEC_APP + UINT64 Value = 0; + ACPI_OPERAND_OBJECT *ResultDesc; + ACPI_OPERAND_OBJECT *ObjDesc; + char *NamePath; +#endif + ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -564,6 +575,18 @@ AcpiDsGetFieldNames ( { return_ACPI_STATUS (Status); } +#ifdef ACPI_EXEC_APP + NamePath = AcpiNsGetExternalPathname (Info->FieldNode); + ObjDesc = AcpiUtCreateIntegerObject (Value); + if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &Value))) + { + AcpiExWriteDataToField (ObjDesc, + AcpiNsGetAttachedObject (Info->FieldNode), + &ResultDesc); + } + AcpiUtRemoveReference (ObjDesc); + ACPI_FREE (NamePath); +#endif } } @@ -756,6 +779,9 @@ AcpiDsInitFieldObjects ( Flags |= ACPI_NS_TEMPORARY; } +#ifdef ACPI_EXEC_APP + Flags |= ACPI_NS_OVERRIDE_IF_FOUND; +#endif /* * Walk the list of entries in the FieldList * Note: FieldList can be of zero length. In this case, Arg will be NULL. Modified: vendor-sys/acpica/dist/source/components/hardware/hwregs.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwregs.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/hardware/hwregs.c Fri Aug 10 16:34:24 2018 (r337581) @@ -724,13 +724,20 @@ AcpiHwRegisterRead ( case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } break; case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock); - Value = (UINT32) Value64; + if (ACPI_SUCCESS (Status)) + { + Value = (UINT32) Value64; + } + break; case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ Modified: vendor-sys/acpica/dist/source/components/hardware/hwsleep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwsleep.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/hardware/hwsleep.c Fri Aug 10 16:34:24 2018 (r337581) @@ -198,16 +198,27 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - /* - * 1) Disable all GPEs - * 2) Enable all wakeup GPEs - */ + /* Disable all GPEs */ + Status = AcpiHwDisableAllGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } + /* + * If the target sleep state is S5, clear all GPEs and fixed events too + */ + if (SleepState == ACPI_STATE_S5) + { + Status = AcpiHwClearAcpiStatus(); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } AcpiGbl_SystemAwakeAndRunning = FALSE; + + /* Enable all wakeup GPEs */ Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) Modified: vendor-sys/acpica/dist/source/components/namespace/nsaccess.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsaccess.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/namespace/nsaccess.c Fri Aug 10 16:34:24 2018 (r337581) @@ -724,6 +724,15 @@ AcpiNsLookup ( CurrentNode)); } +#ifdef ACPI_EXEC_APP + if ((Status == AE_ALREADY_EXISTS) && + (ThisNode->Flags & ANOBJ_NODE_EARLY_INIT)) + { + ThisNode->Flags &= ~ANOBJ_NODE_EARLY_INIT; + Status = AE_OK; + } +#endif + #ifdef ACPI_ASL_COMPILER /* * If this ACPI name already exists within the namespace as an @@ -844,6 +853,13 @@ AcpiNsLookup ( } } } + +#ifdef ACPI_EXEC_APP + if (Flags & ACPI_NS_EARLY_INIT) + { + ThisNode->Flags |= ANOBJ_NODE_EARLY_INIT; + } +#endif *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); Modified: vendor-sys/acpica/dist/source/components/parser/psloop.c ============================================================================== --- vendor-sys/acpica/dist/source/components/parser/psloop.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/parser/psloop.c Fri Aug 10 16:34:24 2018 (r337581) @@ -164,6 +164,7 @@ #include "acdispat.h" #include "amlcode.h" #include "acconvert.h" +#include "acnamesp.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psloop") @@ -645,6 +646,18 @@ AcpiPsParseLoop ( Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op); if (ACPI_FAILURE (Status)) { + /* + * ACPI_PARSE_MODULE_LEVEL means that we are loading a table by + * executing it as a control method. However, if we encounter + * an error while loading the table, we need to keep trying to + * load the table rather than aborting the table load. Set the + * status to AE_OK to proceed with the table load. + */ + if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + Status == AE_ALREADY_EXISTS) + { + Status = AE_OK; + } if (Status == AE_CTRL_PARSE_CONTINUE) { continue; @@ -665,18 +678,20 @@ AcpiPsParseLoop ( { return_ACPI_STATUS (Status); } - if (WalkState->Opcode == AML_SCOPE_OP) + if (AcpiNsOpensScope ( + AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType)) { /* - * If the scope op fails to parse, skip the body of the - * scope op because the parse failure indicates that the - * device may not exist. + * If the scope/device op fails to parse, skip the body of + * the scope op because the parse failure indicates that + * the device may not exist. */ + ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s", + AcpiPsGetOpcodeName (WalkState->Opcode))); WalkState->ParserState.Aml = WalkState->Aml + 1; WalkState->ParserState.Aml = AcpiPsGetNextPackageEnd(&WalkState->ParserState); WalkState->Aml = WalkState->ParserState.Aml; - ACPI_ERROR ((AE_INFO, "Skipping Scope block")); } continue; @@ -832,6 +847,22 @@ AcpiPsParseLoop ( Status = AcpiPsNextParseState (WalkState, Op, Status); if (Status == AE_CTRL_PENDING) { + Status = AE_OK; + } + else if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) && + (ACPI_AML_EXCEPTION(Status) || Status == AE_ALREADY_EXISTS || + Status == AE_NOT_FOUND)) + { + /* + * ACPI_PARSE_MODULE_LEVEL flag means that we are currently + * loading a table by executing it as a control method. + * However, if we encounter an error while loading the table, + * we need to keep trying to load the table rather than + * aborting the table load (setting the status to AE_OK + * continues the table load). If we get a failure at this + * point, it means that the dispatcher got an error while + * trying to execute the Op. + */ Status = AE_OK; } } Modified: vendor-sys/acpica/dist/source/components/tables/tbdata.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbdata.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/tables/tbdata.c Fri Aug 10 16:34:24 2018 (r337581) @@ -711,9 +711,9 @@ AcpiTbVerifyTempTable ( { if (Status != AE_CTRL_TERMINATE) { - ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + ACPI_EXCEPTION ((AE_INFO, Status, "%4.4s 0x%8.8X%8.8X" - " Table is duplicated", + " Table is already loaded", AcpiUtValidNameseg (TableDesc->Signature.Ascii) ? TableDesc->Signature.Ascii : "????", ACPI_FORMAT_UINT64 (TableDesc->Address))); Modified: vendor-sys/acpica/dist/source/components/utilities/utdelete.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utdelete.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/utilities/utdelete.c Fri Aug 10 16:34:24 2018 (r337581) @@ -520,6 +520,7 @@ AcpiUtUpdateRefCount ( UINT16 OriginalCount; UINT16 NewCount = 0; ACPI_CPU_FLAGS LockFlags; + char *Message; ACPI_FUNCTION_NAME (UtUpdateRefCount); @@ -560,6 +561,7 @@ AcpiUtUpdateRefCount ( "Obj %p Type %.2X [%s] Refs %.2X [Incremented]\n", Object, Object->Common.Type, AcpiUtGetObjectTypeName (Object), NewCount)); + Message = "Incremement"; break; case REF_DECREMENT: @@ -591,6 +593,7 @@ AcpiUtUpdateRefCount ( { AcpiUtDeleteInternalObj (Object); } + Message = "Decrement"; break; default: @@ -608,8 +611,8 @@ AcpiUtUpdateRefCount ( if (NewCount > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, - "Large Reference Count (0x%X) in object %p, Type=0x%.2X", - NewCount, Object, Object->Common.Type)); + "Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s", + NewCount, Object, Object->Common.Type, Message)); } } Modified: vendor-sys/acpica/dist/source/components/utilities/uterror.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/uterror.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/utilities/uterror.c Fri Aug 10 16:34:24 2018 (r337581) @@ -352,19 +352,19 @@ AcpiUtPrefixedNamespaceError ( { case AE_ALREADY_EXISTS: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Failure creating"; break; case AE_NOT_FOUND: - AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR); + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); Message = "Could not resolve"; break; default: - AcpiOsPrintf ("\n" ACPI_MSG_ERROR); + AcpiOsPrintf (ACPI_MSG_ERROR); Message = "Failure resolving"; break; } Modified: vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c Fri Aug 10 16:34:24 2018 (r337581) @@ -419,15 +419,39 @@ BOOLEAN AcpiUtDetectHexPrefix ( char **String) { + char *InitialPosition = *String; + AcpiUtRemoveHexPrefix (String); + if (*String != InitialPosition) + { + return (TRUE); /* String is past leading 0x */ + } + + return (FALSE); /* Not a hex string */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtRemoveHexPrefix + * + * PARAMETERS: String - Pointer to input ASCII string + * + * RETURN: none + * + * DESCRIPTION: Remove a hex "0x" prefix + * + ******************************************************************************/ + +void +AcpiUtRemoveHexPrefix ( + char **String) +{ if ((**String == ACPI_ASCII_ZERO) && (tolower ((int) *(*String + 1)) == 'x')) { *String += 2; /* Go past the leading 0x */ - return (TRUE); } - - return (FALSE); /* Not a hex string */ } Modified: vendor-sys/acpica/dist/source/components/utilities/utstrtoul64.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utstrtoul64.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/components/utilities/utstrtoul64.c Fri Aug 10 16:34:24 2018 (r337581) @@ -383,7 +383,7 @@ AcpiUtImplicitStrtoul64 ( * implicit conversions, and the "0x" prefix is "not allowed". * However, allow a "0x" prefix as an ACPI extension. */ - AcpiUtDetectHexPrefix (&String); + AcpiUtRemoveHexPrefix (&String); if (!AcpiUtRemoveLeadingZeros (&String)) { Modified: vendor-sys/acpica/dist/source/include/acconfig.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acconfig.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/acconfig.h Fri Aug 10 16:34:24 2018 (r337581) @@ -233,7 +233,7 @@ /* Maximum object reference count (detects object deletion issues) */ -#define ACPI_MAX_REFERENCE_COUNT 0x800 +#define ACPI_MAX_REFERENCE_COUNT 0x4000 /* Default page size for use in mapping memory for operation regions */ Modified: vendor-sys/acpica/dist/source/include/acexcep.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acexcep.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/acexcep.h Fri Aug 10 16:34:24 2018 (r337581) @@ -204,6 +204,13 @@ typedef struct acpi_exception_info #define AE_OK (ACPI_STATUS) 0x0000 +#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL) +#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML) +#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER) +#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES) +#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL) + + /* * Environmental exceptions */ Modified: vendor-sys/acpica/dist/source/include/aclocal.h ============================================================================== --- vendor-sys/acpica/dist/source/include/aclocal.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/aclocal.h Fri Aug 10 16:34:24 2018 (r337581) @@ -327,6 +327,7 @@ typedef struct acpi_namespace_node #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ +#define ANOBJ_NODE_EARLY_INIT 0x80 /* AcpiExec only: Node was create via init file (-fi) */ #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ Modified: vendor-sys/acpica/dist/source/include/acnamesp.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acnamesp.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/acnamesp.h Fri Aug 10 16:34:24 2018 (r337581) @@ -168,14 +168,15 @@ /* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */ #define ACPI_NS_NO_UPSEARCH 0 -#define ACPI_NS_SEARCH_PARENT 0x01 -#define ACPI_NS_DONT_OPEN_SCOPE 0x02 -#define ACPI_NS_NO_PEER_SEARCH 0x04 -#define ACPI_NS_ERROR_IF_FOUND 0x08 -#define ACPI_NS_PREFIX_IS_SCOPE 0x10 -#define ACPI_NS_EXTERNAL 0x20 -#define ACPI_NS_TEMPORARY 0x40 -#define ACPI_NS_OVERRIDE_IF_FOUND 0x80 +#define ACPI_NS_SEARCH_PARENT 0x0001 +#define ACPI_NS_DONT_OPEN_SCOPE 0x0002 +#define ACPI_NS_NO_PEER_SEARCH 0x0004 +#define ACPI_NS_ERROR_IF_FOUND 0x0008 +#define ACPI_NS_PREFIX_IS_SCOPE 0x0010 +#define ACPI_NS_EXTERNAL 0x0020 +#define ACPI_NS_TEMPORARY 0x0040 +#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 +#define ACPI_NS_EARLY_INIT 0x0100 /* Flags for AcpiNsWalkNamespace */ Modified: vendor-sys/acpica/dist/source/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acpixf.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/acpixf.h Fri Aug 10 16:34:24 2018 (r337581) @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20180629 +#define ACPI_CA_VERSION 0x20180810 #include "acconfig.h" #include "actypes.h" Modified: vendor-sys/acpica/dist/source/include/acutils.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acutils.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/include/acutils.h Fri Aug 10 16:34:24 2018 (r337581) @@ -362,6 +362,10 @@ BOOLEAN AcpiUtDetectHexPrefix ( char **String); +void +AcpiUtRemoveHexPrefix ( + char **String); + BOOLEAN AcpiUtDetectOctalPrefix ( char **String); Modified: vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h Fri Aug 10 16:34:24 2018 (r337581) @@ -189,11 +189,22 @@ typedef struct ae_debug_regions } AE_DEBUG_REGIONS; +/* + * Init file entry + */ +typedef struct init_file_entry +{ + char *Name; + UINT64 Value; +} INIT_FILE_ENTRY; + extern BOOLEAN AcpiGbl_UseLocalFaultHandler; extern BOOLEAN AcpiGbl_VerboseHandlers; extern BOOLEAN AcpiGbl_IgnoreErrors; extern BOOLEAN AcpiGbl_AbortLoopOnTimeout; extern UINT8 AcpiGbl_RegionFillValue; +extern INIT_FILE_ENTRY *AcpiGbl_InitEntries; +extern UINT32 AcpiGbl_InitFileLineCount; extern UINT8 AcpiGbl_UseHwReducedFadt; extern BOOLEAN AcpiGbl_DisplayRegionAccess; extern BOOLEAN AcpiGbl_DoInterfaceTests; @@ -331,12 +342,17 @@ AeOpenInitializationFile ( char *Filename); void -AeDoObjectOverrides ( +AeProcessInitFile ( void); ACPI_STATUS AeSetupConfiguration ( void *RegionAddr); + +ACPI_STATUS +AeLookupInitFileEntry ( + char *Pathname, + UINT64 *Value); /* aeexec */ Modified: vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c Fri Aug 10 16:34:24 2018 (r337581) @@ -159,10 +159,8 @@ /* Local prototypes */ static void -AeDoOneOverride ( - char *Pathname, - char *ValueString, - ACPI_OPERAND_OBJECT *ObjDesc, +AeEnterInitFileEntry ( + INIT_FILE_ENTRY InitEntry, ACPI_WALK_STATE *WalkState); @@ -206,13 +204,15 @@ AeOpenInitializationFile ( /****************************************************************************** * - * FUNCTION: AeDoObjectOverrides + * FUNCTION: AeProcessInitFile * * PARAMETERS: None * * RETURN: None * - * DESCRIPTION: Read the initialization file and perform all overrides + * DESCRIPTION: Read the initialization file and perform all namespace + * initializations. AcpiGbl_InitEntries will be used for region + * field initialization. * * NOTE: The format of the file is multiple lines, each of format: * @@ -220,12 +220,13 @@ AeOpenInitializationFile ( *****************************************************************************/ void -AeDoObjectOverrides ( +AeProcessInitFile( void) { - ACPI_OPERAND_OBJECT *ObjDesc; ACPI_WALK_STATE *WalkState; int i; + UINT64 idx; + ACPI_STATUS Status; if (!InitFile) @@ -235,14 +236,19 @@ AeDoObjectOverrides ( /* Create needed objects to be reused for each init entry */ - ObjDesc = AcpiUtCreateIntegerObject (0); WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); NameBuffer[0] = '\\'; - /* Read the entire file line-by-line */ - while (fgets (LineBuffer, AE_FILE_BUFFER_SIZE, InitFile) != NULL) { + ++AcpiGbl_InitFileLineCount; + } + rewind (InitFile); + + AcpiGbl_InitEntries = + AcpiOsAllocate (sizeof (INIT_FILE_ENTRY) * AcpiGbl_InitFileLineCount); + for (idx = 0; fgets (LineBuffer, AE_FILE_BUFFER_SIZE, InitFile); ++idx) + { if (sscanf (LineBuffer, "%s %s\n", &NameBuffer[1], ValueBuffer) != 2) { @@ -257,7 +263,20 @@ AeDoObjectOverrides ( i = 1; } - AeDoOneOverride (&NameBuffer[i], ValueBuffer, ObjDesc, WalkState); + AcpiGbl_InitEntries[idx].Name = + AcpiOsAllocateZeroed (strnlen (NameBuffer + i, AE_FILE_BUFFER_SIZE) + 1); + + strcpy (AcpiGbl_InitEntries[idx].Name, NameBuffer + i); + + Status = AcpiUtStrtoul64 (ValueBuffer, &AcpiGbl_InitEntries[idx].Value); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s %s\n", ValueBuffer, + AcpiFormatException (Status)); + goto CleanupAndExit; + } + + AeEnterInitFileEntry (AcpiGbl_InitEntries[idx], WalkState); } /* Cleanup */ @@ -265,77 +284,97 @@ AeDoObjectOverrides ( CleanupAndExit: fclose (InitFile); AcpiDsDeleteWalkState (WalkState); - AcpiUtRemoveReference (ObjDesc); } /****************************************************************************** * - * FUNCTION: AeDoOneOverride + * FUNCTION: AeInitFileEntry * - * PARAMETERS: Pathname - AML namepath - * ValueString - New integer value to be stored - * ObjDesc - Descriptor with integer override value + * PARAMETERS: InitEntry - Entry of the init file * WalkState - Used for the Store operation * * RETURN: None * - * DESCRIPTION: Perform an override for a single namespace object + * DESCRIPTION: Perform initialization of a single namespace object * + * Note: namespace of objects are limited to integers and region + * fields units of 8 bytes at this time. + * *****************************************************************************/ static void -AeDoOneOverride ( - char *Pathname, - char *ValueString, - ACPI_OPERAND_OBJECT *ObjDesc, +AeEnterInitFileEntry ( + INIT_FILE_ENTRY InitEntry, ACPI_WALK_STATE *WalkState) { - ACPI_HANDLE Handle; + char *Pathname = InitEntry.Name; + UINT64 Value = InitEntry.Value; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_NAMESPACE_NODE *NewNode; ACPI_STATUS Status; - UINT64 Value; - AcpiOsPrintf ("Value Override: %s, ", Pathname); - - /* - * Get the namespace node associated with the override - * pathname from the init file. - */ - Status = AcpiGetHandle (NULL, Pathname, &Handle); + AcpiOsPrintf ("Initializing namespace element: %s\n", Pathname); + Status = AcpiNsLookup (NULL, Pathname, ACPI_TYPE_INTEGER, + ACPI_IMODE_LOAD_PASS2, ACPI_NS_ERROR_IF_FOUND | ACPI_NS_NO_UPSEARCH | + ACPI_NS_EARLY_INIT, NULL, &NewNode); if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("%s\n", AcpiFormatException (Status)); + ACPI_EXCEPTION ((AE_INFO, Status, + "While creating name from namespace initialization file: %s", + Pathname)); return; } - /* Extract the 64-bit integer */ + ObjDesc = AcpiUtCreateIntegerObject (Value); - Status = AcpiUtStrtoul64 (ValueString, &Value); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("%s %s\n", ValueString, - AcpiFormatException (Status)); - return; - } + AcpiOsPrintf ("New value: 0x%8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (Value)); - ObjDesc->Integer.Value = Value; + /* Store pointer to value descriptor in the Node */ - /* - * At the point this function is called, the namespace is fully - * built and initialized. We can simply store the new object to - * the target node. - */ - AcpiExEnterInterpreter (); - Status = AcpiExStore (ObjDesc, Handle, WalkState); - AcpiExExitInterpreter (); + Status = AcpiNsAttachObject (NewNode, ObjDesc, + ACPI_TYPE_INTEGER); - if (ACPI_FAILURE (Status)) + /* Remove local reference to the object */ + + AcpiUtRemoveReference (ObjDesc); +} + + +/****************************************************************************** + * + * FUNCTION: AeLookupInitFileEntry + * + * PARAMETERS: Pathname - AML namepath in external format + * ValueString - value of the namepath if it exitst + * + * RETURN: None + * + * DESCRIPTION: Search the init file for a particular name and its value. + * + *****************************************************************************/ + +ACPI_STATUS +AeLookupInitFileEntry ( + char *Pathname, + UINT64 *Value) +{ + UINT32 i; + + if (!AcpiGbl_InitEntries) { - AcpiOsPrintf ("%s\n", AcpiFormatException (Status)); - return; + return AE_NOT_FOUND; } - AcpiOsPrintf ("New value: 0x%8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (Value)); + for (i = 0; i < AcpiGbl_InitFileLineCount; ++i) + { + if (!strcmp(AcpiGbl_InitEntries[i].Name, Pathname)) + { + *Value = AcpiGbl_InitEntries[i].Value; + return AE_OK; + } + } + return AE_NOT_FOUND; } Modified: vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Fri Aug 10 16:34:24 2018 (r337581) @@ -199,6 +199,8 @@ BOOLEAN AcpiGbl_LoadTestTables = F BOOLEAN AcpiGbl_AeLoadOnly = FALSE; static UINT8 AcpiGbl_ExecutionMode = AE_MODE_COMMAND_LOOP; static char BatchBuffer[AE_BUFFER_SIZE]; /* Batch command buffer */ +INIT_FILE_ENTRY *AcpiGbl_InitEntries = NULL; +UINT32 AcpiGbl_InitFileLineCount = 0; #define ACPIEXEC_NAME "AML Execution/Debug Utility" #define AE_SUPPORTED_OPTIONS "?b:d:e:f^ghlm^rt^v^:x:" @@ -677,6 +679,8 @@ main ( signal (SIGSEGV, AeSignalHandler); } + AeProcessInitFile(); + /* The remaining arguments are filenames for ACPI tables */ if (!argv[AcpiGbl_Optind]) @@ -785,12 +789,6 @@ main ( */ AeInstallLateHandlers (); - /* - * This call implements the "initialization file" option for AcpiExec. - * This is the precise point that we want to perform the overrides. - */ - AeDoObjectOverrides (); - /* Finish the ACPICA initialization */ Status = AcpiInitializeObjects (InitFlags); @@ -848,5 +846,6 @@ NormalExit: ErrorExit: (void) AcpiTerminate (); AcDeleteTableList (ListHead); + AcpiOsFree (AcpiGbl_InitEntries); return (ExitCode); } Modified: vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c Fri Aug 10 15:35:02 2018 (r337580) +++ vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c Fri Aug 10 16:34:24 2018 (r337581) @@ -234,9 +234,9 @@ AeRegionHandler ( SpaceId = RegionObject->Region.SpaceId; ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Operation Region request on %s at 0x%X\n", + "Operation Region request on %s at 0x%X, BitWidth 0x%X, RegionLength 0x%X\n", AcpiUtGetRegionName (RegionObject->Region.SpaceId), - (UINT32) Address)); + (UINT32) Address, BitWidth, (UINT32) Length)); /* * Region support can be disabled with the -do option. @@ -410,7 +410,7 @@ AeRegionHandler ( if (AcpiGbl_DisplayRegionAccess) { AcpiOsPrintf ("AcpiExec: %s " - "%s: Attr %X Addr %.4X BaseAddr %.4X Len %.2X Width %X BufLen %X", + "%s: Attr %X Addr %.4X BaseAddr %.4X Length %.2X BitWidth %X BufLen %X", AcpiUtGetRegionName (SpaceId), (Function & ACPI_IO_MASK) ? "Write" : "Read ", (UINT32) (Function >> 16), @@ -424,7 +424,7 @@ AeRegionHandler ( Status = AcpiBufferToResource (MyContext->Connection, MyContext->Length, &Resource); - AcpiOsPrintf (" [AccLen %.2X Conn %p]", + AcpiOsPrintf (" [AccessLength %.2X Connnection %p]", MyContext->AccessLength, MyContext->Connection); } AcpiOsPrintf ("\n"); From owner-svn-src-all@freebsd.org Fri Aug 10 16:35:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2751D106FC49; Fri, 10 Aug 2018 16:35:05 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D14767223B; Fri, 10 Aug 2018 16:35:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9872B2A38; Fri, 10 Aug 2018 16:35:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AGZ4ne078435; Fri, 10 Aug 2018 16:35:04 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AGZ4sr078434; Fri, 10 Aug 2018 16:35:04 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201808101635.w7AGZ4sr078434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Aug 2018 16:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337582 - vendor-sys/acpica/20180810 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20180810 X-SVN-Commit-Revision: 337582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 16:35:05 -0000 Author: jkim Date: Fri Aug 10 16:35:04 2018 New Revision: 337582 URL: https://svnweb.freebsd.org/changeset/base/337582 Log: Tag ACPICA 20180810. Added: vendor-sys/acpica/20180810/ - copied from r337581, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Aug 10 16:43:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36978106FF27; Fri, 10 Aug 2018 16:43:08 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9325E72783; Fri, 10 Aug 2018 16:43:07 +0000 (UTC) (envelope-from phil@juniper.net) Received: from pps.filterd (m0108162.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7AGdN76005076; Fri, 10 Aug 2018 09:43:00 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=message-id : from : to : cc : subject : in-reply-to : mime-version : content-type : content-id : date; s=PPS1017; bh=mIf3GIL3GGhmvDTY3g30/vVUviSKDBPbbNw6yQMi2g4=; b=qNkK6OsYb/wBuuB4rhALG2j+0kIgyCbVEZjnRfaaHaRJcHuw4uVYcaWw+kkib9TF9KdO VP4UFrKlxeKRn3dd7PD+KjLLCmMx5Wc4q7mVzzE7iIF5d2VPxLVaxPmH2M/4DtwqLgJq GGnl2QvcO/tRkJ1fhlpHCbvhun00JB0jta+SDdcrenmhG4DodT8dE/VH9QAtotgzxHkH 1O0DRKPXjBfNk/zYvgI8QmBW8VAnXS8pEmTjkTdj0vBl6zWKk37ciFcaYus9WAO8JDtD MLV0t8UU8bgkYlUEZaAfINm6x78UVmiO4Jg+LvjZSFsAsY1dhFXdkLGKuoi8igwMCyhD TQ== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp0119.outbound.protection.outlook.com [216.32.180.119]) by mx0b-00273201.pphosted.com with ESMTP id 2ksa37gemn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 10 Aug 2018 09:42:59 -0700 Received: from SN1PR05CA0005.namprd05.prod.outlook.com (2a01:111:e400:5197::15) by BY2PR05MB2312.namprd05.prod.outlook.com (2a01:111:e400:c50a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.9; Fri, 10 Aug 2018 16:42:57 +0000 Received: from CO1NAM05FT012.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::207) by SN1PR05CA0005.outlook.office365.com (2a01:111:e400:5197::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1059.9 via Frontend Transport; Fri, 10 Aug 2018 16:42:57 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from P-EXFEND-EQX-01.jnpr.net (66.129.239.12) by CO1NAM05FT012.mail.protection.outlook.com (10.152.96.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1059.4 via Frontend Transport; Fri, 10 Aug 2018 16:42:54 +0000 Received: from P-EXFEND-EQX-01.jnpr.net (10.104.8.54) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 10 Aug 2018 09:42:53 -0700 Received: from p-emfe01a-sac.jnpr.net (172.24.192.34) by P-EXFEND-EQX-01.jnpr.net (10.104.8.54) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 10 Aug 2018 09:42:53 -0700 Received: from p-mailhub01.juniper.net (10.47.226.20) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 10 Aug 2018 09:41:51 -0700 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w7AGfmvx021455; Fri, 10 Aug 2018 09:41:49 -0700 (envelope-from phil@juniper.net) Received: from idle.juniper.net (localhost [127.0.0.1]) by idle.juniper.net (8.15.2/8.15.2) with ESMTP id w7AGgZHN036891; Fri, 10 Aug 2018 12:42:35 -0400 (EDT) (envelope-from phil@juniper.net) Message-ID: <201808101642.w7AGgZHN036891@idle.juniper.net> From: Phil Shafer To: , "Rodney W. Grimes" CC: "Andrey V. Elsukov" , , , Subject: Re: svn commit: r337536 - head/sbin/ipfw In-Reply-To: <201808091428.w79ESmln017684@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <36889.1533919355.1@idle.juniper.net> Date: Fri, 10 Aug 2018 12:42:35 -0400 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(39860400002)(346002)(376002)(136003)(2980300002)(199004)(189003)(11346002)(16586007)(77096007)(69596002)(486006)(186003)(126002)(316002)(6246003)(2906002)(2810700001)(97756001)(14444005)(86362001)(110136005)(54906003)(336012)(476003)(7126003)(426003)(68736007)(50466002)(46406003)(478600001)(53416004)(5660300001)(76506005)(105596002)(106466001)(8276002)(6346003)(7696005)(356003)(305945005)(23726003)(1076002)(47776003)(26005)(8676002)(4326008)(229853002)(81166006)(97736004)(8936002)(81156014)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR05MB2312; H:P-EXFEND-EQX-01.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM05FT012; 1:c2GJVexNrPgfyJWbFnZ6gN+JXg4VmrJ9r+NemvRE2ourfGsPzSrZaACSXUrWVVlgHekixPhRDRoM4itQfDotLS+SfuC9RgJpa6lXlCk6wZ5169JJjJGVJX+1IYYVW0BB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a442028e-9de2-41aa-3f4f-08d5fee05322 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BY2PR05MB2312; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 3:mmFxGSkJpaXJNyYIpX/0xWkTJO4s3iz1JRyYcRx7LN+9rQHCaXdCy21duabbGBAkAJX9xvha1Jh3zipZhr1JC3wimmRAJaxafc1RlgNbPbrcOlLanCz0c0N8I6d0/25++uTHL0k7T5Pg/4YBcbwWNSgBStHg1KWzDl/D1yIu1AWWQrj6OTMe1cw5lUjMW+xSxv7jg3bySM3/AAuYFDV6G10MBHbMHgSWebwX26gHe5r+5NFpCyKVn4lzMcVi446HLxwtZ2RTZ9YVUm1lbsO8F7Ax4am/j2huYJgx0tGGUcTD6LIZ5qa/r1p9Fma24lreYdPIQ53Swesjp4/g7EGUiKenc0thYr/MhOqtlVipEpU=; 25:9b6JHcbsDxIi/qpXKVU6psUW1DKPRc1bA4nMn+xfrxEA6MRBmo8nLQYi7aT9tPCMTzMVQYsE0PFnLZ1xpytPWDM8kEvWqCJsolWdk1EGD4bdt6UP+CPZ9r48OwPG1hKggAf5AwwvImz9EfZPrTz0CQ7bju7hj2hV9wBfD1/HrG7KiGDbd3FCesuYz/fzDUFvVMTsqhoD3vVBFkYVyZMoMrGvVDy/OQr0w/DXFiILd3KNRBfAeLfK2g0l0G0swi32YuEUzICETOrG0BAK0uGFcwjCEHVH0Kl2+erZgW+kCxFfNdkn8uhIb7WbywJMZkaBNyovuHdcNfuV1VYHcc0JQg== X-MS-TrafficTypeDiagnostic: BY2PR05MB2312: X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 31:DrZiNLBFBky3YpQKAe8y5ZyRM9r/ZoLmaY0j5XipyWaFMW4sh4vjzMzhkYGypjMvjFsagweVb50fxXxho2iZryoQOqLOoqqD9FD0s6UpjuNwvLPC7hdSniASbjyLXqNvnCJ23Y+hhjzn2xY3L0dAK7YaekA9S8iz/1rel6dLHvWa5sMpiO9IUor1WGOpRrXzzAJN1x5ciqWRALH12dD/8UC7Q/U9yA/O/pXaa+0QJzE=; 20:p4AJIU1goPDBnmSRIEqBqLrYsP07pD780/ywXx+ilT7BOEBfrEZ3sc0dBr+MBNrERL7ZDCHfUwKPE5uEa6xpjMQ7rUT6uzLtwY6hcegO9o4PH6hxO4yAEEs4QMA9OA0ju0NyAncAFv9EHP4/X0jkG5/ps4RcqBVMIzbAbOfG/kqvIe023gaO25bZcrGTFDK9jzIpm/rK62BJkps4T7E55fnOQcvgjwH6HaiJ81rkHphgXRNh8b2euCxDEkxqYhO/x7iBrcekNCEBjFxtT7z6R8NnOh+MoWIQybe4wd9q5p7WC3tu4t+Eh9qMLVW6mDMK33rSe25o7NOnhzDFH0zYpit9TlGT7EVRBNIr6dNTKejYq54uElODHSZJ48+fwmXy+J3iuTgQw7pqfY2N8mKXKZmfvQtPfpnxF7OrkQlRIQI9wq8opaoPt+1SbzzfzAk7ia3DGLah3avCkOA0DbM5xxq+wu19N2fy/2b5wfr6nCdLJkGUM2O23br3+vVZ3Hsf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93003095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BY2PR05MB2312; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB2312; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 4:6ho6kihfUEYsWcmVnjZO0R/vGhtgvgSXzvDL+Jfe6JB7hLrY9Ua3ohqVj3zEKj1NPgPfwBYfSpiZa9IKwrsT/6+G9mV7uv50GaC2TU+iIRQZ/H15tUE6/L2qOtkZhZUjktw+PfgBnEcTrxvrW2KQKhqAz8WwWX2zpz/8CoHSFCIpVK/8rszYStqq1HBecwYp5wGZIrL2ILRIt7K2sa20tj3JCAoUvZMD+pFxR6m/G1TG68IJN/aJDV1/yTYsdUAGBL6nzEYrUU7WpCJf7kmbBw== X-Forefront-PRVS: 07607ED19A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB2312; 23:ftdcuYGslYLOv1U2GTex6C/Y419Tktb6rEO/Uts07?= =?us-ascii?Q?hSf71vB/7jkXd5Ri05lXicNhKkhS2qFAE1u7z0LnZqOB6z3nkvpelItI8yn0?= =?us-ascii?Q?Qc4xB+Kp8eI1q0QPvMQV6abiQ+EBNGB0RzJyl4AXfTOHeVd/Nk03eQy/dV4h?= =?us-ascii?Q?C8BP86c9zNK1kMv8z/FgtkwMG8SU8SJsmB99DFA9Mh7O/7gQrTqsBjma1uk/?= =?us-ascii?Q?TC/8usd6EheY6cm2Jc3MyujJOP7mGcqk3xV2NGKyx3XZ3QWNoa5atAJlKxje?= =?us-ascii?Q?fpcVdGQCdllu3t7QIV6Hpk+yCZyp/6soDA3GOeXV2/4KYCE8DFqYkE/Rq5Zv?= =?us-ascii?Q?MfpQRMMuP4nfwxxUYOpHbDpu9gG3CsH6vXgumlye/hFViCOZYKEFYuTeqgQC?= =?us-ascii?Q?V3p9CdM8fI3KVR6LSYQLs70wZpPl4/kLtRDi6723hogxIVIutYswtmT3fiWP?= =?us-ascii?Q?zys7/jI/IZIXKzdSVpIYho+BLncysG+s76J2oFB3lOpZlcWW9S+uljeGCU0O?= =?us-ascii?Q?DmcVqPLTwXauu+V/gVihyVA164wtPwz6dhVjGKgEso/fcrHSB/CpxaMhTMF6?= =?us-ascii?Q?7guNkHrUOE8SFC9JoU+ZpLxAMfWttd0JigxJ0QQjixTsWLSh9TtzMfDT5y8k?= =?us-ascii?Q?W4Z4pHTl9wOJgXgCFK/ZIKUc82XcuAP7b00FEXLBp+gVcEzgAxU8OGC2Q5fb?= =?us-ascii?Q?+aDGT+pUvtydjl+3cZLsyB5omUjKpXR3k2ra1UnZSFy8122/J1GLeY4STE4u?= =?us-ascii?Q?txtzZQPm4ggcuKNajGvoj8+K2Zt22U7Sz4mNZXTrEkbJue0IcyNbvurrJirR?= =?us-ascii?Q?EWXAUmKjmYu1R/0iVBLQmay41o/OMd/5QJfKoJ+PLPf4CocU7w0US7uPwFK7?= =?us-ascii?Q?/ScwyqgwpJt1kOZTS/4KM8L6uGKlLM7toFqm764Fnn0/3FBtdYqrBU2MiQWy?= =?us-ascii?Q?NN004SPGZZCiB3TWDFW3tbSg8HCVeycKNC6LXTqKIcNuuKgxZgNXdAgZby4R?= =?us-ascii?Q?ALtKleZas63MSWaiB6ZOKPMzidw/BcsrfrUCpoNQhUUiHBrJGFhWhHiSgxi4?= =?us-ascii?Q?1AiFMzO25RjjAAegCjUpy6Ke0C7kZA1MHg0ZpnMQkQWKr8Zm7bPiklpF/Yw/?= =?us-ascii?Q?iYrNllvsHZtr0cL4OvRoDEr9TIVDxf73Wk4jRviEMqFYTUdjhEnY3z3g+NLd?= =?us-ascii?Q?amAKughVrhTUgxegmJBAQiXLJM9W0llr2nv?= X-Microsoft-Antispam-Message-Info: 65MrSuoveNAVsxqFNCw8cfYcdjGk/GsQgcboD3wsmVSTlCzA/tCsvL6h9XO9MUAPBMIiDXowbp8YdW8V5SABYMfHXIuwBX+Ubc5tLSUduym9abREFJTZNOZqk7C2ozSRhDENBUvKFCZ/qL4pu6SST928LE9JsmjgC0pqIl2WysqUYOakmiwyF1B0J2okmriRVYgQOTGA8oWvxV8flfIQHOtrbDB0iXhGq5se/gnUYOIVErzWK6LBbcWhVY/GLYAt6T9a1JIAuTChx38it2tvIOQiN+6cZo356Tbk1qIYw98orJVUg/ncndbK6gT8NVZuikWrMVqyluHs98TOOHkKsQ2SWOWxrAyjsq04VOJ2d1Q= X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB2312; 6:iRPlt7E3o04J1BPjNoF6JWucuiZA3ObQbaMtNu+6ogwWJOhe5+psq1xnD8KuAln5LgWNMeKVhAR/pmbd8sQRC5hY0lSS8i8RlL0UWE+kBB/Yr4Frl+p0U5Jh+zLkBjVHmKBp3JTCmvGIKkXrsEaMvvG+eXfHZrqlfTsQNSS9afDECri39AgIU32LUFrplPBs5NGzMN1fItEy2L0AaO0ihL3BC9qF9379H3WjPHHGE5pATn1wcU4SrjmKalIYKAfA1Ti8fPNNrXNEvayvV26b/soC2DX9Sc7R/drVUpuJZYF9owfqLOoN+o0733J4NLrqFjR6cIKeGUvsv5xvdDTsX77wYsXgW1EYuxcYp901aFM2XKU0RMhxtoXKHmbAqQhqACD+mpxBtsarsYlMSxl2d9BbzP4xA3M+nvpwVvtu65YDox2dS5eYV6JWvDeTM7CChneMEcYMo+Do8iOHoRIdmw==; 5:gnJIeYki0Ga6R6HWEekmwuyJEZkeju9ByztaKdcRFl/vbGmBgpoMg/Xuvymnd5DfKdLxn3bWVuKQX3PPtsTn2xpZf6ySoy0qrgCxYXcvxMbKDfi9LGkGvR9PwC4H0F+Z/wY/z9r/FZGUkhb4N6FGCPFesiFcGeE5ZyycCnXy+s8=; 7:aRN6USdGxb4O0xLz8cvQqLjaPVA3r/+5pRwl9vu/uZuox32QfvBKlOxAywS2qrDktAE7GxC0DLW6tlcJ7qVLP2gJ9aoXj6XnCoSb/U75wpJS+Rox6EzMJJA3QVS3OjRnNK8Z8bhVNLJ0Bd+thSrjdIsaGJUBOBXsJljLrb7pziT6zCN4VsVCPS7tAdUA71tT8GwmFVoZLRmfqo+Z+W4alex8JrF/unl37uXiSRuvB+hcC5dPH1qkAgNkFIebVB2r SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 16:42:54.1800 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a442028e-9de2-41aa-3f4f-08d5fee05322 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[P-EXFEND-EQX-01.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB2312 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-10_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=596 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808100179 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 16:43:08 -0000 >> +++ head/sbin/ipfw/ipfw2.c Thu Aug 9 12:46:30 2018 (r337536) >> @@ -3271,9 +3271,11 @@ ipfw_delete(char *av[]) >> exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i); >> if (exitval) { >> exitval = EX_UNAVAILABLE; >> - warn("rule %u not available", i); >> + if (co.do_quiet) >> + continue; >> + warn("nat %u not available", i); Was the change in the message intentional? Thanks, Phil From owner-svn-src-all@freebsd.org Fri Aug 10 18:44:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0FF1071DA5; Fri, 10 Aug 2018 18:44:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4C7D75C73; Fri, 10 Aug 2018 18:44:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x243.google.com with SMTP id b90-v6so4402263plb.0; Fri, 10 Aug 2018 11:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=uYVPmDVDbf3wLBeKFc805tRxMHoUWmFF2z8PKLPQw2rZU1LQjZvVY+9/aarcL00qmr NfK3wiUR7dUua6PKJS2zSw+QXFHEJUTwL6gEiAXWnKAkMKEWlQipQv8GlujRvgRXpkyg ikwz/yEpVg2eEuNbssbEzqjECFqtqTTXgeUAVwVt494pXzSxYbBZNza4RhX2TaXfbkLT eFMwzxdOKMHJCNOKAlH7DZzwBkeyz2R6F8oMpIILfXIIZ4Q1UM7pwlUlVlbAhsHNzP4z 16oyZTyZdCwAlMZKXe/+S3mN+iDDzNpFnRTp9/3ybbRL49ytx2+s4tR6nQvn+y+UzlbT i8Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=CIOyu8bDLtzGPfBpzU5IsQBsMDROO4CBjgH5FgXuvIdNWYy930AS7o/C2Riiju3ykj LfulmzkcDGJXYtFxT2k1DijZR/1hed2BYsOxS2P2HsFXT6/z3IgTYXSpA+eKYk65h1up yEIQTQHTt3cGusWtE+Is9JbiNKwHRIzfmoCfSSCUwQtKUsvBuHbTmI64+J4rUtA1iO8b rR8xhaS+5JIAkyxt312v/c2gWMyUV4f6D06VU778LTtba/pelXpMpB184dZHy97dhQQ4 JHm94iKWxJw6+IjlskBTLJpsuAfM5/YG0EE7s61e58lw4NQbFOVPW4H9thaXVih3LiXZ TN1g== X-Gm-Message-State: AOUpUlED5o4NYcrrafnOu5EI6Zv+sUidAwTjgD48kX7IZ5IwhxqV2eZ5 htPuwoIZ2Q2IjHc97K6lfvpzSAft X-Google-Smtp-Source: AA+uWPzeSxV+Fc1WLvRuydmthKrvJj4uATnUrv0oYkyeEUIM2r9VAXUjbk5plXGcJ7XrrCaAIsbatg== X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr7073984plr.231.1533926669942; Fri, 10 Aug 2018 11:44:29 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id x2-v6sm19458650pfi.166.2018.08.10.11.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 11:44:28 -0700 (PDT) Sender: Mark Johnston Date: Fri, 10 Aug 2018 14:44:26 -0400 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337426 - head/sbin/ifconfig Message-ID: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180810092251.K1276@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 18:44:31 -0000 On Fri, Aug 10, 2018 at 10:25:50AM +1000, Bruce Evans wrote: > On Tue, 7 Aug 2018, Mark Johnston wrote: > > > Log: > > ifconfig: Fix use of _Noreturn. > > > > The _Noreturn is a function-specifier (like inline) which must preceed > > the declarator. > > > > Submitted by: Sebastian Huber > > MFC after: 1 week > > _Noreturn is even more broken than I knew. It should never be used. Here > its use is wronger than usual. > > > Modified: head/sbin/ifconfig/ifconfig.c > > ============================================================================== > > --- head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:13:42 2018 (r337425) > > +++ head/sbin/ifconfig/ifconfig.c Tue Aug 7 17:25:38 2018 (r337426) > > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > > struct ifaddrs *ifa); > > static void tunnel_status(int s); > > -static void usage(void) _Noreturn; > > +static _Noreturn void usage(void); > > > > static struct afswtch *af_getbyname(const char *name); > > static struct afswtch *af_getbyfamily(int af); > > FreeBSD code should use __dead2 since it is more portable (within > FreeBSD) and doesn't have so mean syntactical restrictions. However, > it only exists at all since it had similar syntactial restrictions > when it was new (FreeBSD-1 used __dead, which must be placed like > _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed > there when it was new), and the macro that hides the details was renamed > to inhibit misuse. Changing __dead2 to _Noreturn and moving it to satisfy > the restricted syntax of the latter mainly broke support for old compilers > where __dead2 cannot be placed there. __dead2 was never present. _Noreturn was added in r317755, apparently to appease Coverity. > However, all declarations of static usage() as non-returning are bogus, ... I can only agree, especially since exit() is already declared with _Noreturn in stdlib.h. I don't understand why __dead2/_Noreturn keeps getting added to various usage() declarations. From owner-svn-src-all@freebsd.org Fri Aug 10 18:48:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89AB11071E56 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14C4575E18 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94; Fri, 10 Aug 2018 18:48:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7AIm9Dt061807; Fri, 10 Aug 2018 12:48:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533926889.9860.199.camel@freebsd.org> Subject: Re: svn commit: r337426 - head/sbin/ifconfig From: Ian Lepore To: Mark Johnston , Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 10 Aug 2018 12:48:09 -0600 In-Reply-To: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> <20180810184426.GB52302@raichu> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 18:48:19 -0000 On Fri, 2018-08-10 at 14:44 -0400, Mark Johnston wrote: > On Fri, Aug 10, 2018 at 10:25:50AM +1000, Bruce Evans wrote: > > > > On Tue, 7 Aug 2018, Mark Johnston wrote: > > > > > > > > Log: > > >  ifconfig: Fix use of _Noreturn. > > > > > >  The _Noreturn is a function-specifier (like inline) which must preceed > > >  the declarator. > > > > > >  Submitted by: Sebastian Huber > > >  MFC after: 1 week > > _Noreturn is even more broken than I knew.  It should never be used.  Here > > its use is wronger than usual. > > > > > > > > Modified: head/sbin/ifconfig/ifconfig.c > > > ============================================================================== > > > --- head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:13:42 2018 (r337425) > > > +++ head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:25:38 2018 (r337426) > > > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > > > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > > > struct ifaddrs *ifa); > > > static void tunnel_status(int s); > > > -static void usage(void) _Noreturn; > > > +static _Noreturn void usage(void); > > > > > > static struct afswtch *af_getbyname(const char *name); > > > static struct afswtch *af_getbyfamily(int af); > > FreeBSD code should use __dead2 since it is more portable (within > > FreeBSD) and doesn't have so mean syntactical restrictions.  However, > > it only exists at all since it had similar syntactial restrictions > > when it was new (FreeBSD-1 used __dead, which must be placed like > > _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed > > there when it was new), and the macro that hides the details was renamed > > to inhibit misuse.  Changing __dead2 to _Noreturn and moving it to satisfy > > the restricted syntax of the latter mainly broke support for old compilers > > where __dead2 cannot be placed there. > __dead2 was never present.  _Noreturn was added in r317755, apparently > to appease Coverity. > > > > > However, all declarations of static usage() as non-returning are bogus, ... > I can only agree, especially since exit() is already declared with > _Noreturn in stdlib.h.  I don't understand why __dead2/_Noreturn keeps > getting added to various usage() declarations. > It was getting added to appease some not-very-capable static code analyzer. Not Coverity, not clang's builtin analyzer, something else someone was using, I forget the details. -- Ian From owner-svn-src-all@freebsd.org Fri Aug 10 19:19:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B95810727F6; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 115EB76EA2; Fri, 10 Aug 2018 19:19:09 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0D274887; Fri, 10 Aug 2018 19:19:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJJ8xt060456; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJJ87w060452; Fri, 10 Aug 2018 19:19:08 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808101919.w7AJJ87w060452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 Aug 2018 19:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337583 - in head/sys/cam: . ata nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata nvme scsi X-SVN-Commit-Revision: 337583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 19:19:09 -0000 Author: cem Date: Fri Aug 10 19:19:07 2018 New Revision: 337583 URL: https://svnweb.freebsd.org/changeset/base/337583 Log: Walk back r337554 while discussion continues The idea was to get the uncontroversial mechanical change out of the way, then get the meatier functional changes reviewed subsequently. I had not realized that the immediately adjacent issue was addressed in a different direction in r334506 (see Warner's guidance in D15592). Discussion continues, trying to determine if there is a secondary issue still[1] and how best to fix it. With 12-related activities coming up, while that is ongoing, just take this back for now. [1]: Shutdown-time eventhandler events fire normally during panic's reboot path. Driver callbacks that attempt to issue and wait on interrupt- completed IO may never complete, hanging the system. This is particularly obnoxious in the shutdown/panic path, as the debugger cannot be entered anymore and the hang prevents reboot restoring availability. (There's nothing CAM-specific about this problem -- any shutdown event-triggered driver could do something like this during panic. But most NICs, etc. don't try to send spin-down commands at shutdown. ;-)) Discussed with: imp, markj Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_ccb.h head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/ata/ata_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1081,7 +1081,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical (u_int8_t *) virtual, length, ada_default_timeout*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count >= 256)) { @@ -1116,7 +1115,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical NULL, 0, 5*1000); - ataio.ccb_h.xflags |= CAM_CCB_DUMP; if (softc->flags & ADA_FLAG_CAN_48BIT) ata_48bit_cmd(&ataio, ATA_FLUSHCACHE48, 0, 0, 0); @@ -3501,7 +3499,6 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); - local_ccb.ccb_h.xflags |= CAM_CCB_DUMP; ata_28bit_cmd(&local_ccb, cmd, 0, 0, 0); error = cam_periph_runccb((union ccb *)&local_ccb, adaerror, /*cam_flags*/0, /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/cam_ccb.h Fri Aug 10 19:19:07 2018 (r337583) @@ -116,8 +116,7 @@ typedef enum { typedef enum { CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000008,/* use unmapped I/O */ - CAM_CCB_DUMP = 0x00000010,/* polled ccb during dump */ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/nvme/nvme_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -426,7 +426,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -440,7 +439,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical nvmeio.ccb_state = NDA_CCB_DUMP; nda_nvme_flush(softc, &nvmeio); - nvmeio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&nvmeio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Aug 10 16:35:04 2018 (r337582) +++ head/sys/cam/scsi/scsi_da.c Fri Aug 10 19:19:07 2018 (r337583) @@ -1847,7 +1847,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*dxfer_len*/length, /*sense_len*/SSD_FULL_SIZE, da_default_timeout * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) @@ -1870,7 +1869,6 @@ dadump(void *arg, void *virtual, vm_offset_t physical, /*lb_count*/0, SSD_FULL_SIZE, 5 * 1000); - csio.ccb_h.xflags |= CAM_CCB_DUMP; error = cam_periph_runccb((union ccb *)&csio, cam_periph_error, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) From owner-svn-src-all@freebsd.org Fri Aug 10 19:23:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 034D81072CBB; Fri, 10 Aug 2018 19:23:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA383774B3; Fri, 10 Aug 2018 19:23:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C1234A15; Fri, 10 Aug 2018 19:23:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJNKSs065453; Fri, 10 Aug 2018 19:23:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJNKPj065452; Fri, 10 Aug 2018 19:23:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201808101923.w7AJNKPj065452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 10 Aug 2018 19:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337584 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 337584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 19:23:21 -0000 Author: markj Date: Fri Aug 10 19:23:20 2018 New Revision: 337584 URL: https://svnweb.freebsd.org/changeset/base/337584 Log: Disable the D subroutines msgsize() and msgdsize(). They are specific to illumos and the corresponding DIF subroutines are already disabled on FreeBSD. Reported by: gnn Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 19:19:07 2018 (r337583) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Aug 10 19:23:20 2018 (r337584) @@ -343,13 +343,13 @@ static const dt_ident_t _dtrace_globals[] = { &dt_idops_func, "void(@)" }, { "mod", DT_IDENT_ACTFUNC, 0, DT_ACT_MOD, DT_ATTR_STABCMN, DT_VERS_1_2, &dt_idops_func, "_symaddr(uintptr_t)" }, +#ifdef illumos { "msgdsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGDSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, { "msgsize", DT_IDENT_FUNC, 0, DIF_SUBR_MSGSIZE, DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_func, "size_t(mblk_t *)" }, -#ifdef illumos { "mutex_owned", DT_IDENT_FUNC, 0, DIF_SUBR_MUTEX_OWNED, DT_ATTR_EVOLCMN, DT_VERS_1_0, &dt_idops_func, "int(genunix`kmutex_t *)" }, From owner-svn-src-all@freebsd.org Fri Aug 10 19:57:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FCB1073680; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 741B078461; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EBE54F00; Fri, 10 Aug 2018 19:57:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AJvuEL080968; Fri, 10 Aug 2018 19:57:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AJvuf4080967; Fri, 10 Aug 2018 19:57:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808101957.w7AJvuf4080967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 10 Aug 2018 19:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337585 - head/lib/libgcc_eh X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libgcc_eh X-SVN-Commit-Revision: 337585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 19:57:56 -0000 Author: dim Date: Fri Aug 10 19:57:55 2018 New Revision: 337585 URL: https://svnweb.freebsd.org/changeset/base/337585 Log: In r308100, an explicit -fexceptions flag was added for the C sources from LLVM's libunwind, which end up in libgcc_eh.a and libgcc_s.so. This is because the unwinder needs the unwinder data for its own functions. However, for the C++ sources in libunwind, -fexceptions is already the default, and this can have the side effect of generating a reference to __gxx_personality_v0, the so-called personality function, which is normally provided by the C++ ABI library (libcxxrt or libsupc++). If the reference ends up in the eventual libgcc_s.so, linking any non-C++ programs against it will fail with "undefined reference to `__gxx_personality_v0'". Note that at high optimization levels, the reference is usually optimized away, which is why we have never noticed this problem before. With clang 7.0.0 though, higher optimization levels don't help anymore, since the addition of address-significance tables [1] in . Effectively, this always causes a reference to __gxx_personality_v0. After discussion with the upstream author of that change, it turns out that we should compile libunwind sources with the -fno-exceptions -funwind-tables flags instead. This ensures unwind tables are generated, but no references to any personality functions are emitted. [1] https://lists.llvm.org/pipermail/llvm-dev/2018-May/123514.html Reported by: jbeich PR: 230399 MFC after: 1 week Modified: head/lib/libgcc_eh/Makefile.inc Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Aug 10 19:23:20 2018 (r337584) +++ head/lib/libgcc_eh/Makefile.inc Fri Aug 10 19:57:55 2018 (r337585) @@ -20,7 +20,10 @@ SRCS_EXC+= libunwind.cpp SRCS+= ${SRCS_EXC} .for file in ${SRCS_EXC:M*.c} -CFLAGS.${file}+= -fexceptions +CFLAGS.${file}+= -fno-exceptions -funwind-tables +.endfor +.for file in ${SRCS_EXC:M*.cpp} +CXXFLAGS.${file}+= -fno-exceptions -funwind-tables .endfor CFLAGS+= -I${UNWINDINCDIR} -I${.CURDIR} -D_LIBUNWIND_IS_NATIVE_ONLY From owner-svn-src-all@freebsd.org Fri Aug 10 20:05:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEBF610738BE; Fri, 10 Aug 2018 20:05:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF2178909; Fri, 10 Aug 2018 20:05:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F99C5095; Fri, 10 Aug 2018 20:05:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AK5pX8086020; Fri, 10 Aug 2018 20:05:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AK5fSr085963; Fri, 10 Aug 2018 20:05:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808102005.w7AK5fSr085963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 20:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337586 - in vendor/lua/dist: . doc src X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in vendor/lua/dist: . doc src X-SVN-Commit-Revision: 337586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:05:53 -0000 Author: kevans Date: Fri Aug 10 20:05:41 2018 New Revision: 337586 URL: https://svnweb.freebsd.org/changeset/base/337586 Log: Import lua 5.3.5 Modified: vendor/lua/dist/README vendor/lua/dist/doc/contents.html vendor/lua/dist/doc/lua.css vendor/lua/dist/doc/manual.html vendor/lua/dist/doc/readme.html vendor/lua/dist/src/Makefile vendor/lua/dist/src/lapi.c vendor/lua/dist/src/lapi.h vendor/lua/dist/src/lauxlib.c vendor/lua/dist/src/lauxlib.h vendor/lua/dist/src/lbaselib.c vendor/lua/dist/src/lbitlib.c vendor/lua/dist/src/lcode.c vendor/lua/dist/src/lcode.h vendor/lua/dist/src/lcorolib.c vendor/lua/dist/src/lctype.c vendor/lua/dist/src/lctype.h vendor/lua/dist/src/ldblib.c vendor/lua/dist/src/ldebug.c vendor/lua/dist/src/ldebug.h vendor/lua/dist/src/ldo.c vendor/lua/dist/src/ldo.h vendor/lua/dist/src/ldump.c vendor/lua/dist/src/lfunc.c vendor/lua/dist/src/lfunc.h vendor/lua/dist/src/lgc.c vendor/lua/dist/src/lgc.h vendor/lua/dist/src/linit.c vendor/lua/dist/src/liolib.c vendor/lua/dist/src/llex.c vendor/lua/dist/src/llex.h vendor/lua/dist/src/llimits.h vendor/lua/dist/src/lmathlib.c vendor/lua/dist/src/lmem.c vendor/lua/dist/src/lmem.h vendor/lua/dist/src/loadlib.c vendor/lua/dist/src/lobject.c vendor/lua/dist/src/lobject.h vendor/lua/dist/src/lopcodes.c vendor/lua/dist/src/lopcodes.h vendor/lua/dist/src/loslib.c vendor/lua/dist/src/lparser.c vendor/lua/dist/src/lparser.h vendor/lua/dist/src/lprefix.h vendor/lua/dist/src/lstate.c vendor/lua/dist/src/lstate.h vendor/lua/dist/src/lstring.c vendor/lua/dist/src/lstring.h vendor/lua/dist/src/lstrlib.c vendor/lua/dist/src/ltable.c vendor/lua/dist/src/ltable.h vendor/lua/dist/src/ltablib.c vendor/lua/dist/src/ltm.c vendor/lua/dist/src/ltm.h vendor/lua/dist/src/lua.c vendor/lua/dist/src/lua.h vendor/lua/dist/src/luac.c vendor/lua/dist/src/luaconf.h vendor/lua/dist/src/lualib.h vendor/lua/dist/src/lundump.c vendor/lua/dist/src/lundump.h vendor/lua/dist/src/lutf8lib.c vendor/lua/dist/src/lvm.c vendor/lua/dist/src/lvm.h vendor/lua/dist/src/lzio.c vendor/lua/dist/src/lzio.h Modified: vendor/lua/dist/README ============================================================================== --- vendor/lua/dist/README Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/README Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ -This is Lua 5.3.4, released on 12 Jan 2017. +This is Lua 5.3.5, released on 26 Jun 2018. For installation instructions, license details, and further information about Lua, see doc/readme.html. Modified: vendor/lua/dist/doc/contents.html ============================================================================== --- vendor/lua/dist/doc/contents.html Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/doc/contents.html Fri Aug 10 20:05:41 2018 (r337586) @@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see th

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -609,10 +609,10 @@ Freely available under the terms of the

Modified: vendor/lua/dist/doc/lua.css ============================================================================== --- vendor/lua/dist/doc/lua.css Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/doc/lua.css Fri Aug 10 20:05:41 2018 (r337586) @@ -10,7 +10,7 @@ body { line-height: 1.25 ; margin: 16px auto ; padding: 32px ; - border: solid #a0a0a0 1px ; + border: solid #ccc 1px ; border-radius: 20px ; max-width: 70em ; width: 90% ; @@ -111,36 +111,29 @@ pre.session { border-radius: 8px ; } -td.gutter { - width: 4% ; -} - -table.columns { +table { border: none ; border-spacing: 0 ; border-collapse: collapse ; } +td { + padding: 0 ; + margin: 0 ; +} + +td.gutter { + width: 4% ; +} + table.columns td { vertical-align: top ; - padding: 0 ; padding-bottom: 1em ; text-align: justify ; line-height: 1.25 ; } -p.logos a:link:hover, p.logos a:visited:hover { - background-color: inherit ; -} - -table.book { - border: none ; - border-spacing: 0 ; - border-collapse: collapse ; -} - table.book td { - padding: 0 ; vertical-align: top ; } @@ -157,6 +150,10 @@ table.book span { text-align: left ; display: block ; margin-top: 0.25em ; +} + +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; } img { Modified: vendor/lua/dist/doc/manual.html ============================================================================== --- vendor/lua/dist/doc/manual.html Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/doc/manual.html Fri Aug 10 20:05:41 2018 (r337586) @@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique de Figueiredo,

-Copyright © 2015–2017 Lua.org, PUC-Rio. +Copyright © 2015–2018 Lua.org, PUC-Rio. Freely available under the terms of the Lua license. @@ -35,7 +35,7 @@ Freely available under the terms of the

- + @@ -203,8 +203,8 @@ even those that do not support threads natively.

The type table implements associative arrays, -that is, arrays that can be indexed not only with numbers, -but with any Lua value except nil and NaN. +that is, arrays that can have as indices not only numbers, +but any Lua value except nil and NaN. (Not a Number is a special value used to represent undefined or unrepresentable numerical results, such as 0/0.) Tables can be heterogeneous; @@ -400,6 +400,8 @@ with the event name prefixed by two underscores; the corresponding values are called metamethods. In the previous example, the key is "__add" and the metamethod is the function that performs the addition. +Unless stated otherwise, +metamethods should be function values.

@@ -597,7 +599,7 @@ it is also slower than a real __le metame

  • __index: -The indexing access table[key]. +The indexing access operation table[key]. This event happens when table is not a table or when key is not present in table. The metamethod is looked up in table. @@ -1276,13 +1278,8 @@ Square brackets are used to index a table:
     	var ::= prefixexp ‘[’ exp ‘]

    -The meaning of accesses to table fields can be changed via metatables. -An access to an indexed variable t[i] is equivalent to -a call gettable_event(t,i). -(See §2.4 for a complete description of the -gettable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) +The meaning of accesses to table fields can be changed via metatables +(see §2.4).

    @@ -1477,25 +1474,20 @@ cyclically permutes the values of x, -The meaning of assignments to global variables -and table fields can be changed via metatables. -An assignment to an indexed variable t[i] = val is equivalent to -settable_event(t,i,val). -(See §2.4 for a complete description of the -settable_event function. -This function is not defined or callable in Lua. -We use it here only for explanatory purposes.) - - -

    An assignment to a global name x = val is equivalent to the assignment _ENV.x = val (see §2.2). +

    +The meaning of assignments to table fields and +global variables (which are actually table fields, too) +can be changed via metatables (see §2.4). + +

    3.3.4 – Control Structures

    The control structures if, while, and repeat have the usual meaning and @@ -1831,17 +1823,17 @@ Here are some examples: g(f(), x) -- f() is adjusted to 1 result g(x, f()) -- g gets x plus all results from f() a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil) - a,b = ... -- a gets the first vararg parameter, b gets + a,b = ... -- a gets the first vararg argument, b gets -- the second (both a and b can get nil if there - -- is no corresponding vararg parameter) + -- is no corresponding vararg argument) a,b,c = x, f() -- f() is adjusted to 2 results a,b,c = f() -- f() is adjusted to 3 results return f() -- returns all results from f() - return ... -- returns all received vararg parameters + return ... -- returns all received vararg arguments return x,y,f() -- returns x, y, and all results from f() {f()} -- creates a list with all results from f() - {...} -- creates a list with all vararg parameters + {...} -- creates a list with all vararg arguments {f(), nil} -- f() is adjusted to 1 result @@ -2039,9 +2031,12 @@ two objects are considered equal only if they are the Every time you create a new object (a table, userdata, or thread), this new object is different from any previously existing object. -Closures with the same reference are always equal. +A closure is always equal to itself. Closures with any detectable difference (different behavior, different definition) are always different. +Closures created at different times but with no detectable differences +may be classified as equal or not +(depending on internal caching details).

    @@ -2303,7 +2298,7 @@ If the value of prefixexp has type function, then this function is called with the given arguments. Otherwise, the prefixexp "call" metamethod is called, -having as first parameter the value of prefixexp, +having as first argument the value of prefixexp, followed by the original call arguments (see §2.4). @@ -2881,7 +2876,7 @@ it can do whatever it wants on that Lua state, as it should be already protected. However, when C code operates on other Lua states -(e.g., a Lua parameter to the function, +(e.g., a Lua argument to the function, a Lua state stored in the registry, or the result of lua_newthread), it should use them only in API calls that cannot raise errors. @@ -3370,7 +3365,7 @@ it is left unchanged. Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state. -On several platforms, you may not need to call this function, +In several platforms, you may not need to call this function, because all resources are naturally released when the host program ends. On the other hand, long-running programs that create multiple states, such as daemons or web servers, @@ -5584,7 +5579,7 @@ given as argument to a hook (see <

    -To get information about a function you push it onto the stack +To get information about a function, you push it onto the stack and start the what string with the character '>'. (In that case, lua_getinfo pops the function from the top of the stack.) @@ -6462,7 +6457,7 @@ file-related functions in the standard library

    Pushes onto the stack the field e from the metatable -of the object at index obj and returns the type of pushed value. +of the object at index obj and returns the type of the pushed value. If the object does not have a metatable, or if the metatable does not have this field, pushes nothing and returns LUA_TNIL. @@ -6749,7 +6744,7 @@ In words, if the argument arg is nil or a the macro results in the default dflt. Otherwise, it results in the result of calling func with the state L and the argument index arg as -parameters. +arguments. Note that it evaluates the expression dflt only if needed. @@ -8680,7 +8675,7 @@ the lowercase letters plus the '-' charac

    You can put a closing square bracket in a set by positioning it as the first character in the set. -You can put an hyphen in a set +You can put a hyphen in a set by positioning it as the first or the last character in the set. (You can also use an escape for both cases.) @@ -9082,8 +9077,8 @@ Returns the destination table a2.

    -Returns a new table with all parameters stored into keys 1, 2, etc. -and with a field "n" with the total number of parameters. +Returns a new table with all arguments stored into keys 1, 2, etc. +and with a field "n" with the total number of arguments. Note that the resulting table may not be a sequence. @@ -9215,7 +9210,7 @@ Returns the arc sine of x (in radians).

    Returns the arc tangent of y/x (in radians), -but uses the signs of both parameters to find the +but uses the signs of both arguments to find the quadrant of the result. (It also handles correctly the case of x being zero.) @@ -9516,7 +9511,7 @@ all I/O functions return nil on failure (plus an error message as a second result and a system-dependent error code as a third result) and some value different from nil on success. -On non-POSIX systems, +In non-POSIX systems, the computation of the error message and error code in case of errors may be not thread safe, @@ -9553,7 +9548,7 @@ When called with a file name, it opens the named file and sets its handle as the default input file. When called with a file handle, it simply sets this file handle as the default input file. -When called without parameters, +When called without arguments, it returns the current default input file. @@ -9580,7 +9575,7 @@ it returns no values (to finish the loop) and automati The call io.lines() (with no file name) is equivalent to io.input():lines("*l"); that is, it iterates over the lines of the default input file. -In this case it does not close the file when the loop ends. +In this case, the iterator does not close the file when the loop ends.

    @@ -9963,7 +9958,7 @@ the host system and on the current locale.

    -On non-POSIX systems, +In non-POSIX systems, this function may be not thread safe because of its reliance on C function gmtime and C function localtime. @@ -10163,7 +10158,7 @@ and explicitly removed when no longer needed.

    -On POSIX systems, +In POSIX systems, this function also creates a file with that name, to avoid security risks. (Someone else might create the file with wrong permissions @@ -10301,8 +10296,8 @@ The first parameter or local variable has index 1 following the order that they are declared in the code, counting only the variables that are active in the current scope of the function. -Negative indices refer to vararg parameters; --1 is the first vararg parameter. +Negative indices refer to vararg arguments; +-1 is the first vararg argument. The function returns nil if there is no variable with the given index, and raises an error when called with a level out of range. (You can call debug.getinfo to check whether the level is valid.) @@ -10400,7 +10395,7 @@ When called without arguments,

    -When the hook is called, its first parameter is a string +When the hook is called, its first argument is a string describing the event that has triggered its call: "call" (or "tail call"), "return", @@ -10551,7 +10546,8 @@ The options are:

    • -e stat: executes string stat;
    • -
    • -l mod: "requires" mod;
    • +
    • -l mod: "requires" mod and assigns the + result to global @mod;
    • -i: enters interactive mode after running script;
    • -v: prints version information;
    • -E: ignores environment variables;
    • @@ -10629,7 +10625,7 @@ For instance, the call

      will print "-e". If there is a script, -the script is called with parameters +the script is called with arguments arg[1], ···, arg[#arg]. (Like all chunks in Lua, the script is compiled as a vararg function.) @@ -10815,7 +10811,7 @@ The following functions were deprecated in the mathema frexp, and ldexp. You can replace math.pow(x,y) with x^y; you can replace math.atan2 with math.atan, -which now accepts one or two parameters; +which now accepts one or two arguments; you can replace math.ldexp(x,exp) with x * 2.0^exp. For the other operations, you can either use an external library or @@ -10850,7 +10846,7 @@ of the first result.)

      • -Continuation functions now receive as parameters what they needed +Continuation functions now receive as arguments what they needed to get through lua_getctx, so lua_getctx has been removed. Adapt your code accordingly. @@ -10973,12 +10969,13 @@ and LiteralString, see §3.1.) + Modified: vendor/lua/dist/doc/readme.html ============================================================================== --- vendor/lua/dist/doc/readme.html Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/doc/readme.html Fri Aug 10 20:05:41 2018 (r337586) @@ -107,7 +107,7 @@ Here are the details.
        1. Open a terminal window and move to -the top-level directory, which is named lua-5.3.x. +the top-level directory, which is named lua-5.3.5. The Makefile there controls both the build process and the installation process.

        2. @@ -355,10 +355,10 @@ THE SOFTWARE. Modified: vendor/lua/dist/src/Makefile ============================================================================== --- vendor/lua/dist/src/Makefile Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/Makefile Fri Aug 10 20:05:41 2018 (r337586) @@ -102,7 +102,7 @@ c89: freebsd: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc" generic: $(ALL) @@ -110,7 +110,7 @@ linux: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" macosx: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" mingw: $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \ Modified: vendor/lua/dist/src/lapi.c ============================================================================== --- vendor/lua/dist/src/lapi.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lapi.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp $ +** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc lua_lock(L); if (n == 0) { setfvalue(L->top, fn); + api_incr_top(L); } else { CClosure *cl; @@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunc /* does not need barrier because closure is white */ } setclCvalue(L, L->top, cl); + api_incr_top(L); + luaC_checkGC(L); } - api_incr_top(L); - luaC_checkGC(L); lua_unlock(L); } Modified: vendor/lua/dist/src/lapi.h ============================================================================== --- vendor/lua/dist/src/lapi.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lapi.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp $ +** $Id: lapi.h,v 2.9.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lauxlib.c ============================================================================== --- vendor/lua/dist/src/lauxlib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lauxlib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.289 2016/12/20 18:37:00 roberto Exp $ +** $Id: lauxlib.c,v 1.289.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lauxlib.h ============================================================================== --- vendor/lua/dist/src/lauxlib.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lauxlib.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.131 2016/12/06 14:54:31 roberto Exp $ +** $Id: lauxlib.h,v 1.131.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lbaselib.c ============================================================================== --- vendor/lua/dist/src/lbaselib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lbaselib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.314 2016/09/05 19:06:34 roberto Exp $ +** $Id: lbaselib.c,v 1.314.1.1 2017/04/19 17:39:34 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lbitlib.c ============================================================================== --- vendor/lua/dist/src/lbitlib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lbitlib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.30 2015/11/11 19:08:09 roberto Exp $ +** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lcode.c ============================================================================== --- vendor/lua/dist/src/lcode.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lcode.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 2.112 2016/12/22 13:08:50 roberto Exp $ +** $Id: lcode.c,v 2.112.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lcode.h ============================================================================== --- vendor/lua/dist/src/lcode.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lcode.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lcode.h,v 1.64 2016/01/05 16:22:37 roberto Exp $ +** $Id: lcode.h,v 1.64.1.1 2017/04/19 17:20:42 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lcorolib.c ============================================================================== --- vendor/lua/dist/src/lcorolib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lcorolib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lcorolib.c,v 1.10 2016/04/11 19:19:55 roberto Exp $ +** $Id: lcorolib.c,v 1.10.1.1 2017/04/19 17:20:42 roberto Exp $ ** Coroutine Library ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lctype.c ============================================================================== --- vendor/lua/dist/src/lctype.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lctype.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lctype.c,v 1.12 2014/11/02 19:19:04 roberto Exp $ +** $Id: lctype.c,v 1.12.1.1 2017/04/19 17:20:42 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lctype.h ============================================================================== --- vendor/lua/dist/src/lctype.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lctype.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lctype.h,v 1.12 2011/07/15 12:50:29 roberto Exp $ +** $Id: lctype.h,v 1.12.1.1 2013/04/12 18:48:47 roberto Exp $ ** 'ctype' functions for Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/ldblib.c ============================================================================== --- vendor/lua/dist/src/ldblib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldblib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.151 2015/11/23 11:29:43 roberto Exp $ +** $Id: ldblib.c,v 1.151.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/ldebug.c ============================================================================== --- vendor/lua/dist/src/ldebug.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldebug.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.121 2016/10/19 12:32:10 roberto Exp $ +** $Id: ldebug.c,v 2.121.1.2 2017/07/10 17:21:50 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -653,6 +653,7 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, CallInfo *ci = L->ci; const char *msg; va_list argp; + luaC_checkGC(L); /* error message uses memory */ va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); Modified: vendor/lua/dist/src/ldebug.h ============================================================================== --- vendor/lua/dist/src/ldebug.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldebug.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp $ +** $Id: ldebug.h,v 2.14.1.1 2017/04/19 17:20:42 roberto Exp $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/ldo.c ============================================================================== --- vendor/lua/dist/src/ldo.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldo.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.157 2016/12/13 15:52:21 roberto Exp $ +** $Id: ldo.c,v 2.157.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/ldo.h ============================================================================== --- vendor/lua/dist/src/ldo.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldo.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp $ +** $Id: ldo.h,v 2.29.1.1 2017/04/19 17:20:42 roberto Exp $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/ldump.c ============================================================================== --- vendor/lua/dist/src/ldump.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/ldump.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: ldump.c,v 2.37 2015/10/08 15:53:49 roberto Exp $ +** $Id: ldump.c,v 2.37.1.1 2017/04/19 17:20:42 roberto Exp $ ** save precompiled Lua chunks ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lfunc.c ============================================================================== --- vendor/lua/dist/src/lfunc.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lfunc.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 roberto Exp $ +** $Id: lfunc.c,v 2.45.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lfunc.h ============================================================================== --- vendor/lua/dist/src/lfunc.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lfunc.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.15 2015/01/13 15:49:11 roberto Exp $ +** $Id: lfunc.h,v 2.15.1.1 2017/04/19 17:39:34 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lgc.c ============================================================================== --- vendor/lua/dist/src/lgc.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lgc.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lgc.c,v 2.215 2016/12/22 13:08:50 roberto Exp $ +** $Id: lgc.c,v 2.215.1.2 2017/08/31 16:15:27 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, G for (n = gnode(h, 0); n < limit; n++) { if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { setnilvalue(gval(n)); /* remove value ... */ - removeentry(n); /* and remove entry from table */ } + if (ttisnil(gval(n))) /* is entry empty? */ + removeentry(n); /* remove entry from table */ } } } Modified: vendor/lua/dist/src/lgc.h ============================================================================== --- vendor/lua/dist/src/lgc.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lgc.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 roberto Exp $ +** $Id: lgc.h,v 2.91.1.1 2017/04/19 17:39:34 roberto Exp $ ** Garbage Collector ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/linit.c ============================================================================== --- vendor/lua/dist/src/linit.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/linit.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: linit.c,v 1.39 2016/12/04 20:17:24 roberto Exp $ +** $Id: linit.c,v 1.39.1.1 2017/04/19 17:20:42 roberto Exp $ ** Initialization of libraries for lua.c and other clients ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/liolib.c ============================================================================== --- vendor/lua/dist/src/liolib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/liolib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp $ +** $Id: liolib.c,v 2.151.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -206,11 +206,16 @@ static int aux_close (lua_State *L) { } +static int f_close (lua_State *L) { + tofile(L); /* make sure argument is an open stream */ + return aux_close(L); +} + + static int io_close (lua_State *L) { if (lua_isnone(L, 1)) /* no argument? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ - tofile(L); /* make sure argument is an open stream */ - return aux_close(L); + return f_close(L); } @@ -712,7 +717,7 @@ static const luaL_Reg iolib[] = { ** methods for file handles */ static const luaL_Reg flib[] = { - {"close", io_close}, + {"close", f_close}, {"flush", f_flush}, {"lines", f_lines}, {"read", f_read}, Modified: vendor/lua/dist/src/llex.c ============================================================================== --- vendor/lua/dist/src/llex.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/llex.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.96 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.c,v 2.96.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/llex.h ============================================================================== --- vendor/lua/dist/src/llex.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/llex.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: llex.h,v 1.79 2016/05/02 14:02:12 roberto Exp $ +** $Id: llex.h,v 1.79.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/llimits.h ============================================================================== --- vendor/lua/dist/src/llimits.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/llimits.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.141 2015/11/19 19:16:22 roberto Exp $ +** $Id: llimits.h,v 1.141.1.1 2017/04/19 17:20:42 roberto Exp $ ** Limits, basic types, and some other 'installation-dependent' definitions ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lmathlib.c ============================================================================== --- vendor/lua/dist/src/lmathlib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lmathlib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.119 2016/12/22 13:08:50 roberto Exp $ +** $Id: lmathlib.c,v 1.119.1.1 2017/04/19 17:20:42 roberto Exp $ ** Standard mathematical library ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lmem.c ============================================================================== --- vendor/lua/dist/src/lmem.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lmem.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lmem.c,v 1.91 2015/03/06 19:45:54 roberto Exp $ +** $Id: lmem.c,v 1.91.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lmem.h ============================================================================== --- vendor/lua/dist/src/lmem.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lmem.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lmem.h,v 1.43 2014/12/19 17:26:14 roberto Exp $ +** $Id: lmem.h,v 1.43.1.1 2017/04/19 17:20:42 roberto Exp $ ** Interface to Memory Manager ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/loadlib.c ============================================================================== --- vendor/lua/dist/src/loadlib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/loadlib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: loadlib.c,v 1.130 2017/01/12 17:14:26 roberto Exp $ +** $Id: loadlib.c,v 1.130.1.1 2017/04/19 17:20:42 roberto Exp $ ** Dynamic library loader for Lua ** See Copyright Notice in lua.h ** Modified: vendor/lua/dist/src/lobject.c ============================================================================== --- vendor/lua/dist/src/lobject.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lobject.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.113 2016/12/22 13:08:50 roberto Exp $ +** $Id: lobject.c,v 2.113.1.1 2017/04/19 17:29:57 roberto Exp $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -435,7 +435,8 @@ const char *luaO_pushvfstring (lua_State *L, const cha } case 'p': { /* a pointer */ char buff[4*sizeof(void *) + 8]; /* should be enough space for a '%p' */ - int l = l_sprintf(buff, sizeof(buff), "%p", va_arg(argp, void *)); + void *p = va_arg(argp, void *); + int l = lua_pointer2str(buff, sizeof(buff), p); pushstr(L, buff, l); break; } Modified: vendor/lua/dist/src/lobject.h ============================================================================== --- vendor/lua/dist/src/lobject.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lobject.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.117 2016/08/01 19:51:24 roberto Exp $ +** $Id: lobject.h,v 2.117.1.1 2017/04/19 17:39:34 roberto Exp $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lopcodes.c ============================================================================== --- vendor/lua/dist/src/lopcodes.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lopcodes.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.c,v 1.55 2015/01/05 13:48:33 roberto Exp $ +** $Id: lopcodes.c,v 1.55.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lopcodes.h ============================================================================== --- vendor/lua/dist/src/lopcodes.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lopcodes.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.149 2016/07/19 17:12:21 roberto Exp $ +** $Id: lopcodes.h,v 1.149.1.1 2017/04/19 17:20:42 roberto Exp $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/loslib.c ============================================================================== --- vendor/lua/dist/src/loslib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/loslib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.65 2016/07/18 17:58:58 roberto Exp $ +** $Id: loslib.c,v 1.65.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -293,7 +293,8 @@ static int os_date (lua_State *L) { else stm = l_localtime(&t, &tmr); if (stm == NULL) /* invalid date? */ - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); if (strcmp(s, "*t") == 0) { lua_createtable(L, 0, 9); /* 9 = number of fields */ setallfields(L, stm); @@ -340,7 +341,8 @@ static int os_time (lua_State *L) { setallfields(L, &ts); /* update fields with normalized values */ } if (t != (time_t)(l_timet)t || t == (time_t)(-1)) - luaL_error(L, "time result cannot be represented in this installation"); + return luaL_error(L, + "time result cannot be represented in this installation"); l_pushtime(L, t); return 1; } Modified: vendor/lua/dist/src/lparser.c ============================================================================== --- vendor/lua/dist/src/lparser.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lparser.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 2.155 2016/08/01 19:51:24 roberto Exp $ +** $Id: lparser.c,v 2.155.1.2 2017/04/29 18:11:40 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -1392,7 +1392,7 @@ static void test_then_block (LexState *ls, int *escape luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ enterblock(fs, &bl, 0); /* must enter block before 'goto' */ gotostat(ls, v.t); /* handle goto/break */ - skipnoopstat(ls); /* skip other no-op statements */ + while (testnext(ls, ';')) {} /* skip colons */ if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ leaveblock(fs); return; /* and that is it */ Modified: vendor/lua/dist/src/lparser.h ============================================================================== --- vendor/lua/dist/src/lparser.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lparser.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.76 2015/12/30 18:16:13 roberto Exp $ +** $Id: lparser.h,v 1.76.1.1 2017/04/19 17:20:42 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lprefix.h ============================================================================== --- vendor/lua/dist/src/lprefix.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lprefix.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $ +** $Id: lprefix.h,v 1.2.1.1 2017/04/19 17:20:42 roberto Exp $ ** Definitions for Lua code that must come before any other header file ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lstate.c ============================================================================== --- vendor/lua/dist/src/lstate.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lstate.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.133 2015/11/13 12:16:51 roberto Exp $ +** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lstate.h ============================================================================== --- vendor/lua/dist/src/lstate.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lstate.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.133 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstate.h,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $ ** Global State ** See Copyright Notice in lua.h */ @@ -26,6 +26,24 @@ ** 'tobefnz': all objects ready to be finalized; ** 'fixedgc': all objects that are not to be collected (currently ** only small strings, such as reserved words). +** +** Moreover, there is another set of lists that control gray objects. +** These lists are linked by fields 'gclist'. (All objects that +** can become gray have such a field. The field is not the same +** in all objects, but it always has this name.) Any gray object +** must belong to one of these lists, and all objects in these lists +** must be gray: +** +** 'gray': regular gray objects, still waiting to be visited. +** 'grayagain': objects that must be revisited at the atomic phase. +** That includes +** - black objects got in a write barrier; +** - all kinds of weak tables during propagation phase; +** - all threads. +** 'weak': tables with weak values to be cleared; +** 'ephemeron': ephemeron tables with white->white entries; +** 'allweak': tables with weak keys and/or weak values to be cleared. +** The last three lists are used only during the atomic phase. */ Modified: vendor/lua/dist/src/lstring.c ============================================================================== --- vendor/lua/dist/src/lstring.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lstring.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.56 2015/11/23 11:32:51 roberto Exp $ +** $Id: lstring.c,v 2.56.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lstring.h ============================================================================== --- vendor/lua/dist/src/lstring.h Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lstring.h Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lstring.h,v 1.61 2015/11/03 15:36:01 roberto Exp $ +** $Id: lstring.h,v 1.61.1.1 2017/04/19 17:20:42 roberto Exp $ ** String table (keep all strings handled by Lua) ** See Copyright Notice in lua.h */ Modified: vendor/lua/dist/src/lstrlib.c ============================================================================== --- vendor/lua/dist/src/lstrlib.c Fri Aug 10 19:57:55 2018 (r337585) +++ vendor/lua/dist/src/lstrlib.c Fri Aug 10 20:05:41 2018 (r337586) @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstrlib.c,v 1.254.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -879,7 +879,7 @@ static int lua_number2strx (lua_State *L, char *buff, buff[i] = toupper(uchar(buff[i])); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 10 20:07:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53848107393C; Fri, 10 Aug 2018 20:07:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02F2F78E76; Fri, 10 Aug 2018 20:07:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBF4D5097; Fri, 10 Aug 2018 20:07:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AK70aA086141; Fri, 10 Aug 2018 20:07:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AK70KB086140; Fri, 10 Aug 2018 20:07:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808102007.w7AK70KB086140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 10 Aug 2018 20:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337587 - vendor/lua/5.3.5 X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/lua/5.3.5 X-SVN-Commit-Revision: 337587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:07:01 -0000 Author: kevans Date: Fri Aug 10 20:07:00 2018 New Revision: 337587 URL: https://svnweb.freebsd.org/changeset/base/337587 Log: Tag lua 5.3.5 Added: vendor/lua/5.3.5/ - copied from r337586, vendor/lua/dist/ From owner-svn-src-all@freebsd.org Fri Aug 10 20:08:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BD5910739C1; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E37C78FEF; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E7A15099; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AK80Kt086228; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AK80OW086227; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808102008.w7AK80OW086227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 10 Aug 2018 20:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Group: stable-10 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Commit-Revision: 337588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:08:00 -0000 Author: dteske Date: Fri Aug 10 20:07:59 2018 New Revision: 337588 URL: https://svnweb.freebsd.org/changeset/base/337588 Log: MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout) PR: bin/229806 Reported by: Andreas Sommer Sponsored by: Smule, Inc. Modified: stable/10/usr.sbin/sysrc/sysrc Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/sysrc/sysrc stable/9/usr.sbin/sysrc/sysrc Directory Properties: stable/11/ (props changed) stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/sysrc/ (props changed) Modified: stable/10/usr.sbin/sysrc/sysrc ============================================================================== --- stable/10/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:00 2018 (r337587) +++ stable/10/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:59 2018 (r337588) @@ -860,7 +860,8 @@ while [ $# -gt 0 ]; do *) if ! IGNORED=$( f_sysrc_get "$NAME?" ); then [ "$IGNORE_UNKNOWNS" -o "$QUIET" ] || - echo "$pgm: unknown variable '$NAME'" + f_err "%s: unknown variable '%s'\n" \ + "$pgm" "$NAME" shift 1 status=$FAILURE continue From owner-svn-src-all@freebsd.org Fri Aug 10 20:08:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F069310739C7; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBD878FF1; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DFCA509A; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AK80A5086234; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AK80ou086233; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808102008.w7AK80ou086233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 10 Aug 2018 20:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Group: stable-9 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Commit-Revision: 337588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:08:01 -0000 Author: dteske Date: Fri Aug 10 20:07:59 2018 New Revision: 337588 URL: https://svnweb.freebsd.org/changeset/base/337588 Log: MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout) PR: bin/229806 Reported by: Andreas Sommer Sponsored by: Smule, Inc. Modified: stable/9/usr.sbin/sysrc/sysrc Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/sysrc/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/sysrc/sysrc stable/11/usr.sbin/sysrc/sysrc Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/9/usr.sbin/sysrc/sysrc ============================================================================== --- stable/9/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:00 2018 (r337587) +++ stable/9/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:59 2018 (r337588) @@ -674,7 +674,8 @@ while [ $# -gt 0 ]; do *) if ! IGNORED=$( f_sysrc_get "$NAME?" ); then [ "$IGNORE_UNKNOWNS" -o "$QUIET" ] || - echo "$pgm: unknown variable '$NAME'" + f_err "%s: unknown variable '%s'\n" \ + "$pgm" "$NAME" shift 1 status=$FAILURE continue From owner-svn-src-all@freebsd.org Fri Aug 10 20:08:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46BA810739CC; Fri, 10 Aug 2018 20:08:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F111478FF7; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2936509B; Fri, 10 Aug 2018 20:08:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AK80nG086240; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AK80Ae086239; Fri, 10 Aug 2018 20:08:00 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808102008.w7AK80Ae086239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 10 Aug 2018 20:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337588 - in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable: 10/usr.sbin/sysrc 11/usr.sbin/sysrc 9/usr.sbin/sysrc X-SVN-Commit-Revision: 337588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:08:01 -0000 Author: dteske Date: Fri Aug 10 20:07:59 2018 New Revision: 337588 URL: https://svnweb.freebsd.org/changeset/base/337588 Log: MFC SVN r336350: Send sysrc(8) error message to stderr (not stdout) PR: bin/229806 Reported by: Andreas Sommer Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/sysrc/sysrc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.sbin/sysrc/sysrc stable/9/usr.sbin/sysrc/sysrc Directory Properties: stable/10/ (props changed) stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/sysrc/ (props changed) Modified: stable/11/usr.sbin/sysrc/sysrc ============================================================================== --- stable/11/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:00 2018 (r337587) +++ stable/11/usr.sbin/sysrc/sysrc Fri Aug 10 20:07:59 2018 (r337588) @@ -874,7 +874,8 @@ while [ $# -gt 0 ]; do *) if ! IGNORED=$( f_sysrc_get "$NAME?" ); then [ "$IGNORE_UNKNOWNS" -o "$QUIET" ] || - echo "$pgm: unknown variable '$NAME'" + f_err "%s: unknown variable '%s'\n" \ + "$pgm" "$NAME" shift 1 status=$FAILURE continue From owner-svn-src-all@freebsd.org Fri Aug 10 20:37:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C439310749C3; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79D2A7A2B7; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 568955574; Fri, 10 Aug 2018 20:37:33 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7AKbXJC001679; Fri, 10 Aug 2018 20:37:33 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7AKbWWB001675; Fri, 10 Aug 2018 20:37:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808102037.w7AKbWWB001675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Fri, 10 Aug 2018 20:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337589 - in head/sys: dev/cx i386/include net80211 netinet X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head/sys: dev/cx i386/include net80211 netinet X-SVN-Commit-Revision: 337589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 20:37:34 -0000 Author: dteske Date: Fri Aug 10 20:37:32 2018 New Revision: 337589 URL: https://svnweb.freebsd.org/changeset/base/337589 Log: Fix misspellings of transmitter/transmitted Reviewed by: emaste, bcr Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D16025 Modified: head/sys/dev/cx/cxddk.c head/sys/i386/include/cserial.h head/sys/net80211/ieee80211_hwmp.c head/sys/netinet/sctp_indata.c Modified: head/sys/dev/cx/cxddk.c ============================================================================== --- head/sys/dev/cx/cxddk.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/dev/cx/cxddk.c Fri Aug 10 20:37:32 2018 (r337589) @@ -215,7 +215,7 @@ void cx_enable_receive (cx_chan_t *c, int on) } /* - * Turn the transmiter on/off. + * Turn the transmitter on/off. */ void cx_enable_transmit (cx_chan_t *c, int on) { Modified: head/sys/i386/include/cserial.h ============================================================================== --- head/sys/i386/include/cserial.h Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/i386/include/cserial.h Fri Aug 10 20:37:32 2018 (r337589) @@ -89,7 +89,7 @@ struct e3_statistics { #define ER_SCC_FRAMING 7 /* subchannel framing error */ #define ER_SCC_OVERFLOW 8 /* subchannel receive buffer overflow */ #define ER_SCC_OVERRUN 9 /* subchannel receiver overrun */ -#define ER_SCC_UNDERRUN 10 /* subchannel transmiter underrun */ +#define ER_SCC_UNDERRUN 10 /* subchannel transmitter underrun */ #define ER_BUS 11 /* system bus is too busy (e.g PCI) */ /* Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/net80211/ieee80211_hwmp.c Fri Aug 10 20:37:32 2018 (r337589) @@ -920,7 +920,7 @@ hwmp_update_transmitter(struct ieee80211vap *vap, stru rttran->rt_metric > metric) { IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, - "%s path to transmiter %6D of %s, metric %d:%d", + "%s path to transmitter %6D of %s, metric %d:%d", rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ? "prefer" : "update", ni->ni_macaddr, ":", hwmp_frame, rttran->rt_metric, metric); Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Fri Aug 10 20:07:59 2018 (r337588) +++ head/sys/netinet/sctp_indata.c Fri Aug 10 20:37:32 2018 (r337589) @@ -3078,7 +3078,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /*- - * True non-retransmited chunk + * True non-retransmitted chunk */ tp1->whoTo->net_ack2 += tp1->send_size; @@ -4056,7 +4056,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 tp1->whoTo->net_ack += tp1->send_size; if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += @@ -4676,7 +4676,7 @@ hopeless_peer: if (tp1->snd_count < 2) { /* - * True non-retransmited + * True non-retransmitted * chunk */ tp1->whoTo->net_ack2 += From owner-svn-src-all@freebsd.org Fri Aug 10 23:42:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9251F1078A9F; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488708147A; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A89A73ED; Fri, 10 Aug 2018 23:42:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7ANgCJE099980; Fri, 10 Aug 2018 23:42:12 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7ANgCPl099300; Fri, 10 Aug 2018 23:42:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201808102342.w7ANgCPl099300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 10 Aug 2018 23:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337594 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 337594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Aug 2018 23:42:13 -0000 Author: mmacy Date: Fri Aug 10 23:42:11 2018 New Revision: 337594 URL: https://svnweb.freebsd.org/changeset/base/337594 Log: ZFS/MFV: Use cached feature info in spa_add_feature_stats() commit 417104bdd3c7ce07ec58674dd078f9891c3bc780 Author: Ned Bass Date: Thu Feb 26 12:24:11 2015 -0800 Use cached feature info in spa_add_feature_stats() Avoid issuing I/O to the pool when retrieving feature flags information. Trying to read the ZAPs from disk means that zpool clear would hang if the pool is suspended and recovery would require a reboot. To keep the feature stats resident in memory, we hang a cached nvlist off of the spa. It is built up from disk the first time spa_add_feature_stats() is called, and refreshed thereafter using the cached feature reference counts. spa_add_feature_stats() gets called at pool import time so we can be sure the cached nvlist will be available if the pool is later suspended. Signed-off-by: Ned Bass Signed-off-by: Brian Behlendorf Closes #3082 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Aug 10 23:42:11 2018 (r337594) @@ -4371,18 +4371,14 @@ spa_add_l2cache(spa_t *spa, nvlist_t *config) } static void -spa_add_feature_stats(spa_t *spa, nvlist_t *config) +spa_feature_stats_from_disk(spa_t *spa, nvlist_t *features) { - nvlist_t *features; zap_cursor_t zc; zap_attribute_t za; - ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); - VERIFY(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP) == 0); - /* We may be unable to read features if pool is suspended. */ if (spa_suspended(spa)) - goto out; + return; if (spa->spa_feat_for_read_obj != 0) { for (zap_cursor_init(&zc, spa->spa_meta_objset, @@ -4391,7 +4387,7 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); @@ -4404,16 +4400,62 @@ spa_add_feature_stats(spa_t *spa, nvlist_t *config) zap_cursor_advance(&zc)) { ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); - VERIFY3U(0, ==, nvlist_add_uint64(features, za.za_name, + VERIFY0(nvlist_add_uint64(features, za.za_name, za.za_first_integer)); } zap_cursor_fini(&zc); } +} -out: - VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, - features) == 0); - nvlist_free(features); +static void +spa_feature_stats_from_cache(spa_t *spa, nvlist_t *features) +{ + int i; + + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t feature = spa_feature_table[i]; + uint64_t refcount; + + if (feature_get_refcount(spa, &feature, &refcount) != 0) + continue; + + VERIFY0(nvlist_add_uint64(features, feature.fi_guid, refcount)); + } +} + +/* + * Store a list of pool features and their reference counts in the + * config. + * + * The first time this is called on a spa, allocate a new nvlist, fetch + * the pool features and reference counts from disk, then save the list + * in the spa. In subsequent calls on the same spa use the saved nvlist + * and refresh its values from the cached reference counts. This + * ensures we don't block here on I/O on a suspended pool so 'zpool + * clear' can resume the pool. + */ +static void +spa_add_feature_stats(spa_t *spa, nvlist_t *config) +{ + nvlist_t *features; + + ASSERT(spa_config_held(spa, SCL_CONFIG, RW_READER)); + + mutex_enter(&spa->spa_feat_stats_lock); + features = spa->spa_feat_stats; + + if (features != NULL) { + spa_feature_stats_from_cache(spa, features); + } else { + VERIFY0(nvlist_alloc(&features, NV_UNIQUE_NAME, KM_SLEEP)); + spa->spa_feat_stats = features; + spa_feature_stats_from_disk(spa, features); + } + + VERIFY0(nvlist_add_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, + features)); + + mutex_exit(&spa->spa_feat_stats_lock); } int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Aug 10 23:42:11 2018 (r337594) @@ -708,6 +708,7 @@ spa_add(const char *name, nvlist_t *config, const char mutex_init(&spa->spa_scrub_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_feat_stats_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL); cv_init(&spa->spa_evicting_os_cv, NULL, CV_DEFAULT, NULL); @@ -881,6 +882,7 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_label_features); nvlist_free(spa->spa_load_info); + nvlist_free(spa->spa_feat_stats); spa_config_set(spa, NULL); #ifdef illumos @@ -922,6 +924,7 @@ spa_remove(spa_t *spa) mutex_destroy(&spa->spa_scrub_lock); mutex_destroy(&spa->spa_suspend_lock); mutex_destroy(&spa->spa_vdev_top_lock); + mutex_destroy(&spa->spa_feat_stats_lock); kmem_free(spa, sizeof (spa_t)); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Aug 10 23:42:11 2018 (r337594) @@ -360,6 +360,8 @@ struct spa { uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ uint64_t spa_feat_enabled_txg_obj; /* Feature enabled txg */ + kmutex_t spa_feat_stats_lock; /* protects spa_feat_stats */ + nvlist_t *spa_feat_stats; /* Cache of enabled features */ /* cache feature refcounts */ uint64_t spa_feat_refcount_cache[SPA_FEATURES]; #ifdef illumos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Aug 10 21:40:28 2018 (r337593) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Fri Aug 10 23:42:11 2018 (r337594) @@ -220,7 +220,7 @@ spa_features_check(spa_t *spa, boolean_t for_write, * * Note: well-designed features will not need to use this; they should * use spa_feature_is_enabled() and spa_feature_is_active() instead. - * However, this is non-static for zdb and zhack. + * However, this is non-static for zdb, zhack, and spa_add_feature_stats(). */ int feature_get_refcount(spa_t *spa, zfeature_info_t *feature, uint64_t *res) From owner-svn-src-all@freebsd.org Sat Aug 11 00:09:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2347D1079317; Sat, 11 Aug 2018 00:09:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDA9581F4F; Sat, 11 Aug 2018 00:08:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 997017728; Sat, 11 Aug 2018 00:08:59 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B08xJJ010300; Sat, 11 Aug 2018 00:08:59 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B08xUO010299; Sat, 11 Aug 2018 00:08:59 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808110008.w7B08xUO010299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 00:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337595 - head/contrib/pf/pflogd X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/contrib/pf/pflogd X-SVN-Commit-Revision: 337595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 00:09:00 -0000 Author: sevan (doc committer) Date: Sat Aug 11 00:08:59 2018 New Revision: 337595 URL: https://svnweb.freebsd.org/changeset/base/337595 Log: Fix escaping, otherwise Dx gets translated as the macro for DragonFly. From 2018 Linuxhotel Hackathon & DevSummit Approved by: eadler Obtained from: OpenBSD r1.49 Differential Revision: https://reviews.freebsd.org/D16616 Modified: head/contrib/pf/pflogd/pflogd.8 Modified: head/contrib/pf/pflogd/pflogd.8 ============================================================================== --- head/contrib/pf/pflogd/pflogd.8 Fri Aug 10 23:42:11 2018 (r337594) +++ head/contrib/pf/pflogd/pflogd.8 Sat Aug 11 00:08:59 2018 (r337595) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22 2008 +.Dd August 11, 2018 .Dt PFLOGD 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pflogd .Bk -words -.Op Fl Dx +.Op Fl \&Dx .Op Fl d Ar delay .Op Fl f Ar filename .Op Fl i Ar interface From owner-svn-src-all@freebsd.org Sat Aug 11 02:56:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04BC105B3C1; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67830881A2; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 460D511359; Sat, 11 Aug 2018 02:56:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B2uihu096159; Sat, 11 Aug 2018 02:56:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B2uiOI096158; Sat, 11 Aug 2018 02:56:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808110256.w7B2uiOI096158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 11 Aug 2018 02:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337600 - head/usr.bin/stat X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/stat X-SVN-Commit-Revision: 337600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 02:56:44 -0000 Author: cem Date: Sat Aug 11 02:56:43 2018 New Revision: 337600 URL: https://svnweb.freebsd.org/changeset/base/337600 Log: stat(1): cache id->name resolution When invoked on a large list of files, it is most common for a small number of uids/gids to own most of the results. Like ls(1), use pwcache(3) to avoid repeatedly looking up the same IDs. Example microbenchmark and non-scientific results: $ time (find /usr/src -type f -print0 | xargs -0 stat >/dev/null) BEFORE: 3.62s user 5.23s system 102% cpu 8.655 total 3.47s user 5.38s system 102% cpu 8.647 total AFTER: 1.23s user 1.81s system 108% cpu 2.810 total 1.43s user 1.54s system 107% cpu 2.754 total Does this microbenchmark have any real-world significance? Until a use case is demonstrated otherwise, I doubt it. Ordinarily I would be resistant to optimizing pointless microbenchmarks in base utilities (e.g., recent totally gratuitous changes to yes(1)). However, the pwcache(3) APIs actually simplify stat(1) logic ever so slightly compared to the raw APIs they wrap, so I think this is at worst harmless. PR: 230491 Reported by: Thomas Hurst Discussed with: gad@ Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Sat Aug 11 01:54:45 2018 (r337599) +++ head/usr.bin/stat/stat.c Sat Aug 11 02:56:43 2018 (r337600) @@ -619,8 +619,6 @@ format1(const struct stat *st, char *stmp, lfmt[24], tmp[20]; const char *sdata; char smode[12], sid[12], path[PATH_MAX + 4]; - struct passwd *pw; - struct group *gr; const struct timespec *tsp; struct timespec ts; struct tm *tm; @@ -717,9 +715,8 @@ format1(const struct stat *st, case SHOW_st_uid: small = (sizeof(st->st_uid) == 4); data = st->st_uid; - if ((pw = getpwuid(st->st_uid)) != NULL) - sdata = pw->pw_name; - else { + sdata = user_from_uid(st->st_uid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_uid); sdata = sid; } @@ -731,9 +728,8 @@ format1(const struct stat *st, case SHOW_st_gid: small = (sizeof(st->st_gid) == 4); data = st->st_gid; - if ((gr = getgrgid(st->st_gid)) != NULL) - sdata = gr->gr_name; - else { + sdata = group_from_gid(st->st_gid, 1); + if (sdata == NULL) { snprintf(sid, sizeof(sid), "(%ld)", (long)st->st_gid); sdata = sid; } From owner-svn-src-all@freebsd.org Sat Aug 11 04:23:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21518105D51D; Sat, 11 Aug 2018 04:23:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB2148B324; Sat, 11 Aug 2018 04:23:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93318122BD; Sat, 11 Aug 2018 04:23:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B4N3b3043831; Sat, 11 Aug 2018 04:23:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4N3LR043830; Sat, 11 Aug 2018 04:23:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201808110423.w7B4N3LR043830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 11 Aug 2018 04:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337607 - in head/sys: amd64/amd64 dev/efidev X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/amd64 dev/efidev X-SVN-Commit-Revision: 337607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:23:04 -0000 Author: kevans Date: Sat Aug 11 04:23:03 2018 New Revision: 337607 URL: https://svnweb.freebsd.org/changeset/base/337607 Log: Destroy a couple of rogue svn:mergeinfo Modified: Directory Properties: head/sys/amd64/amd64/efirt_machdep.c (props changed) head/sys/dev/efidev/efirt.c (props changed) From owner-svn-src-all@freebsd.org Sat Aug 11 04:55:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C22105DD4F; Sat, 11 Aug 2018 04:55:49 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C176C8BF2D; Sat, 11 Aug 2018 04:55:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CE7112799; Sat, 11 Aug 2018 04:55:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B4tm7b058897; Sat, 11 Aug 2018 04:55:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B4tloY058893; Sat, 11 Aug 2018 04:55:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808110455.w7B4tloY058893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 11 Aug 2018 04:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337609 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 337609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 04:55:49 -0000 Author: np Date: Sat Aug 11 04:55:47 2018 New Revision: 337609 URL: https://svnweb.freebsd.org/changeset/base/337609 Log: cxgbe(4): Create two variants of service_iq, one for queues with freelists and one for those without. MFH: 3 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/adapter.h Sat Aug 11 04:55:47 2018 (r337609) @@ -670,6 +670,7 @@ struct sge_wrq { #define INVALID_NM_RXQ_CNTXT_ID ((uint16_t)(-1)) struct sge_nm_rxq { + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ struct vi_info *vi; struct iq_desc *iq_desc; @@ -797,7 +798,6 @@ struct adapter { struct irq { struct resource *res; int rid; - volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; @@ -1186,9 +1186,10 @@ void release_tid(struct adapter *, int, struct sge_wrq #ifdef DEV_NETMAP /* t4_netmap.c */ +struct sge_nm_rxq; void cxgbe_nm_attach(struct vi_info *); void cxgbe_nm_detach(struct vi_info *); -void t4_nm_intr(void *); +void service_nm_rxq(struct sge_nm_rxq *); #endif /* t4_sge.c */ @@ -1207,7 +1208,10 @@ int t4_setup_vi_queues(struct vi_info *); int t4_teardown_vi_queues(struct vi_info *); void t4_intr_all(void *); void t4_intr(void *); +#ifdef DEV_NETMAP +void t4_nm_intr(void *); void t4_vi_intr(void *); +#endif void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_main.c Sat Aug 11 04:55:47 2018 (r337609) @@ -684,8 +684,8 @@ struct { #ifdef TCP_OFFLOAD /* - * service_iq() has an iq and needs the fl. Offset of fl from the iq should be - * exactly the same for both rxq and ofld_rxq. + * service_iq_fl() has an iq and needs the fl. Offset of fl from the iq should + * be exactly the same for both rxq and ofld_rxq. */ CTASSERT(offsetof(struct sge_ofld_rxq, iq) == offsetof(struct sge_rxq, iq)); CTASSERT(offsetof(struct sge_ofld_rxq, fl) == offsetof(struct sge_rxq, fl)); @@ -4819,9 +4819,26 @@ t4_setup_intr_handlers(struct adapter *sc) #ifdef DEV_NETMAP if (q < vi->nnmrxq) irq->nm_rxq = nm_rxq++; + + if (irq->nm_rxq != NULL && + irq->rxq == NULL) { + /* Netmap rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_nm_intr, irq->nm_rxq, s); + } + if (irq->nm_rxq != NULL && + irq->rxq != NULL) { + /* NIC and Netmap rx */ + rc = t4_alloc_irq(sc, irq, rid, + t4_vi_intr, irq, s); + } #endif - rc = t4_alloc_irq(sc, irq, rid, - t4_vi_intr, irq, s); + if (irq->rxq != NULL && + irq->nm_rxq == NULL) { + /* NIC rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_intr, irq->rxq, s); + } if (rc != 0) return (rc); #ifdef RSS Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_netmap.c Sat Aug 11 04:55:47 2018 (r337609) @@ -358,8 +358,6 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi nm_set_native_flags(na); for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_on(kring) || nm_rxq->iq_cntxt_id != INVALID_NM_RXQ_CNTXT_ID) @@ -387,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON); + atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { @@ -459,14 +457,12 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v free_nm_txq_hwq(vi, nm_txq); } for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - kring = na->rx_rings[nm_rxq->nid]; if (!nm_kring_pending_off(kring) || nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID) continue; - while (!atomic_cmpset_int(&irq->nm_state, NM_ON, NM_OFF)) + while (!atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); free_nm_rxq_hwq(vi, nm_rxq); @@ -955,9 +951,8 @@ handle_nm_sge_egr_update(struct adapter *sc, struct if } void -t4_nm_intr(void *arg) +service_nm_rxq(struct sge_nm_rxq *nm_rxq) { - struct sge_nm_rxq *nm_rxq = arg; struct vi_info *vi = nm_rxq->vi; struct adapter *sc = vi->pi->adapter; struct ifnet *ifp = vi->ifp; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 04:26:29 2018 (r337608) +++ head/sys/dev/cxgbe/t4_sge.c Sat Aug 11 04:55:47 2018 (r337609) @@ -204,6 +204,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); +static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); @@ -1333,8 +1334,12 @@ t4_teardown_vi_queues(struct vi_info *vi) } /* - * Deals with errors and the firmware event queue. All data rx queues forward - * their interrupt to the firmware event queue. + * Interrupt handler when the driver is using only 1 interrupt. This is a very + * unusual scenario. + * + * a) Deals with errors, if any. + * b) Services firmware event queue, which is taking interrupts for all other + * queues. */ void t4_intr_all(void *arg) @@ -1342,14 +1347,16 @@ t4_intr_all(void *arg) struct adapter *sc = arg; struct sge_iq *fwq = &sc->sge.fwq; + MPASS(sc->intr_count == 1); + t4_intr_err(arg); - if (atomic_cmpset_int(&fwq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(fwq, 0); - atomic_cmpset_int(&fwq->state, IQS_BUSY, IQS_IDLE); - } + t4_intr_evt(fwq); } -/* Deals with error interrupts */ +/* + * Interrupt handler for errors (installed directly when multiple interrupts are + * being used, or called by t4_intr_all). + */ void t4_intr_err(void *arg) { @@ -1359,6 +1366,10 @@ t4_intr_err(void *arg) t4_slow_intr_handler(sc); } +/* + * Interrupt handler for iq-only queues. The firmware event queue is the only + * such queue right now. + */ void t4_intr_evt(void *arg) { @@ -1370,90 +1381,74 @@ t4_intr_evt(void *arg) } } +/* + * Interrupt handler for iq+fl queues. + */ void t4_intr(void *arg) { struct sge_iq *iq = arg; if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(iq, 0); + service_iq_fl(iq, 0); atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } +#ifdef DEV_NETMAP +/* + * Interrupt handler for netmap rx queues. + */ void -t4_vi_intr(void *arg) +t4_nm_intr(void *arg) { - struct irq *irq = arg; + struct sge_nm_rxq *nm_rxq = arg; -#ifdef DEV_NETMAP - if (atomic_cmpset_int(&irq->nm_state, NM_ON, NM_BUSY)) { - t4_nm_intr(irq->nm_rxq); - atomic_cmpset_int(&irq->nm_state, NM_BUSY, NM_ON); + if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { + service_nm_rxq(nm_rxq); + atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } -#endif - if (irq->rxq != NULL) - t4_intr(irq->rxq); } -static inline int -sort_before_lro(struct lro_ctrl *lro) +/* + * Interrupt handler for vectors shared between NIC and netmap rx queues. + */ +void +t4_vi_intr(void *arg) { + struct irq *irq = arg; - return (lro->lro_mbuf_max != 0); + MPASS(irq->nm_rxq != NULL); + t4_nm_intr(irq->nm_rxq); + + MPASS(irq->rxq != NULL); + t4_intr(irq->rxq); } +#endif /* - * Deals with anything and everything on the given ingress queue. + * Deals with interrupts on an iq-only (no freelist) queue. */ static int service_iq(struct sge_iq *iq, int budget) { struct sge_iq *q; - struct sge_rxq *rxq = iq_to_rxq(iq); /* Use iff iq is part of rxq */ - struct sge_fl *fl; /* Use iff IQ_HAS_FL */ struct adapter *sc = iq->adapter; struct iq_desc *d = &iq->desc[iq->cidx]; int ndescs = 0, limit; - int rsp_type, refill; + int rsp_type; uint32_t lq; - uint16_t fl_hw_cidx; - struct mbuf *m0; STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); -#if defined(INET) || defined(INET6) - const struct timeval lro_timeout = {0, sc->lro_timeout}; - struct lro_ctrl *lro = &rxq->lro; -#endif KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + KASSERT((iq->flags & IQ_HAS_FL) == 0, + ("%s: called for iq %p with fl (iq->flags 0x%x)", __func__, iq, + iq->flags)); + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); + MPASS((iq->flags & IQ_LRO_ENABLED) == 0); limit = budget ? budget : iq->qsize / 16; - if (iq->flags & IQ_HAS_FL) { - fl = &rxq->fl; - fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ - } else { - fl = NULL; - fl_hw_cidx = 0; /* to silence gcc warning */ - } - -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_ADJ_CREDIT) { - MPASS(sort_before_lro(lro)); - iq->flags &= ~IQ_ADJ_CREDIT; - if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { - tcp_lro_flush_all(lro); - t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | - V_INGRESSQID((u32)iq->cntxt_id) | - V_SEINTARM(iq->intr_params)); - return (0); - } - ndescs = 1; - } -#else - MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); -#endif - /* * We always come back and check the descriptor ring for new indirect * interrupts and other responses after running a single handler. @@ -1463,74 +1458,40 @@ service_iq(struct sge_iq *iq, int budget) rmb(); - refill = 0; - m0 = NULL; rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); lq = be32toh(d->rsp.pldbuflen_qid); switch (rsp_type) { case X_RSPD_TYPE_FLBUF: + panic("%s: data for an iq (%p) with no freelist", + __func__, iq); - KASSERT(iq->flags & IQ_HAS_FL, - ("%s: data for an iq (%p) with no freelist", - __func__, iq)); + /* NOTREACHED */ - m0 = get_fl_payload(sc, fl, lq); - if (__predict_false(m0 == NULL)) - goto process_iql; - refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; -#ifdef T4_PKT_TIMESTAMP - /* - * 60 bit timestamp for the payload is - * *(uint64_t *)m0->m_pktdat. Note that it is - * in the leading free-space in the mbuf. The - * kernel can clobber it during a pullup, - * m_copymdata, etc. You need to make sure that - * the mbuf reaches you unmolested if you care - * about the timestamp. - */ - *(uint64_t *)m0->m_pktdat = - be64toh(ctrl->u.last_flit) & - 0xfffffffffffffff; -#endif - - /* fall through */ - case X_RSPD_TYPE_CPL: KASSERT(d->rss.opcode < NUM_CPL_CMDS, ("%s: bad opcode %02x.", __func__, d->rss.opcode)); - t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, NULL); break; case X_RSPD_TYPE_INTR: - /* - * Interrupts should be forwarded only to queues - * that are not forwarding their interrupts. - * This means service_iq can recurse but only 1 - * level deep. - */ - KASSERT(budget == 0, - ("%s: budget %u, rsp_type %u", __func__, - budget, rsp_type)); - - /* * There are 1K interrupt-capable queues (qids 0 * through 1023). A response type indicating a * forwarded interrupt with a qid >= 1K is an * iWARP async notification. */ - if (lq >= 1024) { - t4_an_handler(iq, &d->rsp); - break; - } + if (__predict_true(lq >= 1024)) { + t4_an_handler(iq, &d->rsp); + break; + } q = sc->sge.iqmap[lq - sc->sge.iq_start - sc->sge.iq_base]; if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { - if (service_iq(q, q->qsize / 16) == 0) { + if (service_iq_fl(q, q->qsize / 16) == 0) { atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { @@ -1563,33 +1524,12 @@ service_iq(struct sge_iq *iq, int budget) V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); ndescs = 0; -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && - !sort_before_lro(lro) && - sc->lro_timeout != 0) { - tcp_lro_flush_inactive(lro, - &lro_timeout); - } -#endif - if (budget) { - if (iq->flags & IQ_HAS_FL) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - } return (EINPROGRESS); } } - if (refill) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - fl_hw_cidx = fl->hw_cidx; - } } -process_iql: if (STAILQ_EMPTY(&iql)) break; @@ -1599,13 +1539,168 @@ process_iql: */ q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); - if (service_iq(q, q->qsize / 8) == 0) + if (service_iq_fl(q, q->qsize / 8) == 0) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); } + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); + + return (0); +} + +static inline int +sort_before_lro(struct lro_ctrl *lro) +{ + + return (lro->lro_mbuf_max != 0); +} + +/* + * Deals with interrupts on an iq+fl queue. + */ +static int +service_iq_fl(struct sge_iq *iq, int budget) +{ + struct sge_rxq *rxq = iq_to_rxq(iq); + struct sge_fl *fl; + struct adapter *sc = iq->adapter; + struct iq_desc *d = &iq->desc[iq->cidx]; + int ndescs = 0, limit; + int rsp_type, refill, starved; + uint32_t lq; + uint16_t fl_hw_cidx; + struct mbuf *m0; #if defined(INET) || defined(INET6) + const struct timeval lro_timeout = {0, sc->lro_timeout}; + struct lro_ctrl *lro = &rxq->lro; +#endif + + KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + MPASS(iq->flags & IQ_HAS_FL); + + limit = budget ? budget : iq->qsize / 16; + fl = &rxq->fl; + fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_ADJ_CREDIT) { + MPASS(sort_before_lro(lro)); + iq->flags &= ~IQ_ADJ_CREDIT; + if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { + tcp_lro_flush_all(lro); + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | + V_INGRESSQID((u32)iq->cntxt_id) | + V_SEINTARM(iq->intr_params)); + return (0); + } + ndescs = 1; + } +#else + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); +#endif + + while ((d->rsp.u.type_gen & F_RSPD_GEN) == iq->gen) { + + rmb(); + + refill = 0; + m0 = NULL; + rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); + lq = be32toh(d->rsp.pldbuflen_qid); + + switch (rsp_type) { + case X_RSPD_TYPE_FLBUF: + + m0 = get_fl_payload(sc, fl, lq); + if (__predict_false(m0 == NULL)) + goto out; + refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; +#ifdef T4_PKT_TIMESTAMP + /* + * 60 bit timestamp for the payload is + * *(uint64_t *)m0->m_pktdat. Note that it is + * in the leading free-space in the mbuf. The + * kernel can clobber it during a pullup, + * m_copymdata, etc. You need to make sure that + * the mbuf reaches you unmolested if you care + * about the timestamp. + */ + *(uint64_t *)m0->m_pktdat = + be64toh(ctrl->u.last_flit) & 0xfffffffffffffff; +#endif + + /* fall through */ + + case X_RSPD_TYPE_CPL: + KASSERT(d->rss.opcode < NUM_CPL_CMDS, + ("%s: bad opcode %02x.", __func__, d->rss.opcode)); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + break; + + case X_RSPD_TYPE_INTR: + + /* + * There are 1K interrupt-capable queues (qids 0 + * through 1023). A response type indicating a + * forwarded interrupt with a qid >= 1K is an + * iWARP async notification. That is the only + * acceptable indirect interrupt on this queue. + */ + if (__predict_false(lq < 1024)) { + panic("%s: indirect interrupt on iq_fl %p " + "with qid %u", __func__, iq, lq); + } + + t4_an_handler(iq, &d->rsp); + break; + + default: + KASSERT(0, ("%s: illegal response type %d on iq %p", + __func__, rsp_type, iq)); + log(LOG_ERR, "%s: illegal response type %d on iq %p", + device_get_nameunit(sc->dev), rsp_type, iq); + break; + } + + d++; + if (__predict_false(++iq->cidx == iq->sidx)) { + iq->cidx = 0; + iq->gen ^= F_RSPD_GEN; + d = &iq->desc[0]; + } + if (__predict_false(++ndescs == limit)) { + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID(iq->cntxt_id) | + V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); + ndescs = 0; + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_LRO_ENABLED && + !sort_before_lro(lro) && + sc->lro_timeout != 0) { + tcp_lro_flush_inactive(lro, &lro_timeout); + } +#endif + if (budget) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + + return (EINPROGRESS); + } + } + if (refill) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_hw_cidx = fl->hw_cidx; + } + } +out: +#if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { if (ndescs > 0 && lro->lro_mbuf_count > 8) { MPASS(sort_before_lro(lro)); @@ -1621,15 +1716,11 @@ process_iql: t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); - if (iq->flags & IQ_HAS_FL) { - int starved; - - FL_LOCK(fl); - starved = refill_fl(sc, fl, 64); - FL_UNLOCK(fl); - if (__predict_false(starved != 0)) - add_fl_to_sfl(sc, fl); - } + FL_LOCK(fl); + starved = refill_fl(sc, fl, 64); + FL_UNLOCK(fl); + if (__predict_false(starved != 0)) + add_fl_to_sfl(sc, fl); return (0); } From owner-svn-src-all@freebsd.org Sat Aug 11 06:13:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D7D2105FAC1; Sat, 11 Aug 2018 06:13:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1700D8E094; Sat, 11 Aug 2018 06:13:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6C7D1346E; Sat, 11 Aug 2018 06:13:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B6DB6r099339; Sat, 11 Aug 2018 06:13:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B6DBgK099338; Sat, 11 Aug 2018 06:13:11 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808110613.w7B6DBgK099338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 11 Aug 2018 06:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337610 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 06:13:12 -0000 Author: dteske Date: Sat Aug 11 06:13:11 2018 New Revision: 337610 URL: https://svnweb.freebsd.org/changeset/base/337610 Log: dwatch(1): Fix syntax error in vop_readdir profile Reported by: Arne Ehrlich MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/libexec/vop_readdir Modified: head/cddl/usr.sbin/dwatch/libexec/vop_readdir ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/vop_readdir Sat Aug 11 04:55:47 2018 (r337609) +++ head/cddl/usr.sbin/dwatch/libexec/vop_readdir Sat Aug 11 06:13:11 2018 (r337610) @@ -163,6 +163,7 @@ $PROBE /this->fi_mount != 0/ /* probe ID $(( $ID + $MA this->path = strjoin(this->path, strjoin(this->name = (this->d_name != 0 ? this->d_name : ""), this->name != "" ? "/" : "")); +} EOF ACTIONS=$( cat <&9 ) ID=$(( $ID + $MAX_DEPTH + 5 )) From owner-svn-src-all@freebsd.org Sat Aug 11 06:32:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A13BB1060184; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55D2F8EA33; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36D49137B8; Sat, 11 Aug 2018 06:32:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B6WWao009977; Sat, 11 Aug 2018 06:32:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B6WVE9009976; Sat, 11 Aug 2018 06:32:31 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201808110632.w7B6WVE9009976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 11 Aug 2018 06:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 06:32:32 -0000 Author: dteske Date: Sat Aug 11 06:32:31 2018 New Revision: 337611 URL: https://svnweb.freebsd.org/changeset/base/337611 Log: dwatch(1): Add systop profile Provides a top-like view of syscall consumers. MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Added: head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 2018 (r337610) +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 2018 (r337611) @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused Added: head/cddl/usr.sbin/dwatch/libexec/systop ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dwatch/libexec/systop Sat Aug 11 06:32:31 2018 (r337611) @@ -0,0 +1,84 @@ +# -*- tab-width: 4 -*- ;; Emacs +# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM +############################################################ IDENT(1) +# +# $Title: dwatch(8) profile for top-like syscall $ +# $Copyright: 2014-2018 Devin Teske. All rights reserved. $ +# $FreeBSD$ +# +############################################################ DESCRIPTION +# +# Every 3 seconds update the screen with syscall consumers. +# +############################################################ PRAGMAS + +# Optional: You can override the default pragmas (shown below) + +DTRACE_PRAGMA=" + option quiet + option aggsortrev +" # END-QUOTE + +############################################################ PROBE + +: ${PROBE:=profile:::tick-3s} + +############################################################ ACTIONS + +exec 9< /dev/null ) +rows="${size%% *}" +cols="${size#* }" + +exec 9< Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B501062EFD; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8D871964; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EFBB14B07; Sat, 11 Aug 2018 08:34:25 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7B8YPYa070989; Sat, 11 Aug 2018 08:34:25 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7B8YPeY070988; Sat, 11 Aug 2018 08:34:25 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808110834.w7B8YPeY070988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 08:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337612 - head/sbin/mount_cd9660 X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/mount_cd9660 X-SVN-Commit-Revision: 337612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 08:34:25 -0000 Author: sevan (doc committer) Date: Sat Aug 11 08:34:24 2018 New Revision: 337612 URL: https://svnweb.freebsd.org/changeset/base/337612 Log: Advise reader to also see mdconfig(8) in mount_cd9660(8). It's useful for how to mount an iso file via loopback. Reviewed by: jilles Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D16067 Modified: head/sbin/mount_cd9660/mount_cd9660.8 Modified: head/sbin/mount_cd9660/mount_cd9660.8 ============================================================================== --- head/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 06:32:31 2018 (r337611) +++ head/sbin/mount_cd9660/mount_cd9660.8 Sat Aug 11 08:34:24 2018 (r337612) @@ -32,7 +32,7 @@ .\" @(#)mount_cd9660.8 8.3 (Berkeley) 3/27/94 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd August 11, 2018 .Dt MOUNT_CD9660 8 .Os .Sh NAME @@ -140,6 +140,7 @@ The following command can be used to mount a Kodak Pho .Xr unmount 2 , .Xr cd9660 5 , .Xr fstab 5 , +.Xr mdconfig 8 , .Xr mount 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Sat Aug 11 10:21:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66AFB1065DA1; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A3BB74F99; Sat, 11 Aug 2018 10:21:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFB8515C1A; Sat, 11 Aug 2018 10:21:21 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BALLAC025579; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BALL6L025578; Sat, 11 Aug 2018 10:21:21 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808111021.w7BALL6L025578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 10:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337614 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 10:21:22 -0000 Author: sevan (doc committer) Date: Sat Aug 11 10:21:21 2018 New Revision: 337614 URL: https://svnweb.freebsd.org/changeset/base/337614 Log: Drop the ternary operator for calculating ssid display length in list_scan(). Regardless if a verbose scan is required or not, we'd still want to display the full SSID name by default so use the IEE80211_NWID_LEN constant to set the value to use instead. Tested on rene@'s laptop. Reviewed by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16566 Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Aug 11 09:32:20 2018 (r337613) +++ head/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:21:21 2018 (r337614) @@ -3496,7 +3496,7 @@ list_scan(int s) uint8_t buf[24*1024]; char ssid[IEEE80211_NWID_LEN+1]; const uint8_t *cp; - int len, ssidmax, idlen; + int len, idlen; if (get80211len(s, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf), &len) < 0) errx(1, "unable to get scan results"); @@ -3505,9 +3505,8 @@ list_scan(int s) getchaninfo(s); - ssidmax = verbose ? IEEE80211_NWID_LEN : 32; printf("%-*.*s %-17.17s %4s %4s %-7s %3s %4s\n" - , ssidmax, ssidmax, "SSID/MESH ID" + , IEEE80211_NWID_LEN, IEEE80211_NWID_LEN, "SSID/MESH ID" , "BSSID" , "CHAN" , "RATE" @@ -3530,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , ssidmax - , copy_essid(ssid, ssidmax, idp, idlen) + , IEE80211_NWID_LEN + , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) From owner-svn-src-all@freebsd.org Sat Aug 11 10:42:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EB9106685F; Sat, 11 Aug 2018 10:42:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCE6275CCF; Sat, 11 Aug 2018 10:42:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF9CA16029; Sat, 11 Aug 2018 10:42:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BAgCC8035451; Sat, 11 Aug 2018 10:42:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BAgC56035450; Sat, 11 Aug 2018 10:42:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111042.w7BAgC56035450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 10:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337615 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 337615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 10:42:13 -0000 Author: dim Date: Sat Aug 11 10:42:12 2018 New Revision: 337615 URL: https://svnweb.freebsd.org/changeset/base/337615 Log: Pull in r338481 from upstream llvm trunk (by Chandler Carruth): [x86] Fix a really subtle miscompile due to a somewhat glaring bug in EFLAGS copy lowering. If you have a branch of LLVM, you may want to cherrypick this. It is extremely unlikely to hit this case empirically, but it will likely manifest as an "impossible" branch being taken somewhere, and will be ... very hard to debug. Hitting this requires complex conditions living across complex control flow combined with some interesting memory (non-stack) initialized with the results of a comparison. Also, because you have to arrange for an EFLAGS copy to be in *just* the right place, almost anything you do to the code will hide the bug. I was unable to reduce anything remotely resembling a "good" test case from the place where I hit it, and so instead I have constructed synthetic MIR testing that directly exercises the bug in question (as well as the good behavior for completeness). The issue is that we would mistakenly assume any SETcc with a valid condition and an initial operand that was a register and a virtual register at that to be a register *defining* SETcc... It isn't though.... This would in turn cause us to test some other bizarre register, typically the base pointer of some memory. Now, testing this register and using that to branch on doesn't make any sense. It even fails the machine verifier (if you are running it) due to the wrong register class. But it will make it through LLVM, assemble, and it *looks* fine... But wow do you get a very unsual and surprising branch taken in your actual code. The fix is to actually check what kind of SETcc instruction we're dealing with. Because there are a bunch of them, I just test the may-store bit in the instruction. I've also added an assert for sanity that ensure we are, in fact, *defining* the register operand. =D Noticed by: kib MFC after: 1 week Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 11 10:21:21 2018 (r337614) +++ head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Sat Aug 11 10:42:12 2018 (r337615) @@ -608,9 +608,12 @@ X86FlagsCopyLoweringPass::collectCondsInRegs(MachineBa for (MachineInstr &MI : llvm::reverse( llvm::make_range(MBB.instr_begin(), CopyDefI.getIterator()))) { X86::CondCode Cond = X86::getCondFromSETOpc(MI.getOpcode()); - if (Cond != X86::COND_INVALID && MI.getOperand(0).isReg() && - TRI->isVirtualRegister(MI.getOperand(0).getReg())) + if (Cond != X86::COND_INVALID && !MI.mayStore() && MI.getOperand(0).isReg() && + TRI->isVirtualRegister(MI.getOperand(0).getReg())) { + assert(MI.getOperand(0).isDef() && + "A non-storing SETcc should always define a register!"); CondRegs[Cond] = MI.getOperand(0).getReg(); + } // Stop scanning when we see the first definition of the EFLAGS as prior to // this we would potentially capture the wrong flag state. From owner-svn-src-all@freebsd.org Sat Aug 11 11:05:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D5010674AB; Sat, 11 Aug 2018 11:05:23 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBBD276B99; Sat, 11 Aug 2018 11:05:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C00F5164F7; Sat, 11 Aug 2018 11:05:22 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BB5MrO048443; Sat, 11 Aug 2018 11:05:22 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BB5Msw048442; Sat, 11 Aug 2018 11:05:22 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201808111105.w7BB5Msw048442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sat, 11 Aug 2018 11:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337617 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 337617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 11:05:23 -0000 Author: sevan (doc committer) Date: Sat Aug 11 11:05:22 2018 New Revision: 337617 URL: https://svnweb.freebsd.org/changeset/base/337617 Log: IEEE! Pointy hat: myself Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Aug 11 10:49:43 2018 (r337616) +++ head/sbin/ifconfig/ifieee80211.c Sat Aug 11 11:05:22 2018 (r337617) @@ -3529,8 +3529,8 @@ list_scan(int s) idlen = sr->isr_ssid_len; } printf("%-*.*s %s %3d %3dM %4d:%-4d %4d %-4.4s" - , IEE80211_NWID_LEN - , copy_essid(ssid, IEE80211_NWID_LEN, idp, idlen) + , IEEE80211_NWID_LEN + , copy_essid(ssid, IEEE80211_NWID_LEN, idp, idlen) , ssid , ether_ntoa((const struct ether_addr *) sr->isr_bssid) , ieee80211_mhz2ieee(sr->isr_freq, sr->isr_flags) From owner-svn-src-all@freebsd.org Sat Aug 11 11:13:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D70110679F6; Sat, 11 Aug 2018 11:13:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39B26771CD; Sat, 11 Aug 2018 11:13:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15881166D3; Sat, 11 Aug 2018 11:13:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BBDYNT053400; Sat, 11 Aug 2018 11:13:34 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BBDYTM053399; Sat, 11 Aug 2018 11:13:34 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201808111113.w7BBDYTM053399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 11 Aug 2018 11:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337618 - head/usr.bin/printf X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/usr.bin/printf X-SVN-Commit-Revision: 337618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 11:13:35 -0000 Author: jilles Date: Sat Aug 11 11:13:34 2018 New Revision: 337618 URL: https://svnweb.freebsd.org/changeset/base/337618 Log: printf: Fix \c in %b in printf builtin exiting the shell after r337458 SVN r337458 erroneously partially reverted r265885. This is immediately visible when running the Kyua/ATF tests for usr.bin/printf, which actually test sh's printf builtin. PR: 229641 Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Sat Aug 11 11:05:22 2018 (r337617) +++ head/usr.bin/printf/printf.c Sat Aug 11 11:13:34 2018 (r337618) @@ -388,7 +388,7 @@ printf_doformat(char *fmt, int *rval) free(p); if (getout) - exit(*rval); + return (end_fmt); break; } case 'c': { From owner-svn-src-all@freebsd.org Sat Aug 11 13:01:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FC4106B702; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6693D7B480; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47D8C17934; Sat, 11 Aug 2018 13:01:47 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BD1lAg009900; Sat, 11 Aug 2018 13:01:47 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BD1laN009899; Sat, 11 Aug 2018 13:01:47 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111301.w7BD1laN009899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 13:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337620 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 337620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:01:47 -0000 Author: netchild Date: Sat Aug 11 13:01:46 2018 New Revision: 337620 URL: https://svnweb.freebsd.org/changeset/base/337620 Log: Add "ESI Juli@ XTe" as a supported device. Submitted by: Vladislav Movchan PR: 222025 Sponsored by: Essen Hackathon Modified: head/share/man/man4/snd_envy24ht.4 Modified: head/share/man/man4/snd_envy24ht.4 ============================================================================== --- head/share/man/man4/snd_envy24ht.4 Sat Aug 11 11:28:51 2018 (r337619) +++ head/share/man/man4/snd_envy24ht.4 Sat Aug 11 13:01:46 2018 (r337620) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2014 +.Dd August 11, 2018 .Dt SND_ENVY24HT 4 .Os .Sh NAME @@ -68,6 +68,8 @@ Audiotrak Prodigy 7.1 XT Audiotrak Prodigy HD2 .It ESI Juli@ +.It +ESI Juli@ XTe .It M-Audio Audiophile 192 .It From owner-svn-src-all@freebsd.org Sat Aug 11 13:06:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B870106BA84; Sat, 11 Aug 2018 13:06:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B7A7B89D; Sat, 11 Aug 2018 13:06:04 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id DDCC9FF20; Sat, 11 Aug 2018 13:06:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.28.128.1] (p5B34BA34.dip0.t-ipconnect.de [91.52.186.52]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 368274C7AD; Sat, 11 Aug 2018 15:06:01 +0200 (CEST) From: "Kristof Provost" To: "Devin Teske" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec Date: Sat, 11 Aug 2018 15:06:00 +0200 X-Mailer: MailMate (2.0BETAr6116) Message-ID: In-Reply-To: <201808110632.w7B6WVE9009976@repo.freebsd.org> References: <201808110632.w7B6WVE9009976@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:06:04 -0000 Hi Devin, On 11 Aug 2018, at 8:32, Devin Teske wrote: > Author: dteske > Date: Sat Aug 11 06:32:31 2018 > New Revision: 337611 > URL: https://svnweb.freebsd.org/changeset/base/337611 > > Log: > dwatch(1): Add systop profile > > Provides a top-like view of syscall consumers. > > MFC after: 3 days > X-MFC-to: stable/11 > Sponsored by: Smule, Inc. > > Added: > head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) > Modified: > head/cddl/usr.sbin/dwatch/libexec/Makefile > > Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile > ============================================================================== > --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 > 2018 (r337610) > +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 > 2018 (r337611) > @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv > ${LIBEXECDIR}/dw > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg > LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto > +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop This breaks install world: install: link /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop -> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: No such file or directory Regards, Kristof From owner-svn-src-all@freebsd.org Sat Aug 11 13:18:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED40C106C176; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A38C97BFB0; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8610B17B33; Sat, 11 Aug 2018 13:18:20 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDIKns016025; Sat, 11 Aug 2018 13:18:20 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDIKMZ016023; Sat, 11 Aug 2018 13:18:20 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111318.w7BDIKMZ016023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 13:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337621 - in head/share/man: man5 man7 X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: in head/share/man: man5 man7 X-SVN-Commit-Revision: 337621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:18:21 -0000 Author: netchild Date: Sat Aug 11 13:18:19 2018 New Revision: 337621 URL: https://svnweb.freebsd.org/changeset/base/337621 Log: Add svnlite to places where svn is mentioned. The Makefile part in the PR is solved already differently, so this part is skipped form the PR The man page change change is slightly changed to adapt to the way the Makefile works and to the spirit of what is intended here. Submitted by: Juan RamĂłn Molina Menor PR: 194910 Sponsored by: Essen Hackathon Modified: head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Sat Aug 11 13:01:46 2018 (r337620) +++ head/share/man/man5/make.conf.5 Sat Aug 11 13:18:19 2018 (r337621) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd August 11, 2018 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -234,12 +234,13 @@ Set this to not update the ports tree during .Pq Vt bool Set this to use .Xr svn 1 +or +.Xr svnlite 1 to update your .Pa src tree with .Dq Li "make update" . -Note that since a subversion client is not included in the base system, -you will need to set +Note that you can set .Va SVN to the full path of a .Xr svn 1 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Sat Aug 11 13:01:46 2018 (r337620) +++ head/share/man/man7/build.7 Sat Aug 11 13:18:19 2018 (r337621) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2017 +.Dd August 11, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -42,6 +42,8 @@ and These directories may be initially empty or non-existent until updated with .Xr svn 1 or +.Xr svnlite 1 +or .Xr portsnap 8 . Directory .Pa /usr/src @@ -789,6 +791,7 @@ make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installw .Xr install 1 , .Xr make 1 , .Xr svn 1 , +.Xr svnlite 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr arch 7 , From owner-svn-src-all@freebsd.org Sat Aug 11 13:23:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C7D0106C607; Sat, 11 Aug 2018 13:23:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20BD17C5D0; Sat, 11 Aug 2018 13:23:10 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B2417CE8; Sat, 11 Aug 2018 13:23:09 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDN9rT021372; Sat, 11 Aug 2018 13:23:09 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDN9s2021370; Sat, 11 Aug 2018 13:23:09 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111323.w7BDN9s2021370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337622 - in head: etc usr.sbin/auditd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/auditd X-SVN-Commit-Revision: 337622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:23:10 -0000 Author: brd Date: Sat Aug 11 13:23:09 2018 New Revision: 337622 URL: https://svnweb.freebsd.org/changeset/base/337622 Log: Move OpenBSM to CONFS This helps with pkgbase as these config files will be properly tagged as config files. Approved by: allanjude (mentor), oshogbo Differential Revision: https://reviews.freebsd.org/D16679 Modified: head/etc/Makefile head/usr.sbin/auditd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:18:19 2018 (r337621) +++ head/etc/Makefile Sat Aug 11 13:23:09 2018 (r337622) @@ -56,14 +56,6 @@ BIN1+= etc.${MACHINE_CPUARCH}/ttys .error etc.MACHINE/ttys missing .endif -OPENBSMDIR= ${SRCTOP}/contrib/openbsm -BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \ - ${OPENBSMDIR}/etc/audit_event -BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \ - ${OPENBSMDIR}/etc/audit_user -BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn -BSM_ETC_DIR= ${DESTDIR}/etc/security - # NB: keep these sorted by MK_* knobs .if ${MK_AMD} != "no" @@ -203,12 +195,6 @@ distribution: ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \ - ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \ - ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR} - cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \ - ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR} .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ Modified: head/usr.sbin/auditd/Makefile ============================================================================== --- head/usr.sbin/auditd/Makefile Sat Aug 11 13:18:19 2018 (r337621) +++ head/usr.sbin/auditd/Makefile Sat Aug 11 13:23:09 2018 (r337622) @@ -7,6 +7,18 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm CFLAGS+= -I${OPENBSMDIR} +OPENBSMETCDIR= ${OPENBSMDIR}/etc +CONFS= ${OPENBSMETCDIR}/audit_class +CONFSMODE_${OPENBSMETCDIR}/audit_class= 444 +CONFS+= ${OPENBSMETCDIR}/audit_control +CONFSMODE_${OPENBSMETCDIR}/audit_control= 600 +CONFS+= ${OPENBSMETCDIR}/audit_event +CONFSMODE_${OPENBSMETCDIR}/audit_event= 444 +CONFS+= ${OPENBSMETCDIR}/audit_user +CONFSMODE_${OPENBSMETCDIR}/audit_user= 600 +CONFS+= ${OPENBSMETCDIR}/audit_warn +CONFSMODE_${OPENBSMETCDIR}/audit_warn= 500 +CONFSDIR= /etc/security PROG= auditd SRCS= auditd.c audit_warn.c auditd_fbsd.c MAN= auditd.8 From owner-svn-src-all@freebsd.org Sat Aug 11 13:25:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE232106C761; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D497C7C4; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6715A17CF1; Sat, 11 Aug 2018 13:25:40 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDPe6G021522; Sat, 11 Aug 2018 13:25:40 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDPd92021519; Sat, 11 Aug 2018 13:25:39 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111325.w7BDPd92021519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337623 - in head: etc sbin/ddb X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/ddb X-SVN-Commit-Revision: 337623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:25:41 -0000 Author: brd Date: Sat Aug 11 13:25:39 2018 New Revision: 337623 URL: https://svnweb.freebsd.org/changeset/base/337623 Log: Move ddb.conf to sbin/ddb/ and switch to CONFS. This helps pkgbase as this config file will now be tagged as a config file. Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D16675 Added: head/sbin/ddb/ddb.conf - copied unchanged from r337622, head/etc/ddb.conf Deleted: head/etc/ddb.conf Modified: head/etc/Makefile head/sbin/ddb/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:23:09 2018 (r337622) +++ head/etc/Makefile Sat Aug 11 13:25:39 2018 (r337623) @@ -15,7 +15,6 @@ SUBDIR+=sendmail BIN1= crontab \ devd.conf \ devfs.conf \ - ddb.conf \ dhclient.conf \ disktab \ fbtab \ Modified: head/sbin/ddb/Makefile ============================================================================== --- head/sbin/ddb/Makefile Sat Aug 11 13:23:09 2018 (r337622) +++ head/sbin/ddb/Makefile Sat Aug 11 13:25:39 2018 (r337623) @@ -1,5 +1,6 @@ # $FreeBSD$ +CONFS= ddb.conf PACKAGE=runtime PROG= ddb SRCS= ddb.c ddb_capture.c ddb_script.c Copied: head/sbin/ddb/ddb.conf (from r337622, head/etc/ddb.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/ddb/ddb.conf Sat Aug 11 13:25:39 2018 (r337623, copy of r337622, head/etc/ddb.conf) @@ -0,0 +1,15 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``ddb'' to define debugging scripts. +# +# see ``man 4 ddb'' and ``man 8 ddb'' for details. +# + +script lockinfo=show locks; show alllocks; show lockedvnods + +# kdb.enter.panic panic(9) was called. +script kdb.enter.panic=textdump set; capture on; run lockinfo; show pcpu; bt; ps; alltrace; capture off; call doadump; reset + +# kdb.enter.witness witness(4) detected a locking error. +script kdb.enter.witness=run lockinfo From owner-svn-src-all@freebsd.org Sat Aug 11 13:28:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF3F106C8C1; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE5B7C9BE; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DE2017CFA; Sat, 11 Aug 2018 13:28:04 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDS3c6021656; Sat, 11 Aug 2018 13:28:03 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDS3UH021653; Sat, 11 Aug 2018 13:28:03 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111328.w7BDS3UH021653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337624 - in head: etc sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/sysctl X-SVN-Commit-Revision: 337624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:28:04 -0000 Author: brd Date: Sat Aug 11 13:28:03 2018 New Revision: 337624 URL: https://svnweb.freebsd.org/changeset/base/337624 Log: Move sysctl.conf to sbin/sysctl/ and switch to CONFS. This helps with pkgbase to tag this config file as a config file. Approved by: allanjude (mentor), will (mentor) Differential Revision: https://reviews.freebsd.org/D16559 Added: head/sbin/sysctl/sysctl.conf - copied unchanged from r337623, head/etc/sysctl.conf Deleted: head/etc/sysctl.conf Modified: head/etc/Makefile head/sbin/sysctl/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:25:39 2018 (r337623) +++ head/etc/Makefile Sat Aug 11 13:28:03 2018 (r337624) @@ -41,7 +41,6 @@ BIN1= crontab \ remote \ rpc \ services \ - sysctl.conf \ syslog.conf \ termcap.small Modified: head/sbin/sysctl/Makefile ============================================================================== --- head/sbin/sysctl/Makefile Sat Aug 11 13:25:39 2018 (r337623) +++ head/sbin/sysctl/Makefile Sat Aug 11 13:28:03 2018 (r337624) @@ -2,6 +2,7 @@ # $FreeBSD$ PACKAGE=runtime +CONFS= sysctl.conf PROG= sysctl WARNS?= 3 MAN= sysctl.8 Copied: head/sbin/sysctl/sysctl.conf (from r337623, head/etc/sysctl.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/sysctl/sysctl.conf Sat Aug 11 13:28:03 2018 (r337624, copy of r337623, head/etc/sysctl.conf) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# +# This file is read when going to multi-user and its contents piped thru +# ``sysctl'' to adjust kernel values. ``man 5 sysctl.conf'' for details. +# + +# Uncomment this to prevent users from seeing information about processes that +# are being run under another UID. +#security.bsd.see_other_uids=0 From owner-svn-src-all@freebsd.org Sat Aug 11 13:47:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7481D106D190; Sat, 11 Aug 2018 13:47:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 206AC7D44A; Sat, 11 Aug 2018 13:47:29 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F324218048; Sat, 11 Aug 2018 13:47:28 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDlSI1031328; Sat, 11 Aug 2018 13:47:28 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDlSGM031325; Sat, 11 Aug 2018 13:47:28 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111347.w7BDlSGM031325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337625 - in head: etc usr.sbin/bsnmpd/bsnmpd X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc usr.sbin/bsnmpd/bsnmpd X-SVN-Commit-Revision: 337625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:47:29 -0000 Author: brd Date: Sat Aug 11 13:47:28 2018 New Revision: 337625 URL: https://svnweb.freebsd.org/changeset/base/337625 Log: Move snmpd.config to usr.sbin/bsnmpd/bsnmpd/ This helps with pkgbase as this config file will now be tagged as a config file Approved by: allanjude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16674 Added: head/usr.sbin/bsnmpd/bsnmpd/snmpd.config - copied unchanged from r337624, head/etc/snmpd.config Deleted: head/etc/snmpd.config Modified: head/etc/Makefile head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:28:03 2018 (r337624) +++ head/etc/Makefile Sat Aug 11 13:47:28 2018 (r337625) @@ -158,11 +158,6 @@ distribution: ${DESTDIR}/etc/services; .endif -.if ${MK_BSNMP} != "no" - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - snmpd.config ${DESTDIR}/etc; -.endif .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Aug 11 13:28:03 2018 (r337624) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Sat Aug 11 13:47:28 2018 (r337625) @@ -7,6 +7,8 @@ CONTRIB=${SRCTOP}/contrib/bsnmp .PATH: ${CONTRIB}/snmpd +CONFS= snmpd.config +CONFSMODE= 600 PROG= bsnmpd SRCS= main.c action.c config.c export.c trap.c trans_udp.c trans_lsock.c SRCS+= oid.h tree.c tree.h Copied: head/usr.sbin/bsnmpd/bsnmpd/snmpd.config (from r337624, head/etc/snmpd.config) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/bsnmpd/snmpd.config Sat Aug 11 13:47:28 2018 (r337625, copy of r337624, head/etc/snmpd.config) @@ -0,0 +1,322 @@ +# $FreeBSD$ +# +# Example configuration file for bsnmpd(1). +# + +# +# Set some common variables +# +location := "Room 200" +contact := "sysmeister@example.com" +system := 1 # FreeBSD +traphost := localhost +trapport := 162 + +# +# Set the SNMP engine ID. +# +# The snmpEngineID object required from the SNMPv3 Framework. If not explicitly set via +# this configuration file, an ID is assigned based on the value of the +# kern.hostid variable +# engine := 0x80:0x10:0x08:0x10:0x80:0x25 +# snmpEngineID = $(engine) + +# Change this! +read := "public" +# Uncomment begemotSnmpdCommunityString.0.2 below that sets the community +# string to enable write access. +write := "geheim" +trap := "mytrap" + +# +# Declarations for SNMP-USER-BASED-SM-MIB authentication and privacy options +# + +NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1 +HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2 +HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3 +NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1 +DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2 +AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4 + +# +# Enumerations from SNMP-FRAMEWORK-MIB +# + +# Security models +securityModelAny := 0 +securityModelSNMPv1 := 1 +securityModelSNMPv2c := 2 +securityModelUSM := 3 + +# Message Processing models +MPmodelSNMPv1 := 0 +MPmodelSNMPv2c := 1 +MPmodelSNMPv3 := 3 + +# Security levels +noAuthNoPriv := 1 +authNoPriv := 2 +authPriv := 3 + + +# SNMPv3 USM User definition +# +# The localized hex password for a user may be obtained by setting SNMPUSER, SNMPPASSWD, +# SNMPAUTH and SNMPPRIV environment variables to the desired parameters and invoking +# 'bsnmpget -v 3 -D -K -o verbose' against the running bsnmpd(1). For other +# usages refer to the bsnmpget(1) manual page. The following lines define a user "bsnmp" +# with a private password "bsnmptest", localized for the above engine ID. +# +#user1 := "bsnmp" +#user1passwd := 0x22:0x98:0x1a:0x6e:0x39:0x93:0x16:0x5e:0x6a:0x21:0x1b:0xd8:0xa9:0x81:0x31:0x05:0x16:0x33:0x38:0x60 + +# +# Configuration +# +%snmpd +begemotSnmpdDebugDumpPdus = 2 +begemotSnmpdDebugSyslogPri = 7 + +# +# Set the read and write communities. +# +# The default value of the community strings is NULL (note, that this is +# different from the empty string). This disables both read and write access. +# To enable read access only the read community string must be set. Setting +# the write community string enables both read and write access with that +# string. +# +# Be sure to understand the security implications of SNMPv2 - the community +# strings are readable on the wire! +# +begemotSnmpdCommunityString.0.1 = $(read) +# begemotSnmpdCommunityString.0.2 = $(write) +begemotSnmpdCommunityDisable = 1 + +# open standard SNMP ports +begemotSnmpdPortStatus.0.0.0.0.161 = 1 + +# open a unix domain socket +begemotSnmpdLocalPortStatus."/var/run/snmpd.sock" = 1 +begemotSnmpdLocalPortType."/var/run/snmpd.sock" = 4 + +# send traps to the traphost +begemotTrapSinkStatus.[$(traphost)].$(trapport) = 4 +begemotTrapSinkVersion.[$(traphost)].$(trapport) = 2 +begemotTrapSinkComm.[$(traphost)].$(trapport) = $(trap) + +sysContact = $(contact) +sysLocation = $(location) +sysObjectId = 1.3.6.1.4.1.12325.1.1.2.1.$(system) + +snmpEnableAuthenTraps = 2 + +# Uncomment `begemotSnmpdModulePath.".." = ".."' entries below to enable +# modules + +# +# Control configuration for the modules in the module specific sections, e.g. +# the "usm" module (begemotSnmpdModulePath."usm") can be controlled in the +# %usm specific section. You must uncomment the section specific header in +# order to use the enclosed variables, e.g. `usmUserStatus.$(engine).$(user1)` +# can only be used if %usm is uncommented. +# +# Modules are loaded in the order listed, so they must be before any +# dependent modules, e.g. "mibII" vs "bridge". +# + +# +# MIB-2 module +# +begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so" + +# +# Bridge module +# This requires the mibII module. +# +#begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" + +# +# Host resources module +# This requires the mibII module. +# +#begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so" + +# +# LM75 Sensor module +# +#begemotSnmpdModulePath."lm75" = "/usr/lib/snmp_lm75.so" + +# +# Netgraph module +# +#begemotSnmpdModulePath."netgraph" = "/usr/lib/snmp_netgraph.so" + +# +# pf(4) module +# +#begemotSnmpdModulePath."pf" = "/usr/lib/snmp_pf.so" + +# +# SNMPv3 Notification Targets +# +# begemotSnmpdModulePath."target" = "/usr/lib/snmp_target.so" + +# +# SNMPv3 User-based security module - must be loaded for SNMPv3 USM +# +#begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" + +# +# SNMPv3 View-based Access Control module +# +#begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" + +# +# Wireless module +# This requires the mibII module. +# +#begemotSnmpdModulePath."wlan" = "/usr/lib/snmp_wlan.so" + +# +# SNMPv3 USM User definition. +# + +#%usm + +# +# The following block creates a user with name "bsnmp" and sets privacy +# and encryption options to SHA256 message digests and AES encryption +# for this user. +# +# usmUserStatus.$(engine).$(user1) = 5 +# usmUserAuthProtocol.$(engine).$(user1) = $(HMACSHAAuthProtocol) +# usmUserAuthKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserPrivProtocol.$(engine).$(user1) = $(AesCfb128Protocol) +# usmUserPrivKeyChange.$(engine).$(user1) = $(user1passwd) +# usmUserStatus.$(engine).$(user1) = 1 +# + +# +# The following block creates a user with name "public" with no authentication +# or encryption options. +# +# usmUserStatus.$(engine).$(read) = 5 +# usmUserAuthProtocol.$(engine).$(read) = $(NoAuthProtocol) +# usmUserPrivProtocol.$(engine).$(read) = $(NoPrivProtocol) +# usmUserStatus.$(engine).$(read) = 1 +# + +# +# Definition of view-based access control entries. +# +#%vacm + +# Definition of a SNMPv1 group +# vacmSecurityToGroupStatus.$(securityModelSNMPv1).$(read) = 4 +# vacmGroupName.$(securityModelSNMPv1).$(read) = $(read) + +# Definition of SNMPv2 group +# vacmSecurityToGroupStatus.$(securityModelSNMPv2c).$(write) = 4 +# vacmGroupName.$(securityModelSNMPv2c).$(write) = $(write) + +# Definition of SNMPv3 group with users "bsnmp" and "public" +# vacmSecurityToGroupStatus.$(securityModelUSM).$(user1) = 4 +# vacmGroupName.$(securityModelUSM).$(user1) = $(write) +# vacmSecurityToGroupStatus.$(securityModelUSM).$(read) = 4 +# vacmGroupName.$(securityModelUSM).$(read) = $(write) + +# +# The OID of the .iso.org.dod.internet subtree +# +# internetoid := 1.3.6.1 +# internetoidlen := 4 + +# +# Definitions of two views +# +# vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4 +# vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4 + +# +# Access control +# + +# +# Read-only access for SNMPv1 users +# +# vacmAccessStatus.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(read)."".$(securityModelSNMPv1).$(noAuthNoPriv) = "internet" + +# +# Read-write access for SNMPv2 users +# +# vacmAccessStatus.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" +# vacmAccessWriteViewName.$(write)."".$(securityModelSNMPv2c).$(noAuthNoPriv) = "internet" + +# +# Read-write-notify access for SNMPv3 USM users with noAuthNoPriv +# +# vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(noAuthNoPriv) = "internet" + +# +#Read-write-notify access to restricted for SNMPv3 USM users with authPriv +# +# vacmAccessStatus.$(write)."".$(securityModelUSM).$(authPriv) = 4 +# vacmAccessReadViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessWriteViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" +# vacmAccessNotifyViewName.$(write)."".$(securityModelUSM).$(authPriv) = "restricted" + +#%target +# Send notifications to target tag "test" +# tag := "test" +# snmpNotifyRowStatus.$(tag) = 4 +# snmpNotifyTag.$(tag) = $(tag) + +# tagremote := "testremote" +# snmpNotifyRowStatus.$(tagremote) = 4 +# snmpNotifyTag.$(tagremote) = $(tagremote) + +# +# Specify the target parameters for the notifications - send with the credentials +# of user "bsnmp" +# +# snmpTargetParamsRowStatus.$(tag) = 5 +# snmpTargetParamsMPModel.$(tag) = $(MPmodelSNMPv3) +# snmpTargetParamsSecurityModel.$(tag) = $(securityModelUSM) +# snmpTargetParamsSecurityName.$(tag) = $(user1) +# snmpTargetParamsSecurityLevel.$(tag) = $(authPriv) +# snmpTargetParamsRowStatus.$(tag) = 1 + +# +# Define the notifications' target address - port 162 on localhost +# +# snmpTargetAddrRowStatus.$(tag) = 5 +# snmpTargetAddrTAddress.$(tag) = 0x7f:0x0:0x0:0x1:0x0:0xa2 +# snmpTargetAddrTagList.$(tag) = "test notification" +# snmpTargetAddrParams.$(tag) = $(tag) +# snmpTargetAddrRowStatus.$(tag) = 1 + +# +# Define the notifications' target address - port 162 on 10.0.0.1 +# +# snmpTargetAddrRowStatus.$(tagremote) = 5 +# snmpTargetAddrTAddress.$(tagremote) = 0x0a:0x00:0x00:0x1:0x0:0xa2 +# snmpTargetAddrTagList.$(tagremote) = $(tagremote) +# snmpTargetAddrParams.$(tagremote) = $(tag) +# snmpTargetAddrRowStatus.$(tagremote) = 1 + +# Force a polling rate for the 64-bit interface counters in case +# the automatic computation is wrong (which may be the case if an interface +# announces the wrong bit rate via its MIB). +#%mibII +#begemotIfForcePoll = 2000 + +#%netgraph +#begemotNgControlNodeName = "snmpd" + From owner-svn-src-all@freebsd.org Sat Aug 11 13:52:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16D8106D311; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C6F7D950; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58188181D7; Sat, 11 Aug 2018 13:52:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDqO3O036534; Sat, 11 Aug 2018 13:52:24 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDqNPA036531; Sat, 11 Aug 2018 13:52:23 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111352.w7BDqNPA036531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337626 - in head: etc etc/cron.d usr.bin/at X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc etc/cron.d usr.bin/at X-SVN-Commit-Revision: 337626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:52:24 -0000 Author: brd Date: Sat Aug 11 13:52:23 2018 New Revision: 337626 URL: https://svnweb.freebsd.org/changeset/base/337626 Log: Move cron.d/at to usr.bin/at/ This helps with pkgbase as it tags this as a config file so it is handled as such Approved by: allanjude (mentor) Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16673 Added: head/usr.bin/at/atrun - copied unchanged from r337625, head/etc/cron.d/at Deleted: head/etc/cron.d/ Modified: head/etc/Makefile head/usr.bin/at/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:47:28 2018 (r337625) +++ head/etc/Makefile Sat Aug 11 13:52:23 2018 (r337626) @@ -174,7 +174,6 @@ distribution: .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif - ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install ${_+_}cd ${.CURDIR}/devd; ${MAKE} install ${_+_}cd ${.CURDIR}/gss; ${MAKE} install Modified: head/usr.bin/at/Makefile ============================================================================== --- head/usr.bin/at/Makefile Sat Aug 11 13:47:28 2018 (r337625) +++ head/usr.bin/at/Makefile Sat Aug 11 13:52:23 2018 (r337626) @@ -2,6 +2,9 @@ .include "${.CURDIR}/Makefile.inc" +CONFS= atrun +CONFSDIR= /etc/cron.d +CONFSNAME= at PROG= at SRCS= at.c panic.c parsetime.c perm.c LINKS= ${BINDIR}/at ${BINDIR}/atq \ Copied: head/usr.bin/at/atrun (from r337625, head/etc/cron.d/at) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/at/atrun Sat Aug 11 13:52:23 2018 (r337626, copy of r337625, head/etc/cron.d/at) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# +SHELL=/bin/sh +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin + +# See crontab(5) for field format. +*/5 * * * * root /usr/libexec/atrun From owner-svn-src-all@freebsd.org Sat Aug 11 13:58:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38633106D5D1; Sat, 11 Aug 2018 13:58:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D85307DB5E; Sat, 11 Aug 2018 13:58:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9ECF181EF; Sat, 11 Aug 2018 13:58:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BDwQF3036833; Sat, 11 Aug 2018 13:58:26 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BDwQ8R036831; Sat, 11 Aug 2018 13:58:26 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111358.w7BDwQ8R036831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 13:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337627 - in head: etc sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: etc sbin/pfctl X-SVN-Commit-Revision: 337627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 13:58:27 -0000 Author: brd Date: Sat Aug 11 13:58:26 2018 New Revision: 337627 URL: https://svnweb.freebsd.org/changeset/base/337627 Log: Move pf.os to sbin/pfctl/ Approved by: will (mentor) Glanced at by: kp Sponsored by: Essen Hackathon Differential Revision: https://reviews.freebsd.org/D16557 Added: head/sbin/pfctl/pf.os - copied unchanged from r337626, head/etc/pf.os Deleted: head/etc/pf.os Modified: head/etc/Makefile head/sbin/pfctl/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Aug 11 13:52:23 2018 (r337626) +++ head/etc/Makefile Sat Aug 11 13:58:26 2018 (r337627) @@ -93,10 +93,6 @@ SSH= ${SRCTOP}/crypto/openssh/ssh_config \ SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf .endif -.if ${MK_PF} != "no" -BIN1+= pf.os -.endif - .if ${MK_SENDMAIL} != "no" BIN1+= rc.sendmail .endif Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Sat Aug 11 13:52:23 2018 (r337626) +++ head/sbin/pfctl/Makefile Sat Aug 11 13:58:26 2018 (r337627) @@ -6,6 +6,7 @@ .PATH: ${SRCTOP}/sys/netpfil/pf PACKAGE=pf +CONFS= pf.os PROG= pfctl MAN= pfctl.8 Copied: head/sbin/pfctl/pf.os (from r337626, head/etc/pf.os) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/pfctl/pf.os Sat Aug 11 13:58:26 2018 (r337627, copy of r337626, head/etc/pf.os) @@ -0,0 +1,709 @@ +# $FreeBSD$ +# $OpenBSD: pf.os,v 1.27 2016/09/03 17:08:57 sthen Exp $ +# passive OS fingerprinting +# ------------------------- +# +# SYN signatures. Those signatures work for SYN packets only (duh!). +# +# (C) Copyright 2000-2003 by Michal Zalewski +# (C) Copyright 2003 by Mike Frantzen +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# +# This fingerprint database is adapted from Michal Zalewski's p0f passive +# operating system package. The last database sync was from a Nov 3 2003 +# p0f.fp. +# +# +# Each line in this file specifies a single fingerprint. Please read the +# information below carefully before attempting to append any signatures +# reported as UNKNOWN to this file to avoid mistakes. +# +# We use the following set metrics for fingerprinting: +# +# - Window size (WSS) - a highly OS dependent setting used for TCP/IP +# performance control (max. amount of data to be sent without ACK). +# Some systems use a fixed value for initial packets. On other +# systems, it is a multiple of MSS or MTU (MSS+40). In some rare +# cases, the value is just arbitrary. +# +# NEW SIGNATURE: if p0f reported a special value of 'Snn', the number +# appears to be a multiple of MSS (MSS*nn); a special value of 'Tnn' +# means it is a multiple of MTU ((MSS+40)*nn). Unless you notice the +# value of nn is not fixed (unlikely), just copy the Snn or Tnn token +# literally. If you know this device has a simple stack and a fixed +# MTU, you can however multiply S value by MSS, or T value by MSS+40, +# and put it instead of Snn or Tnn. +# +# If WSS otherwise looks like a fixed value (for example a multiple +# of two), or if you can confirm the value is fixed, please quote +# it literally. If there's no apparent pattern in WSS chosen, you +# should consider wildcarding this value. +# +# - Overall packet size - a function of all IP and TCP options and bugs. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Initial TTL - We check the actual TTL of a received packet. It can't +# be higher than the initial TTL, and also shouldn't be dramatically +# lower (maximum distance is defined as 40 hops). +# +# NEW SIGNATURE: *Never* copy TTL from a p0f-reported signature literally. +# You need to determine the initial TTL. The best way to do it is to +# check the documentation for a remote system, or check its settings. +# A fairly good method is to simply round the observed TTL up to +# 32, 64, 128, or 255, but it should be noted that some obscure devices +# might not use round TTLs (in particular, some shoddy appliances use +# "original" initial TTL settings). If not sure, you can see how many +# hops you're away from the remote party with traceroute or mtr. +# +# - Don't fragment flag (DF) - some modern OSes set this to implement PMTU +# discovery. Others do not bother. +# +# NEW SIGNATURE: Copy this value literally. +# +# - Maximum segment size (MSS) - this setting is usually link-dependent. P0f +# uses it to determine link type of the remote host. +# +# NEW SIGNATURE: Always wildcard this value, except for rare cases when +# you have an appliance with a fixed value, know the system supports only +# a very limited number of network interface types, or know the system +# is using a value it pulled out of nowhere. Specific unique MSS +# can be used to tell Google crawlbots from the rest of the population. +# +# - Window scaling (WSCALE) - this feature is used to scale WSS. +# It extends the size of a TCP/IP window to 32 bits. Some modern +# systems implement this feature. +# +# NEW SIGNATURE: Observe several signatures. Initial WSCALE is often set +# to zero or other low value. There's usually no need to wildcard this +# parameter. +# +# - Timestamp - some systems that implement timestamps set them to +# zero in the initial SYN. This case is detected and handled appropriately. +# +# - Selective ACK permitted - a flag set by systems that implement +# selective ACK functionality. +# +# - The sequence of TCP all options (MSS, window scaling, selective ACK +# permitted, timestamp, NOP). Other than the options previously +# discussed, p0f also checks for timestamp option (a silly +# extension to broadcast your uptime ;-), NOP options (used for +# header padding) and sackOK option (selective ACK feature). +# +# NEW SIGNATURE: Copy the sequence literally. +# +# To wildcard any value (except for initial TTL or TCP options), replace +# it with '*'. You can also use a modulo operator to match any values +# that divide by nnn - '%nnn'. +# +# Fingerprint entry format: +# +# wwww:ttt:D:ss:OOO...:OS:Version:Subtype:Details +# +# wwww - window size (can be *, %nnn, Snn or Tnn). The special values +# "S" and "T" which are a multiple of MSS or a multiple of MTU +# respectively. +# ttt - initial TTL +# D - don't fragment bit (0 - not set, 1 - set) +# ss - overall SYN packet size +# OOO - option value and order specification (see below) +# OS - OS genre (Linux, Solaris, Windows) +# Version - OS Version (2.0.27 on x86, etc) +# Subtype - OS subtype or patchlevel (SP3, lo0) +# details - Generic OS details +# +# If OS genre starts with '*', p0f will not show distance, link type +# and timestamp data. It is useful for userland TCP/IP stacks of +# network scanners and so on, where many settings are randomized or +# bogus. +# +# If OS genre starts with @, it denotes an approximate hit for a group +# of operating systems (signature reporting still enabled in this case). +# Use this feature at the end of this file to catch cases for which +# you don't have a precise match, but can tell it's Windows or FreeBSD +# or whatnot by looking at, say, flag layout alone. +# +# Option block description is a list of comma or space separated +# options in the order they appear in the packet: +# +# N - NOP option +# Wnnn - window scaling option, value nnn (or * or %nnn) +# Mnnn - maximum segment size option, value nnn (or * or %nnn) +# S - selective ACK OK +# T - timestamp +# T0 - timestamp with a zero value +# +# To denote no TCP options, use a single '.'. +# +# Please report any additions to this file, or any inaccuracies or +# problems spotted, to the maintainers: lcamtuf@coredump.cx, +# frantzen@openbsd.org and bugs@openbsd.org with a tcpdump packet +# capture of the relevant SYN packet(s) +# +# A test and submission page is available at +# http://lcamtuf.coredump.cx/p0f-help/ +# +# +# WARNING WARNING WARNING +# ----------------------- +# +# Do not add a system X as OS Y just because NMAP says so. It is often +# the case that X is a NAT firewall. While nmap is talking to the +# device itself, p0f is fingerprinting the guy behind the firewall +# instead. +# +# When in doubt, use common sense, don't add something that looks like +# a completely different system as Linux or FreeBSD or LinkSys router. +# Check DNS name, establish a connection to the remote host and look +# at SYN+ACK - does it look similar? +# +# Some users tweak their TCP/IP settings - enable or disable RFC1323 +# functionality, enable or disable timestamps or selective ACK, +# disable PMTU discovery, change MTU and so on. Always compare a new rule +# to other fingerprints for this system, and verify the system isn't +# "customized" before adding it. It is OK to add signature variants +# caused by a commonly used software (personal firewalls, security +# packages, etc), but it makes no sense to try to add every single +# possible /proc/sys/net/ipv4 tweak on Linux or so. +# +# KEEP IN MIND: Some packet firewalls configured to normalize outgoing +# traffic (OpenBSD pf with "scrub" enabled, for example) will, well, +# normalize packets. Signatures will not correspond to the originating +# system (and probably not quite to the firewall either). +# +# NOTE: Try to keep this file in some reasonable order, from most to +# least likely systems. This will speed up operation. Also keep most +# generic and broad rules near the end. +# + +########################## +# Standard OS signatures # +########################## + +# ----------------- AIX --------------------- + +# AIX is first because its signatures are close to NetBSD, MacOS X and +# Linux 2.0, but it uses a fairly rare MSSes, at least sometimes... +# This is a shoddy hack, though. + +45046:64:0:44:M*: AIX:4.3::AIX 4.3 +16384:64:0:44:M512: AIX:4.3:2-3:AIX 4.3.2 and earlier + +16384:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +16384:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +32768:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:4.3:3:AIX 4.3.3-5.2 +65535:64:0:60:M512,N,W%2,N,N,T: AIX:5.1-5.2::AIX 4.3.3-5.2 +65535:64:0:64:M*,N,W1,N,N,T,N,N,S: AIX:5.3:ML1:AIX 5.3 ML1 + +# ----------------- Linux ------------------- + +# S1:64:0:44:M*:A: Linux:1.2::Linux 1.2.x (XXX quirks support) +512:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x +16384:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x + +# Endian snafu! Nelson says "ha-ha": +2:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac +64:64:0:44:M*: Linux:2.0:3x:Linux 2.0.3x (MkLinux) on Mac + + +S4:64:1:60:M1360,S,T,N,W0: Linux:google::Linux (Google crawlbot) + +S2:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4 (big boy) +S3:64:1:60:M*,S,T,N,W0: Linux:2.4:.18-21:Linux 2.4.18 and newer +S4:64:1:60:M*,S,T,N,W0: Linux:2.4::Linux 2.4/2.6 <= 2.6.7 +S4:64:1:60:M*,S,T,N,W0: Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7 + +S4:64:1:60:M*,S,T,N,W5: Linux:2.6::Linux 2.6 (newer, 1) +S4:64:1:60:M*,S,T,N,W6: Linux:2.6::Linux 2.6 (newer, 2) +S4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 3) +T4:64:1:60:M*,S,T,N,W7: Linux:2.6::Linux 2.6 (newer, 4) + +S10:64:1:60:M*,S,T,N,W4: Linux:3.0::Linux 3.0 + +S3:64:1:60:M*,S,T,N,W1: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W1: Linux:2.5-2.6::Linux 2.5/2.6 +S3:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) +S4:64:1:60:M*,S,T,N,W2: Linux:2.5::Linux 2.5 (sometimes 2.4) + +S20:64:1:60:M*,S,T,N,W0: Linux:2.2:20-25:Linux 2.2.20 and newer +S22:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 +S11:64:1:60:M*,S,T,N,W0: Linux:2.2::Linux 2.2 + +# Popular cluster config scripts disable timestamps and +# selective ACK: +S4:64:1:48:M1460,N,W0: Linux:2.4:cluster:Linux 2.4 in cluster + +# This needs to be investigated. On some systems, WSS +# is selected as a multiple of MTU instead of MSS. I got +# many submissions for this for many late versions of 2.4: +T4:64:1:60:M1412,S,T,N,W0: Linux:2.4::Linux 2.4 (late, uncommon) + +# This happens only over loopback, but let's make folks happy: +32767:64:1:60:M16396,S,T,N,W0: Linux:2.4:lo0:Linux 2.4 (local) +S8:64:1:60:M3884,S,T,N,W0: Linux:2.2:lo0:Linux 2.2 (local) + +# Opera visitors: +16384:64:1:60:M*,S,T,N,W0: Linux:2.2:Opera:Linux 2.2 (Opera?) +32767:64:1:60:M*,S,T,N,W0: Linux:2.4:Opera:Linux 2.4 (Opera?) + +# Some fairly common mods: +S4:64:1:52:M*,N,N,S,N,W0: Linux:2.4:ts:Linux 2.4 w/o timestamps +S22:64:1:52:M*,N,N,S,N,W0: Linux:2.2:ts:Linux 2.2 w/o timestamps + + +# ----------------- FreeBSD ----------------- + +16384:64:1:44:M*: FreeBSD:2.0-2.2::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:3.0-3.5::FreeBSD 2.0-4.2 +16384:64:1:44:M*: FreeBSD:4.0-4.2::FreeBSD 2.0-4.2 +16384:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +1024:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.4::FreeBSD 4.4 + +57344:64:1:44:M*: FreeBSD:4.6-4.8:noRFC1323:FreeBSD 4.6-4.8 (no RFC1323) +57344:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.6-4.9::FreeBSD 4.6-4.9 + +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.1 (or MacOS X) +32768:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.1::FreeBSD 4.8-5.1 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:4.8-4.11::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W0,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.8-5.2 (or MacOS X) +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:4.7-4.11::FreeBSD 4.7-5.2 +65535:64:1:60:M*,N,W1,N,N,T: FreeBSD:5.0-5.2::FreeBSD 4.7-5.2 + +# XXX need quirks support +# 65535:64:1:60:M*,N,W0,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (1) +# 65535:64:1:60:M*,N,W1,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (2) +# 65535:64:1:60:M*,N,W2,N,N,T:Z:FreeBSD:5.1-5.4::5.1-current (3) +# 65535:64:1:44:M*:Z:FreeBSD:5.2::FreeBSD 5.2 (no RFC1323) + +# 16384:64:1:60:M*,N,N,N,N,N,N,T:FreeBSD:4.4:noTS:FreeBSD 4.4 (w/o timestamps) + +# ----------------- NetBSD ------------------ + +16384:64:0:60:M*,N,W0,N,N,T: NetBSD:1.3::NetBSD 1.3 +65535:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6:opera:NetBSD 1.6 (Opera) +16384:64:0:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6 +16384:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:df:NetBSD 1.6 (DF) +65535:64:1:60:M*,N,W1,N,N,T0: NetBSD:1.6::NetBSD 1.6W-current (DF) +65535:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6::NetBSD 1.6X (DF) +32768:64:1:60:M*,N,W0,N,N,T0: NetBSD:1.6:randomization:NetBSD 1.6ZH-current (w/ ip_id randomization) + +# ----------------- OpenBSD ----------------- + +16384:64:0:60:M*,N,W0,N,N,T: OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6) +16384:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8::OpenBSD 3.0-4.8 +16384:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df) +57344:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0::OpenBSD 3.3-4.0 +57344:64:0:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df) + +65535:64:1:64:M*,N,N,S,N,W0,N,N,T: OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera) + +16384:64:1:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9::OpenBSD 4.9 +16384:64:0:64:M*,N,N,S,N,W3,N,N,T: OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df) + +16384:64:1:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1::OpenBSD 6.1 +16384:64:0:64:M*,N,N,S,N,W6,N,N,T: OpenBSD:6.1:no-df:OpenBSD 6.1 (scrub no-df) + +# ----------------- DragonFly BSD ----------------- + +57344:64:1:60:M*,N,W0,N,N,T: DragonFly:1.0:A:DragonFly 1.0A +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:1.2-1.12::DragonFly 1.2-1.12 +5840:64:1:60:M*,S,T,N,W4: DragonFly:2.0-2.1::DragonFly 2.0-2.1 +57344:64:0:64:M*,N,W0,N,N,S,N,N,T: DragonFly:2.2-2.3::DragonFly 2.2-2.3 +57344:64:0:64:M*,N,W5,N,N,S,N,N,T: DragonFly:2.4-2.7::DragonFly 2.4-2.7 + +# ----------------- Solaris ----------------- + +S17:64:1:64:N,W3,N,N,T0,N,N,S,M*: Solaris:8:RFC1323:Solaris 8 RFC1323 +S17:64:1:48:N,N,S,M*: Solaris:8::Solaris 8 +S17:255:1:44:M*: Solaris:2.5-2.7::Solaris 2.5 to 7 + +S6:255:1:44:M*: Solaris:2.6-2.7::Solaris 2.6 to 7 +S23:255:1:44:M*: Solaris:2.5:1:Solaris 2.5.1 +S34:64:1:48:M*,N,N,S: Solaris:2.9::Solaris 9 +S44:255:1:44:M*: Solaris:2.7::Solaris 7 + +4096:64:0:44:M1460: SunOS:4.1::SunOS 4.1.x + +S34:64:1:52:M*,N,W0,N,N,S: Solaris:10:beta:Solaris 10 (beta) +32850:64:1:64:M*,N,N,T,N,W1,N,N,S: Solaris:10::Solaris 10 1203 + +# ----------------- IRIX -------------------- + +49152:64:0:44:M*: IRIX:6.4::IRIX 6.4 +61440:64:0:44:M*: IRIX:6.2-6.5::IRIX 6.2-6.5 +49152:64:0:52:M*,N,W2,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) +49152:64:0:52:M*,N,W3,N,N,S: IRIX:6.5:RFC1323:IRIX 6.5 (RFC1323) + +61440:64:0:48:M*,N,N,S: IRIX:6.5:12-21:IRIX 6.5.12 - 6.5.21 +49152:64:0:48:M*,N,N,S: IRIX:6.5:15-21:IRIX 6.5.15 - 6.5.21 + +49152:60:0:64:M*,N,W2,N,N,T,N,N,S: IRIX:6.5:IP27:IRIX 6.5 IP27 + + +# ----------------- Tru64 ------------------- + +32768:64:1:48:M*,N,W0: Tru64:4.0::Tru64 4.0 (or OS/2 Warp 4) +32768:64:0:48:M*,N,W0: Tru64:5.0::Tru64 5.0 +8192:64:0:44:M1460: Tru64:5.1:noRFC1323:Tru64 6.1 (no RFC1323) (or QNX 6) +61440:64:0:48:M*,N,W0: Tru64:5.1a:JP4:Tru64 v5.1a JP4 (or OpenVMS 7.x on Compaq 5.x stack) + +# ----------------- OpenVMS ----------------- + +6144:64:1:60:M*,N,W0,N,N,T: OpenVMS:7.2::OpenVMS 7.2 (Multinet 4.4 stack) + +# ----------------- MacOS ------------------- + +# XXX Need EOL tcp opt support +# S2:255:1:48:M*,W0,E:.:MacOS:8.6 classic + +# XXX some of these use EOL too +16616:255:1:48:M*,W0: MacOS:7.3-7.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,W0: MacOS:8.0-8.6:OTTCP:MacOS 7.3-8.6 (OTTCP) +16616:255:1:48:M*,N,N,N: MacOS:8.1-8.6:OTTCP:MacOS 8.1-8.6 (OTTCP) +32768:255:1:48:M*,W0,N: MacOS:9.0-9.2::MacOS 9.0-9.2 +65535:255:1:48:M*,N,N,N,N: MacOS:9.1::MacOS 9.1 (OT 2.7.4) + + +# ----------------- Windows ----------------- + +# Windows TCP/IP stack is a mess. For most recent XP, 2000 and +# even 98, the patchlevel, not the actual OS version, is more +# relevant to the signature. They share the same code, so it would +# seem. Luckily for us, almost all Windows 9x boxes have an +# awkward MSS of 536, which I use to tell one from another +# in most difficult cases. + +8192:32:1:44:M*: Windows:3.11::Windows 3.11 (Tucows) +S44:64:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95::Windows 95 +8192:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:95:b:Windows 95b + +# There were so many tweaking tools and so many stack versions for +# Windows 98 it is no longer possible to tell them from each other +# without some very serious research. Until then, there's an insane +# number of signatures, for your amusement: + +S44:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +8192:32:1:48:M*,N,N,S: Windows:98:lowTTL:Windows 98 (low TTL) +%8192:64:1:48:M536,N,N,S: Windows:98::Windows 98 +%8192:128:1:48:M536,N,N,S: Windows:98::Windows 98 +S4:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S6:64:1:48:M*,N,N,S: Windows:98::Windows 98 +S12:64:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:64:1:64:M1460,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +32767:64:1:48:M*,N,N,S: Windows:98::Windows 98 +37300:64:1:48:M*,N,N,S: Windows:98::Windows 98 +46080:64:1:52:M*,N,W3,N,N,S: Windows:98:RFC1323:Windows 98 (RFC1323) +65535:64:1:44:M*: Windows:98:noSack:Windows 98 (no sack) +S16:128:1:48:M*,N,N,S: Windows:98::Windows 98 +S16:128:1:64:M*,N,W0,N,N,T0,N,N,S: Windows:98::Windows 98 +S26:128:1:48:M*,N,N,S: Windows:98::Windows 98 +T30:128:1:48:M*,N,N,S: Windows:98::Windows 98 +32767:128:1:52:M*,N,W0,N,N,S: Windows:98::Windows 98 +60352:128:1:48:M*,N,N,S: Windows:98::Windows 98 +60352:128:1:64:M*,N,W2,N,N,T0,N,N,S: Windows:98::Windows 98 + +# What's with 1414 on NT? +T31:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +64512:128:1:44:M1414: Windows:NT:4.0:Windows NT 4.0 SP6a +8192:128:1:44:M*: Windows:NT:4.0:Windows NT 4.0 (older) + +# Windows XP and 2000. Most of the signatures that were +# either dubious or non-specific (no service pack data) +# were deleted and replaced with generics at the end. + +65535:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP1 +65535:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP1 +%8192:128:1:48:M*,N,N,S: Windows:2000:SP2+:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +%8192:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP2, XP SP1 (seldom 98 4.10.2222) +S20:128:1:48:M*,N,N,S: Windows:2000::Windows 2000/XP SP3 +S20:128:1:48:M*,N,N,S: Windows:XP:SP3:Windows 2000/XP SP3 +S45:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4, XP SP 1 +S45:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows 2000 SP4, XP SP 1 +40320:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows 2000 SP4 + +S6:128:1:48:M*,N,N,S: Windows:2000:SP2:Windows XP, 2000 SP2+ +S6:128:1:48:M*,N,N,S: Windows:XP::Windows XP, 2000 SP2+ +S12:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows XP SP1 +S44:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows Pro SP1, 2000 SP3 +S44:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows Pro SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:2000:SP3:Windows SP1, 2000 SP3 +64512:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP3 +32767:128:1:48:M*,N,N,S: Windows:2000:SP4:Windows SP1, 2000 SP4 +32767:128:1:48:M*,N,N,S: Windows:XP:SP1:Windows SP1, 2000 SP4 + +8192:128:1:52:M*,N,W2,N,N,S: Windows:Vista::Windows Vista/7 + +# Odds, ends, mods: + +S52:128:1:48:M1260,N,N,S: Windows:2000:cisco:Windows XP/2000 via Cisco +S52:128:1:48:M1260,N,N,S: Windows:XP:cisco:Windows XP/2000 via Cisco +65520:128:1:48:M*,N,N,S: Windows:XP::Windows XP bare-bone +16384:128:1:52:M536,N,W0,N,N,S: Windows:2000:ZoneAlarm:Windows 2000 w/ZoneAlarm? +2048:255:0:40:.: Windows:.NET::Windows .NET Enterprise Server + +44620:64:0:48:M*,N,N,S: Windows:ME::Windows ME no SP (?) +S6:255:1:48:M536,N,N,S: Windows:95:winsock2:Windows 95 winsock 2 +32768:32:1:52:M1460,N,W0,N,N,S: Windows:2003:AS:Windows 2003 AS + + +# No need to be more specific, it passes: +# *:128:1:48:M*,N,N,S:U:-Windows:XP/2000 while downloading (leak!) XXX quirk +# there is an equiv similar generic sig w/o the quirk + +# ----------------- HP/UX ------------------- + +32768:64:1:44:M*: HP-UX:B.10.20::HP-UX B.10.20 +32768:64:0:48:M*,W0,N: HP-UX:11.0::HP-UX 11.0 +32768:64:1:48:M*,W0,N: HP-UX:11.10::HP-UX 11.0 or 11.11 +32768:64:1:48:M*,W0,N: HP-UX:11.11::HP-UX 11.0 or 11.11 + +# Whoa. Hardcore WSS. +0:64:0:48:M*,W0,N: HP-UX:B.11.00:A:HP-UX B.11.00 A (RFC1323) + +# ----------------- RiscOS ------------------ + +# We don't yet support the ?12 TCP option +#16384:64:1:68:M1460,N,W0,N,N,T,N,N,?12: RISCOS:3.70-4.36::RISC OS 3.70-4.36 +12288:32:0:44:M536: RISC OS:3.70:4.10:RISC OS 3.70 inet 4.10 + +# XXX quirk +# 4096:64:1:56:M1460,N,N,T:T: RISC OS:3.70:freenet:RISC OS 3.70 freenet 2.00 + + + +# ----------------- BSD/OS ------------------ + +# Once again, power of two WSS is also shared by MacOS X with DF set +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:3.1::BSD/OS 3.1-4.3 (or MacOS X 10.2 w/DF) +8192:64:1:60:M1460,N,W0,N,N,T: BSD/OS:4.0-4.3::BSD/OS 3.1-4.3 (or MacOS X 10.2) + + +# ---------------- NewtonOS ----------------- + +4096:64:0:44:M1420: NewtonOS:2.1::NewtonOS 2.1 + +# ---------------- NeXTSTEP ----------------- + +S4:64:0:44:M1024: NeXTSTEP:3.3::NeXTSTEP 3.3 +S8:64:0:44:M512: NeXTSTEP:3.3::NeXTSTEP 3.3 + +# ------------------ BeOS ------------------- + +1024:255:0:48:M*,N,W0: BeOS:5.0-5.1::BeOS 5.0-5.1 +12288:255:0:44:M1402: BeOS:5.0::BeOS 5.0.x + +# ------------------ OS/400 ----------------- + +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR4::OS/400 VR4/R5 +8192:64:1:60:M1440,N,W0,N,N,T: OS/400:VR5::OS/400 VR4/R5 +4096:64:1:60:M1440,N,W0,N,N,T: OS/400:V4R5:CF67032:OS/400 V4R5 + CF67032 + +# XXX quirk +# 28672:64:0:44:M1460:A:OS/390:? + +# ------------------ ULTRIX ----------------- + +16384:64:0:40:.: ULTRIX:4.5::ULTRIX 4.5 + +# ------------------- QNX ------------------- + +S16:64:0:44:M512: QNX:::QNX demodisk + +# ------------------ Novell ----------------- + +16384:128:1:44:M1460: Novell:NetWare:5.0:Novel Netware 5.0 +6144:128:1:44:M1460: Novell:IntranetWare:4.11:Novell IntranetWare 4.11 +6144:128:1:44:M1368: Novell:BorderManager::Novell BorderManager ? + +6144:128:1:52:M*,W0,N,S,N,N: Novell:Netware:6:Novell Netware 6 SP3 + + +# ----------------- SCO ------------------ +S3:64:1:60:M1460,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1 +S17:64:1:60:M1380,N,W0,N,N,T: SCO:UnixWare:7.1:SCO UnixWare 7.1.3 MP3 +S23:64:1:44:M1380: SCO:OpenServer:5.0:SCO OpenServer 5.0 + +# ------------------- DOS ------------------- + +2048:255:0:44:M536: DOS:WATTCP:1.05:DOS Arachne via WATTCP/1.05 +T2:255:0:44:M984: DOS:WATTCP:1.05Arachne:Arachne via WATTCP/1.05 (eepro) + +# ------------------ OS/2 ------------------- + +S56:64:0:44:M512: OS/2:4::OS/2 4 +28672:64:0:44:M1460: OS/2:4::OS/2 Warp 4.0 + +# ----------------- TOPS-20 ----------------- + +# Another hardcore MSS, one of the ACK leakers hunted down. +# XXX QUIRK 0:64:0:44:M1460:A:TOPS-20:version 7 +0:64:0:44:M1460: TOPS-20:7::TOPS-20 version 7 + +# ----------------- FreeMiNT ---------------- + +S44:255:0:44:M536: FreeMiNT:1:16A:FreeMiNT 1 patch 16A (Atari) + +# ------------------ AMIGA ------------------ + +# XXX TCP option 12 +# S32:64:1:56:M*,N,N,S,N,N,?12:.:AMIGA:3.9 BB2 with Miami stack + +# ------------------ Plan9 ------------------ + +65535:255:0:48:M1460,W0,N: Plan9:4::Plan9 edition 4 + +# ----------------- AMIGAOS ----------------- + +16384:64:1:48:M1560,N,N,S: AMIGAOS:3.9::AMIGAOS 3.9 BB2 MiamiDX + +########################################### +# Appliance / embedded / other signatures # +########################################### + +# ---------- Firewalls / routers ------------ + +S12:64:1:44:M1460: @Checkpoint:::Checkpoint (unknown 1) +S12:64:1:48:N,N,S,M1460: @Checkpoint:::Checkpoint (unknown 2) +4096:32:0:44:M1460: ExtremeWare:4.x::ExtremeWare 4.x + +# XXX TCP option 12 +# S32:64:0:68:M512,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO w/Checkpoint NG FP3 +# S16:64:0:68:M1024,N,W0,N,N,T,N,N,?12:.:Nokia:IPSO 3.7 build 026 + +S4:64:1:60:W0,N,S,T,M1460: FortiNet:FortiGate:50:FortiNet FortiGate 50 + +8192:64:1:44:M1460: Eagle:::Eagle Secure Gateway + +S52:128:1:48:M1260,N,N,N,N: LinkSys:WRV54G::LinkSys WRV54G VPN router + + + +# ------- Switches and other stuff ---------- + +4128:255:0:44:M*: Cisco:::Cisco Catalyst 3500, 7500 etc +S8:255:0:44:M*: Cisco:12008::Cisco 12008 +60352:128:1:64:M1460,N,W2,N,N,T,N,N,S: Alteon:ACEswitch::Alteon ACEswitch +64512:128:1:44:M1370: Nortel:Contivity Client::Nortel Conectivity Client + + +# ---------- Caches and whatnots ------------ + +S4:64:1:52:M1460,N,N,S,N,W0: AOL:web cache::AOL web cache + +32850:64:1:64:N,W1,N,N,T,N,N,S,M*: NetApp:5.x::NetApp Data OnTap 5.x +16384:64:1:64:M1460,N,N,S,N,W0,N: NetApp:5.3:1:NetApp 5.3.1 +65535:64:0:64:M1460,N,N,S,N,W*,N,N,T: NetApp:5.3-5.5::NetApp 5.3-5.5 +65535:64:0:60:M1460,N,W0,N,N,T: NetApp:CacheFlow::NetApp CacheFlow +8192:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:5.2:1:NetApp NetCache 5.2.1 +20480:64:1:64:M1460,N,N,S,N,W0,N,N,T: NetApp:4.1::NetApp NetCache4.1 + +65535:64:0:60:M1460,N,W0,N,N,T: CacheFlow:4.1::CacheFlow CacheOS 4.1 +8192:64:0:60:M1380,N,N,N,N,N,N,T: CacheFlow:1.1::CacheFlow CacheOS 1.1 + +S4:64:0:48:M1460,N,N,S: Cisco:Content Engine::Cisco Content Engine + +27085:128:0:40:.: Dell:PowerApp cache::Dell PowerApp (Linux-based) + +65535:255:1:48:N,W1,M1460: Inktomi:crawler::Inktomi crawler +S1:255:1:60:M1460,S,T,N,W0: LookSmart:ZyBorg::LookSmart ZyBorg + +16384:255:0:40:.: Proxyblocker:::Proxyblocker (what's this?) + +65535:255:0:48:M*,N,N,S: Redline:::Redline T|X 2200 + +32696:128:0:40:M1460: Spirent:Avalanche::Spirent Web Avalanche HTTP benchmarking engine + +# ----------- Embedded systems -------------- + +S9:255:0:44:M536: PalmOS:Tungsten:C:PalmOS Tungsten C +S5:255:0:44:M536: PalmOS:3::PalmOS 3/4 +S5:255:0:44:M536: PalmOS:4::PalmOS 3/4 +S4:255:0:44:M536: PalmOS:3:5:PalmOS 3.5 +2948:255:0:44:M536: PalmOS:3:5:PalmOS 3.5.3 (Handera) +S29:255:0:44:M536: PalmOS:5::PalmOS 5.0 +16384:255:0:44:M1398: PalmOS:5.2:Clie:PalmOS 5.2 (Clie) +S14:255:0:44:M1350: PalmOS:5.2:Treo:PalmOS 5.2.1 (Treo) + +S23:64:1:64:N,W1,N,N,T,N,N,S,M1460: SymbianOS:7::SymbianOS 7 + +8192:255:0:44:M1460: SymbianOS:6048::Symbian OS 6048 (Nokia 7650?) +8192:255:0:44:M536: SymbianOS:9210::Symbian OS (Nokia 9210?) +S22:64:1:56:M1460,T,S: SymbianOS:P800::Symbian OS ? (SE P800?) +S36:64:1:56:M1360,T,S: SymbianOS:6600::Symbian OS 60xx (Nokia 6600?) + + +# Perhaps S4? +5840:64:1:60:M1452,S,T,N,W1: Zaurus:3.10::Zaurus 3.10 + +32768:128:1:64:M1460,N,W0,N,N,T0,N,N,S: PocketPC:2002::PocketPC 2002 + +S1:255:0:44:M346: Contiki:1.1:rc0:Contiki 1.1-rc0 + +4096:128:0:44:M1460: Sega:Dreamcast:3.0:Sega Dreamcast Dreamkey 3.0 +T5:64:0:44:M536: Sega:Dreamcast:HKT-3020:Sega Dreamcast HKT-3020 (browser disc 51027) +S22:64:1:44:M1460: Sony:PS2::Sony Playstation 2 (SOCOM?) + +S12:64:0:44:M1452: AXIS:5600:v5.64:AXIS Printer Server 5600 v5.64 + +3100:32:1:44:M1460: Windows:CE:2.0:Windows CE 2.0 + +#################### +# Fancy signatures # +#################### + +1024:64:0:40:.: *NMAP:syn scan:1:NMAP syn scan (1) +2048:64:0:40:.: *NMAP:syn scan:2:NMAP syn scan (2) +3072:64:0:40:.: *NMAP:syn scan:3:NMAP syn scan (3) +4096:64:0:40:.: *NMAP:syn scan:4:NMAP syn scan (4) + +# Requires quirks support +# 1024:64:0:40:.:A:*NMAP:TCP sweep probe (1) +# 2048:64:0:40:.:A:*NMAP:TCP sweep probe (2) +# 3072:64:0:40:.:A:*NMAP:TCP sweep probe (3) +# 4096:64:0:40:.:A:*NMAP:TCP sweep probe (4) + +1024:64:0:60:W10,N,M265,T: *NMAP:OS:1:NMAP OS detection probe (1) +2048:64:0:60:W10,N,M265,T: *NMAP:OS:2:NMAP OS detection probe (2) +3072:64:0:60:W10,N,M265,T: *NMAP:OS:3:NMAP OS detection probe (3) +4096:64:0:60:W10,N,M265,T: *NMAP:OS:4:NMAP OS detection probe (4) + +32767:64:0:40:.: *NAST:::NASTsyn scan + +# Requires quirks support +# 12345:255:0:40:.:A:-p0f:sendsyn utility + + +##################################### +# Generic signatures - just in case # +##################################### + +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:4.0-4.9::FreeBSD 4.x/5.x +#*:64:1:60:M*,N,W*,N,N,T: @FreeBSD:5.0-5.1::FreeBSD 4.x/5.x + +*:128:1:52:M*,N,W0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:52:M*,N,W*,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323 no tstamp) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W0,N,N,T0,N,N,S: @Windows:2000:RFC1323:Windows XP/2000 (RFC1323) +*:128:1:64:M*,N,W*,N,N,T0,N,N,S: @Windows:XP:RFC1323:Windows XP (RFC1323, w+) +*:128:1:48:M536,N,N,S: @Windows:98::Windows 98 +*:128:1:48:M*,N,N,S: @Windows:XP::Windows XP/2000 +*:128:1:48:M*,N,N,S: @Windows:2000::Windows XP/2000 + + From owner-svn-src-all@freebsd.org Sat Aug 11 14:45:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFF9106F471; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D38B81E5C; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05E2918A4B; Sat, 11 Aug 2018 14:45:34 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BEjXRD066888; Sat, 11 Aug 2018 14:45:33 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BEjXG9066887; Sat, 11 Aug 2018 14:45:33 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201808111445.w7BEjXG9066887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 11 Aug 2018 14:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337628 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 337628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 14:45:34 -0000 Author: kevlo Date: Sat Aug 11 14:45:33 2018 New Revision: 337628 URL: https://svnweb.freebsd.org/changeset/base/337628 Log: Remove unused MAPDESCFILE. Modified: head/usr.sbin/bsdinstall/scripts/keymap Modified: head/usr.sbin/bsdinstall/scripts/keymap ============================================================================== --- head/usr.sbin/bsdinstall/scripts/keymap Sat Aug 11 13:58:26 2018 (r337627) +++ head/usr.sbin/bsdinstall/scripts/keymap Sat Aug 11 14:45:33 2018 (r337628) @@ -43,11 +43,6 @@ f_include $BSDCFG_SHARE/sysrc.subr # : ${KEYMAPFILE:=$BSDINSTALL_TMPETC/rc.conf.keymap} -# -# Default path to keymap INDEX containing descriptions -# -: ${MAPDESCFILE:=/usr/share/syscons/keymaps/INDEX.keymaps} - ############################################################ GLOBALS # From owner-svn-src-all@freebsd.org Sat Aug 11 16:06:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16EFB1071860; Sat, 11 Aug 2018 16:06:33 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C018A84F0A; Sat, 11 Aug 2018 16:06:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A51119777; Sat, 11 Aug 2018 16:06:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BG6WQr009358; Sat, 11 Aug 2018 16:06:32 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BG6W2S009357; Sat, 11 Aug 2018 16:06:32 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201808111606.w7BG6W2S009357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 11 Aug 2018 16:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337629 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 337629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:06:33 -0000 Author: brd Date: Sat Aug 11 16:06:32 2018 New Revision: 337629 URL: https://svnweb.freebsd.org/changeset/base/337629 Log: Fix the build by just installing systop since testing shows it works with: dwatch -X systop Reviewed by: kp Approved by: allanjude (mentor) Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 14:45:33 2018 (r337628) +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 16:06:32 2018 (r337629) @@ -12,6 +12,7 @@ FILES= chmod \ rw \ sched \ sendrecv \ + systop \ tcp \ udp \ udplite \ @@ -62,7 +63,6 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto -LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused From owner-svn-src-all@freebsd.org Sat Aug 11 16:09:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596C91071943; Sat, 11 Aug 2018 16:09:28 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08D1085099; Sat, 11 Aug 2018 16:09:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AE61B21607; Sat, 11 Aug 2018 12:09:21 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute5.internal (MEProxy); Sat, 11 Aug 2018 12:09:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=jy6RSW KOdBSZVp/0vHql5KQAproK4QXA7Kt8CW266jo=; b=DQoJlRrXvaax9uybp+2XPH QNQUJZ1La0o7rm3BcS5guzCOo/Ann6EhvssLonvLVD3/ZZBuff9Ifex6q0uUDwI6 e46XqwnZNfg78tU4BSKTJa+zawTY3V3EsXfLBVCdQz+kFlOj44jPkzzWOdDzK6rr 5ty/YE64jszBP7xY5LBM5qG5d+NjSmExw7/5zlU3NaDG1OQSw1r4BSFKf3UFfKhU Y+S5EbK5s3KG3rJOwSkTfP74cdFuAL2MzAnPfTMb5you51CEC0sdKcEaknucH3Px 5vQ6y6SmOP5ToZWkSGTpS0X1AYzHFg7pinKMtMEo2ltUrudhQsJk39Bp0C7ikofg == X-ME-Proxy: X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 3AA9194103; Sat, 11 Aug 2018 12:09:21 -0400 (EDT) Message-Id: <1534003761.1809972.1470908040.4D49BCD1@webmail.messagingengine.com> From: Brad Davis To: Kristof Provost , Devin Teske Cc: 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; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-9a5384d7 In-Reply-To: References: <201808110632.w7B6WVE9009976@repo.freebsd.org> Date: Sat, 11 Aug 2018 10:09:21 -0600 Subject: Re: svn commit: r337611 - head/cddl/usr.sbin/dwatch/libexec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:09:28 -0000 On Sat, Aug 11, 2018, at 7:06 AM, Kristof Provost wrote: > Hi Devin, > On 11 Aug 2018, at 8:32, Devin Teske wrote: >> Author: dteske >> Date: Sat Aug 11 06:32:31 2018 >> New Revision: 337611 >> URL: https://svnweb.freebsd.org/changeset/base/337611 >> >> Log: >> dwatch(1): Add systop profile >> >> Provides a top-like view of syscall consumers. >> >> MFC after: 3 days >> X-MFC-to: stable/11 >> Sponsored by: Smule, Inc. >> >> Added: >> head/cddl/usr.sbin/dwatch/libexec/systop (contents, props changed) >> Modified: >> head/cddl/usr.sbin/dwatch/libexec/Makefile >> >> Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile >> ============================================================================== >> --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:13:11 2018 (r337610) >> +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sat Aug 11 06:32:31 2018 (r337611) >> @@ -62,6 +62,7 @@ LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dw >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg >> LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto >> +LINKS+= ${LIBEXECDIR}/dwatch/systop ${LIBEXECDIR}/dwatch/systop > This breaks install world: > install: link /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop -> /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/libexec/dwatch/systop: No such file or directory Hi Devin, I committed a fix in r337629 to just install systop, since that seems to be what you meant.. If not, please let me know and I would be happy to help correct that. Regards, Brad Davis From owner-svn-src-all@freebsd.org Sat Aug 11 16:12:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B7231071B3E; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5113685469; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C2419905; Sat, 11 Aug 2018 16:12:24 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGCOQZ014495; Sat, 11 Aug 2018 16:12:24 GMT (envelope-from netchild@FreeBSD.org) Received: (from netchild@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGCOs9014494; Sat, 11 Aug 2018 16:12:24 GMT (envelope-from netchild@FreeBSD.org) Message-Id: <201808111612.w7BGCOs9014494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: netchild set sender to netchild@FreeBSD.org using -f From: Alexander Leidinger Date: Sat, 11 Aug 2018 16:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337630 - head/sbin/restore X-SVN-Group: head X-SVN-Commit-Author: netchild X-SVN-Commit-Paths: head/sbin/restore X-SVN-Commit-Revision: 337630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:12:24 -0000 Author: netchild Date: Sat Aug 11 16:12:23 2018 New Revision: 337630 URL: https://svnweb.freebsd.org/changeset/base/337630 Log: Re-enable reading byte swapped NFS_MAGIC dumps. Fix bug introduced in r98542: previously to this revision the byte-swapped value was compared at this place. The current check is in a conditional section where the non-byte-swapped value was already checked to be not the value which is checked again. As byte-swapping is activated afterwards, it only makes sense if the byte-swapped value is checked. Submitted by: Keith White PR: 200059 MFC after: 1 month Sponsored by: Essen Hackathon Modified: head/sbin/restore/tape.c Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Sat Aug 11 16:06:32 2018 (r337629) +++ head/sbin/restore/tape.c Sat Aug 11 16:12:23 2018 (r337630) @@ -1314,8 +1314,8 @@ gethead(struct s_spcl *buf) return (FAIL); } if (swabl(buf->c_magic) != FS_UFS2_MAGIC && - buf->c_magic != NFS_MAGIC) { - if (buf->c_magic == OFS_MAGIC) { + swabl(buf->c_magic) != NFS_MAGIC) { + if (swabl(buf->c_magic) == OFS_MAGIC) { fprintf(stderr, "Format of dump tape is too old. Must use\n"); fprintf(stderr, From owner-svn-src-all@freebsd.org Sat Aug 11 16:29:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8A71072632; Sat, 11 Aug 2018 16:29:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DD2085F84; Sat, 11 Aug 2018 16:29:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6981B19ABC; Sat, 11 Aug 2018 16:29:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGTTxa019938; Sat, 11 Aug 2018 16:29:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGTPRE019921; Sat, 11 Aug 2018 16:29:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111629.w7BGTPRE019921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337631 - in vendor/llvm/dist-release_70: . docs lib/Analysis lib/CodeGen/SelectionDAG lib/MC/MCParser lib/Target/AMDGPU lib/Target/NVPTX lib/Transforms/Instrumentation test/CodeGen/AAr... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm/dist-release_70: . docs lib/Analysis lib/CodeGen/SelectionDAG lib/MC/MCParser lib/Target/AMDGPU lib/Target/NVPTX lib/Transforms/Instrumentation test/CodeGen/AArch64 test/CodeGen/AMDGPU ... X-SVN-Commit-Revision: 337631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:29:30 -0000 Author: dim Date: Sat Aug 11 16:29:25 2018 New Revision: 337631 URL: https://svnweb.freebsd.org/changeset/base/337631 Log: Vendor import of llvm release_70 branch r339355: https://llvm.org/svn/llvm-project/llvm/branches/release_70@339355 Added: vendor/llvm/dist-release_70/test/CodeGen/NVPTX/load-store.ll vendor/llvm/dist-release_70/test/Instrumentation/BoundsChecking/many-traps-2.ll Deleted: vendor/llvm/dist-release_70/test/MC/ELF/extra-section-flags.s Modified: vendor/llvm/dist-release_70/CMakeLists.txt vendor/llvm/dist-release_70/docs/ReleaseNotes.rst vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist-release_70/lib/Analysis/ValueTracking.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist-release_70/lib/MC/MCParser/ELFAsmParser.cpp vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPUFeatures.td vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.cpp vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.h vendor/llvm/dist-release_70/lib/Target/AMDGPU/VOP3Instructions.td vendor/llvm/dist-release_70/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp vendor/llvm/dist-release_70/lib/Transforms/Instrumentation/BoundsChecking.cpp vendor/llvm/dist-release_70/test/CodeGen/AArch64/fcopysign.ll vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/kernel-args.ll vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/mad_uint24.ll vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/r600.work-item-intrinsics.ll vendor/llvm/dist-release_70/test/CodeGen/X86/masked_memop.ll vendor/llvm/dist-release_70/test/Transforms/InstSimplify/AndOrXor.ll vendor/llvm/dist-release_70/test/Transforms/InstSimplify/floating-point-compare.ll vendor/llvm/dist-release_70/test/Transforms/NewGVN/pair_jumpthread.ll Modified: vendor/llvm/dist-release_70/CMakeLists.txt ============================================================================== --- vendor/llvm/dist-release_70/CMakeLists.txt Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/CMakeLists.txt Sat Aug 11 16:29:25 2018 (r337631) @@ -1037,6 +1037,6 @@ if(LLVM_DISTRIBUTION_COMPONENTS) endif() # This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake -if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") +if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_INSTALL_UCRT_LIBRARIES) include(InstallRequiredSystemLibraries) endif() Modified: vendor/llvm/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist-release_70/docs/ReleaseNotes.rst Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/docs/ReleaseNotes.rst Sat Aug 11 16:29:25 2018 (r337631) @@ -40,6 +40,12 @@ Non-comprehensive list of changes in this release functionality, or simply have a lot to talk about), see the `NOTE` below for adding a new subsection. +* The Windows installer no longer includes a Visual Studio integration. + Instead, a new + `LLVM Compiler Toolchain Visual Studio extension ` + is available on the Visual Studio Marketplace. The new integration includes + support for Visual Studio 2017. + * Libraries have been renamed from 7.0 to 7. This change also impacts downstream libraries like lldb. @@ -155,6 +161,26 @@ Changes to the PowerPC Target During this release ... +Changes to the SystemZ Target +----------------------------- + +During this release the SystemZ target has: + +* Added support for vector registers in inline asm statements. + +* Added support for stackmaps, patchpoints, and the anyregcc + calling convention. + +* Changed the default function alignment to 16 bytes. + +* Improved codegen for condition code handling. + +* Improved instruction scheduling and microarchitecture tuning for z13/z14. + +* Fixed support for generating GCOV coverage data. + +* Fixed some codegen bugs. + Changes to the X86 Target ------------------------- @@ -191,6 +217,10 @@ Changes to the DAG infrastructure should use UADDO/ADDCARRY/USUBO/SUBCARRY instead of the deprecated opcodes. * The SETCCE opcode has now been removed in favor of SETCCCARRY. + +* TableGen now supports multi-alternative pattern fragments via the PatFrags + class. PatFrag is now derived from PatFrags, which may require minor + changes to backends that directly access PatFrag members. External Open Source Projects Using LLVM 7 ========================================== Modified: vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Analysis/InstructionSimplify.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -1863,6 +1863,40 @@ static Value *SimplifyAndInst(Value *Op0, Value *Op1, MaxRecurse)) return V; + // Assuming the effective width of Y is not larger than A, i.e. all bits + // from X and Y are disjoint in (X << A) | Y, + // if the mask of this AND op covers all bits of X or Y, while it covers + // no bits from the other, we can bypass this AND op. E.g., + // ((X << A) | Y) & Mask -> Y, + // if Mask = ((1 << effective_width_of(Y)) - 1) + // ((X << A) | Y) & Mask -> X << A, + // if Mask = ((1 << effective_width_of(X)) - 1) << A + // SimplifyDemandedBits in InstCombine can optimize the general case. + // This pattern aims to help other passes for a common case. + Value *Y, *XShifted; + if (match(Op1, m_APInt(Mask)) && + match(Op0, m_c_Or(m_CombineAnd(m_NUWShl(m_Value(X), m_APInt(ShAmt)), + m_Value(XShifted)), + m_Value(Y)))) { + const unsigned ShftCnt = ShAmt->getZExtValue(); + const KnownBits YKnown = computeKnownBits(Y, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); + const unsigned Width = Op0->getType()->getScalarSizeInBits(); + const unsigned EffWidthY = Width - YKnown.countMinLeadingZeros(); + if (EffWidthY <= ShftCnt) { + const KnownBits XKnown = computeKnownBits(X, Q.DL, 0, Q.AC, Q.CxtI, + Q.DT); + const unsigned EffWidthX = Width - XKnown.countMinLeadingZeros(); + const APInt EffBitsY = APInt::getLowBitsSet(Width, EffWidthY); + const APInt EffBitsX = APInt::getLowBitsSet(Width, EffWidthX) << ShftCnt; + // If the mask is extracting all bits from X or Y as is, we can skip + // this AND op. + if (EffBitsY.isSubsetOf(*Mask) && !EffBitsX.intersects(*Mask)) + return Y; + if (EffBitsX.isSubsetOf(*Mask) && !EffBitsY.intersects(*Mask)) + return XShifted; + } + } + return nullptr; } Modified: vendor/llvm/dist-release_70/lib/Analysis/ValueTracking.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Analysis/ValueTracking.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Analysis/ValueTracking.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -2817,10 +2817,13 @@ static bool cannotBeOrderedLessThanZeroImpl(const Valu default: break; case Intrinsic::maxnum: - return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly, - Depth + 1) || - cannotBeOrderedLessThanZeroImpl(I->getOperand(1), TLI, SignBitOnly, - Depth + 1); + return (isKnownNeverNaN(I->getOperand(0)) && + cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, + SignBitOnly, Depth + 1)) || + (isKnownNeverNaN(I->getOperand(1)) && + cannotBeOrderedLessThanZeroImpl(I->getOperand(1), TLI, + SignBitOnly, Depth + 1)); + case Intrinsic::minnum: return cannotBeOrderedLessThanZeroImpl(I->getOperand(0), TLI, SignBitOnly, Depth + 1) && Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -1489,24 +1489,20 @@ SDValue SelectionDAGLegalize::ExpandFCOPYSIGN(SDNode * // Get the signbit at the right position for MagAsInt. int ShiftAmount = SignAsInt.SignBit - MagAsInt.SignBit; + EVT ShiftVT = IntVT; + if (SignBit.getValueSizeInBits() < ClearedSign.getValueSizeInBits()) { + SignBit = DAG.getNode(ISD::ZERO_EXTEND, DL, MagVT, SignBit); + ShiftVT = MagVT; + } + if (ShiftAmount > 0) { + SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, ShiftVT); + SignBit = DAG.getNode(ISD::SRL, DL, ShiftVT, SignBit, ShiftCnst); + } else if (ShiftAmount < 0) { + SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, ShiftVT); + SignBit = DAG.getNode(ISD::SHL, DL, ShiftVT, SignBit, ShiftCnst); + } if (SignBit.getValueSizeInBits() > ClearedSign.getValueSizeInBits()) { - if (ShiftAmount > 0) { - SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, IntVT); - SignBit = DAG.getNode(ISD::SRL, DL, IntVT, SignBit, ShiftCnst); - } else if (ShiftAmount < 0) { - SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, IntVT); - SignBit = DAG.getNode(ISD::SHL, DL, IntVT, SignBit, ShiftCnst); - } SignBit = DAG.getNode(ISD::TRUNCATE, DL, MagVT, SignBit); - } else if (SignBit.getValueSizeInBits() < ClearedSign.getValueSizeInBits()) { - SignBit = DAG.getNode(ISD::ZERO_EXTEND, DL, MagVT, SignBit); - if (ShiftAmount > 0) { - SDValue ShiftCnst = DAG.getConstant(ShiftAmount, DL, MagVT); - SignBit = DAG.getNode(ISD::SRL, DL, MagVT, SignBit, ShiftCnst); - } else if (ShiftAmount < 0) { - SDValue ShiftCnst = DAG.getConstant(-ShiftAmount, DL, MagVT); - SignBit = DAG.getNode(ISD::SHL, DL, MagVT, SignBit, ShiftCnst); - } } // Store the part with the modified sign and convert back to float. Modified: vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -3641,26 +3641,43 @@ SDValue DAGTypeLegalizer::WidenVecOp_STORE(SDNode *N) } SDValue DAGTypeLegalizer::WidenVecOp_MSTORE(SDNode *N, unsigned OpNo) { - assert(OpNo == 3 && "Can widen only data operand of mstore"); + assert((OpNo == 2 || OpNo == 3) && + "Can widen only data or mask operand of mstore"); MaskedStoreSDNode *MST = cast(N); SDValue Mask = MST->getMask(); EVT MaskVT = Mask.getValueType(); SDValue StVal = MST->getValue(); - // Widen the value - SDValue WideVal = GetWidenedVector(StVal); SDLoc dl(N); - // The mask should be widened as well. - EVT WideVT = WideVal.getValueType(); - EVT WideMaskVT = EVT::getVectorVT(*DAG.getContext(), - MaskVT.getVectorElementType(), - WideVT.getVectorNumElements()); - Mask = ModifyToType(Mask, WideMaskVT, true); + if (OpNo == 3) { + // Widen the value + StVal = GetWidenedVector(StVal); + // The mask should be widened as well. + EVT WideVT = StVal.getValueType(); + EVT WideMaskVT = EVT::getVectorVT(*DAG.getContext(), + MaskVT.getVectorElementType(), + WideVT.getVectorNumElements()); + Mask = ModifyToType(Mask, WideMaskVT, true); + } else { + EVT WideMaskVT = TLI.getTypeToTransformTo(*DAG.getContext(), MaskVT); + Mask = ModifyToType(Mask, WideMaskVT, true); + + EVT ValueVT = StVal.getValueType(); + if (getTypeAction(ValueVT) == TargetLowering::TypeWidenVector) + StVal = GetWidenedVector(StVal); + else { + EVT WideVT = EVT::getVectorVT(*DAG.getContext(), + ValueVT.getVectorElementType(), + WideMaskVT.getVectorNumElements()); + StVal = ModifyToType(StVal, WideVT); + } + } + assert(Mask.getValueType().getVectorNumElements() == - WideVal.getValueType().getVectorNumElements() && + StVal.getValueType().getVectorNumElements() && "Mask and data vectors should have the same number of elements"); - return DAG.getMaskedStore(MST->getChain(), dl, WideVal, MST->getBasePtr(), + return DAG.getMaskedStore(MST->getChain(), dl, StVal, MST->getBasePtr(), Mask, MST->getMemoryVT(), MST->getMemOperand(), false, MST->isCompressingStore()); } Modified: vendor/llvm/dist-release_70/lib/MC/MCParser/ELFAsmParser.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/MC/MCParser/ELFAsmParser.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/MC/MCParser/ELFAsmParser.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -481,34 +481,6 @@ static bool hasPrefix(StringRef SectionName, StringRef return SectionName.startswith(Prefix) || SectionName == Prefix.drop_back(); } -// Return a set of section flags based on the section name that can then -// be augmented later, otherwise return 0 if we don't have any reasonable -// defaults. -static unsigned defaultSectionFlags(StringRef SectionName) { - - if (hasPrefix(SectionName, ".rodata.cst")) - return ELF::SHF_ALLOC | ELF::SHF_MERGE; - - if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") - return ELF::SHF_ALLOC; - - if (SectionName == ".fini" || SectionName == ".init" || - hasPrefix(SectionName, ".text.")) - return ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; - - if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || - hasPrefix(SectionName, ".bss.") || - hasPrefix(SectionName, ".init_array.") || - hasPrefix(SectionName, ".fini_array.") || - hasPrefix(SectionName, ".preinit_array.")) - return ELF::SHF_ALLOC | ELF::SHF_WRITE; - - if (hasPrefix(SectionName, ".tdata.") || hasPrefix(SectionName, ".tbss.")) - return ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_TLS; - - return 0; -} - bool ELFAsmParser::ParseSectionArguments(bool IsPush, SMLoc loc) { StringRef SectionName; @@ -518,13 +490,27 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, StringRef TypeName; int64_t Size = 0; StringRef GroupName; + unsigned Flags = 0; const MCExpr *Subsection = nullptr; bool UseLastGroup = false; MCSymbolELF *Associated = nullptr; int64_t UniqueID = ~0; - // Set the default section flags first in case no others are given. - unsigned Flags = defaultSectionFlags(SectionName); + // Set the defaults first. + if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1") + Flags |= ELF::SHF_ALLOC; + else if (SectionName == ".fini" || SectionName == ".init" || + hasPrefix(SectionName, ".text.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_EXECINSTR; + else if (hasPrefix(SectionName, ".data.") || SectionName == ".data1" || + hasPrefix(SectionName, ".bss.") || + hasPrefix(SectionName, ".init_array.") || + hasPrefix(SectionName, ".fini_array.") || + hasPrefix(SectionName, ".preinit_array.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE; + else if (hasPrefix(SectionName, ".tdata.") || + hasPrefix(SectionName, ".tbss.")) + Flags |= ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_TLS; if (getLexer().is(AsmToken::Comma)) { Lex(); @@ -552,12 +538,6 @@ bool ELFAsmParser::ParseSectionArguments(bool IsPush, if (extraFlags == -1U) return TokError("unknown flag"); - - // If we found additional section flags on a known section then give a - // warning. - if (Flags && Flags != extraFlags) - Warning(loc, "setting incorrect section attributes for " + SectionName); - Flags |= extraFlags; bool Mergeable = Flags & ELF::SHF_MERGE; Modified: vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPU.td ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPU.td Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPU.td Sat Aug 11 16:29:25 2018 (r337631) @@ -267,15 +267,6 @@ def FeatureD16PreservesUnusedBits : SubtargetFeature< // Subtarget Features (options and debugging) //===------------------------------------------------------------===// -// Some instructions do not support denormals despite this flag. Using -// fp32 denormals also causes instructions to run at the double -// precision rate for the device. -def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", - "FP32Denormals", - "true", - "Enable single precision denormal handling" ->; - // Denormal handling for fp64 and fp16 is controlled by the same // config register when fp16 supported. // TODO: Do we need a separate f16 setting when not legal? Modified: vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPUFeatures.td ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPUFeatures.td Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/AMDGPU/AMDGPUFeatures.td Sat Aug 11 16:29:25 2018 (r337631) @@ -19,6 +19,15 @@ def FeatureFMA : SubtargetFeature<"fmaf", "Enable single precision FMA (not as fast as mul+add, but fused)" >; +// Some instructions do not support denormals despite this flag. Using +// fp32 denormals also causes instructions to run at the double +// precision rate for the device. +def FeatureFP32Denormals : SubtargetFeature<"fp32-denormals", + "FP32Denormals", + "true", + "Enable single precision denormal handling" +>; + class SubtargetFeatureLocalMemorySize : SubtargetFeature< "localmemorysize"#Value, "LocalMemorySize", Modified: vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -903,7 +903,7 @@ SDValue R600TargetLowering::LowerImplicitParameter(Sel unsigned DwordOffset) const { unsigned ByteOffset = DwordOffset * 4; PointerType * PtrType = PointerType::get(VT.getTypeForEVT(*DAG.getContext()), - AMDGPUASI.CONSTANT_BUFFER_0); + AMDGPUASI.PARAM_I_ADDRESS); // We shouldn't be using an offset wider than 16-bits for implicit parameters. assert(isInt<16>(ByteOffset)); @@ -1457,33 +1457,17 @@ SDValue R600TargetLowering::LowerLOAD(SDValue Op, Sele return scalarizeVectorLoad(LoadNode, DAG); } + // This is still used for explicit load from addrspace(8) int ConstantBlock = ConstantAddressBlock(LoadNode->getAddressSpace()); if (ConstantBlock > -1 && ((LoadNode->getExtensionType() == ISD::NON_EXTLOAD) || (LoadNode->getExtensionType() == ISD::ZEXTLOAD))) { SDValue Result; - if (isa(LoadNode->getMemOperand()->getValue()) || - isa(LoadNode->getMemOperand()->getValue()) || + if (isa(LoadNode->getMemOperand()->getValue()) || isa(Ptr)) { - SDValue Slots[4]; - for (unsigned i = 0; i < 4; i++) { - // We want Const position encoded with the following formula : - // (((512 + (kc_bank << 12) + const_index) << 2) + chan) - // const_index is Ptr computed by llvm using an alignment of 16. - // Thus we add (((512 + (kc_bank << 12)) + chan ) * 4 here and - // then div by 4 at the ISel step - SDValue NewPtr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, - DAG.getConstant(4 * i + ConstantBlock * 16, DL, MVT::i32)); - Slots[i] = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::i32, NewPtr); - } - EVT NewVT = MVT::v4i32; - unsigned NumElements = 4; - if (VT.isVector()) { - NewVT = VT; - NumElements = VT.getVectorNumElements(); - } - Result = DAG.getBuildVector(NewVT, DL, makeArrayRef(Slots, NumElements)); + return constBufferLoad(LoadNode, LoadNode->getAddressSpace(), DAG); } else { + //TODO: Does this even work? // non-constant ptr can't be folded, keeps it as a v4f32 load Result = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::v4i32, DAG.getNode(ISD::SRL, DL, MVT::i32, Ptr, @@ -1622,7 +1606,7 @@ SDValue R600TargetLowering::LowerFormalArguments( } PointerType *PtrTy = PointerType::get(VT.getTypeForEVT(*DAG.getContext()), - AMDGPUASI.CONSTANT_BUFFER_0); + AMDGPUASI.PARAM_I_ADDRESS); // i64 isn't a legal type, so the register type used ends up as i32, which // isn't expected here. It attempts to create this sextload, but it ends up @@ -1646,17 +1630,17 @@ SDValue R600TargetLowering::LowerFormalArguments( unsigned ValBase = ArgLocs[In.getOrigArgIndex()].getLocMemOffset(); unsigned PartOffset = VA.getLocMemOffset(); + unsigned Alignment = MinAlign(VT.getStoreSize(), PartOffset); MachinePointerInfo PtrInfo(UndefValue::get(PtrTy), PartOffset - ValBase); SDValue Arg = DAG.getLoad( ISD::UNINDEXED, Ext, VT, DL, Chain, DAG.getConstant(PartOffset, DL, MVT::i32), DAG.getUNDEF(MVT::i32), PtrInfo, - MemVT, /* Alignment = */ 4, MachineMemOperand::MONonTemporal | + MemVT, Alignment, MachineMemOperand::MONonTemporal | MachineMemOperand::MODereferenceable | MachineMemOperand::MOInvariant); - // 4 is the preferred alignment for the CONSTANT memory space. InVals.push_back(Arg); } return Chain; @@ -1804,6 +1788,52 @@ SDValue R600TargetLowering::OptimizeSwizzle(SDValue Bu return BuildVector; } +SDValue R600TargetLowering::constBufferLoad(LoadSDNode *LoadNode, int Block, + SelectionDAG &DAG) const { + SDLoc DL(LoadNode); + EVT VT = LoadNode->getValueType(0); + SDValue Chain = LoadNode->getChain(); + SDValue Ptr = LoadNode->getBasePtr(); + assert (isa(Ptr)); + + //TODO: Support smaller loads + if (LoadNode->getMemoryVT().getScalarType() != MVT::i32 || !ISD::isNON_EXTLoad(LoadNode)) + return SDValue(); + + if (LoadNode->getAlignment() < 4) + return SDValue(); + + int ConstantBlock = ConstantAddressBlock(Block); + + SDValue Slots[4]; + for (unsigned i = 0; i < 4; i++) { + // We want Const position encoded with the following formula : + // (((512 + (kc_bank << 12) + const_index) << 2) + chan) + // const_index is Ptr computed by llvm using an alignment of 16. + // Thus we add (((512 + (kc_bank << 12)) + chan ) * 4 here and + // then div by 4 at the ISel step + SDValue NewPtr = DAG.getNode(ISD::ADD, DL, Ptr.getValueType(), Ptr, + DAG.getConstant(4 * i + ConstantBlock * 16, DL, MVT::i32)); + Slots[i] = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::i32, NewPtr); + } + EVT NewVT = MVT::v4i32; + unsigned NumElements = 4; + if (VT.isVector()) { + NewVT = VT; + NumElements = VT.getVectorNumElements(); + } + SDValue Result = DAG.getBuildVector(NewVT, DL, makeArrayRef(Slots, NumElements)); + if (!VT.isVector()) { + Result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, MVT::i32, Result, + DAG.getConstant(0, DL, MVT::i32)); + } + SDValue MergedValues[2] = { + Result, + Chain + }; + return DAG.getMergeValues(MergedValues, DL); +} + //===----------------------------------------------------------------------===// // Custom DAG Optimizations //===----------------------------------------------------------------------===// @@ -2022,6 +2052,16 @@ SDValue R600TargetLowering::PerformDAGCombine(SDNode * NewArgs[1] = OptimizeSwizzle(N->getOperand(1), &NewArgs[2], DAG, DL); return DAG.getNode(AMDGPUISD::TEXTURE_FETCH, DL, N->getVTList(), NewArgs); } + + case ISD::LOAD: { + LoadSDNode *LoadNode = cast(N); + SDValue Ptr = LoadNode->getBasePtr(); + if (LoadNode->getAddressSpace() == AMDGPUAS::PARAM_I_ADDRESS && + isa(Ptr)) + return constBufferLoad(LoadNode, AMDGPUAS::CONSTANT_BUFFER_0, DAG); + break; + } + default: break; } Modified: vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.h ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.h Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/AMDGPU/R600ISelLowering.h Sat Aug 11 16:29:25 2018 (r337631) @@ -98,9 +98,11 @@ class R600TargetLowering final : public AMDGPUTargetLo bool isHWTrueValue(SDValue Op) const; bool isHWFalseValue(SDValue Op) const; - bool FoldOperand(SDNode *ParentNode, unsigned SrcIdx, SDValue &Src, - SDValue &Neg, SDValue &Abs, SDValue &Sel, SDValue &Imm, - SelectionDAG &DAG) const; + bool FoldOperand(SDNode *ParentNode, unsigned SrcIdx, SDValue &Src, + SDValue &Neg, SDValue &Abs, SDValue &Sel, SDValue &Imm, + SelectionDAG &DAG) const; + SDValue constBufferLoad(LoadSDNode *LoadNode, int Block, + SelectionDAG &DAG) const; SDNode *PostISelFolding(MachineSDNode *N, SelectionDAG &DAG) const override; }; Modified: vendor/llvm/dist-release_70/lib/Target/AMDGPU/VOP3Instructions.td ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/AMDGPU/VOP3Instructions.td Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/AMDGPU/VOP3Instructions.td Sat Aug 11 16:29:25 2018 (r337631) @@ -461,17 +461,6 @@ def : GCNPat < (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)) >; -def : GCNPat< - (i32 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))), - (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)) ->; - -def : GCNPat< - (i64 (op3 (op2 (op1 i16:$src0, i16:$src1), i16:$src2))), - (REG_SEQUENCE VReg_64, - (inst i16:$src0, i16:$src1, i16:$src2, (i1 0)), sub0, - (V_MOV_B32_e32 (i32 0)), sub1) ->; } defm: Ternary_i16_Pats; Modified: vendor/llvm/dist-release_70/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -16,6 +16,7 @@ #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/Instructions.h" +#include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" @@ -81,10 +82,12 @@ void NVPTXDAGToDAGISel::Select(SDNode *N) { switch (N->getOpcode()) { case ISD::LOAD: + case ISD::ATOMIC_LOAD: if (tryLoad(N)) return; break; case ISD::STORE: + case ISD::ATOMIC_STORE: if (tryStore(N)) return; break; @@ -834,17 +837,27 @@ static Optional pickOpcodeForVT( bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { SDLoc dl(N); - LoadSDNode *LD = cast(N); + MemSDNode *LD = cast(N); + assert(LD->readMem() && "Expected load"); + LoadSDNode *PlainLoad = dyn_cast(N); EVT LoadedVT = LD->getMemoryVT(); SDNode *NVPTXLD = nullptr; // do not support pre/post inc/dec - if (LD->isIndexed()) + if (PlainLoad && PlainLoad->isIndexed()) return false; if (!LoadedVT.isSimple()) return false; + AtomicOrdering Ordering = LD->getOrdering(); + // In order to lower atomic loads with stronger guarantees we would need to + // use load.acquire or insert fences. However these features were only added + // with PTX ISA 6.0 / sm_70. + // TODO: Check if we can actually use the new instructions and implement them. + if (isStrongerThanMonotonic(Ordering)) + return false; + // Address Space Setting unsigned int CodeAddrSpace = getCodeAddrSpace(LD); if (canLowerToLDG(LD, *Subtarget, CodeAddrSpace, MF)) { @@ -855,8 +868,9 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { CurDAG->getDataLayout().getPointerSizeInBits(LD->getAddressSpace()); // Volatile Setting - // - .volatile is only availalble for .global and .shared - bool isVolatile = LD->isVolatile(); + // - .volatile is only available for .global and .shared + // - .volatile has the same memory synchronization semantics as .relaxed.sys + bool isVolatile = LD->isVolatile() || Ordering == AtomicOrdering::Monotonic; if (CodeAddrSpace != NVPTX::PTXLdStInstCode::GLOBAL && CodeAddrSpace != NVPTX::PTXLdStInstCode::SHARED && CodeAddrSpace != NVPTX::PTXLdStInstCode::GENERIC) @@ -882,7 +896,7 @@ bool NVPTXDAGToDAGISel::tryLoad(SDNode *N) { fromTypeWidth = 32; } - if ((LD->getExtensionType() == ISD::SEXTLOAD)) + if (PlainLoad && (PlainLoad->getExtensionType() == ISD::SEXTLOAD)) fromType = NVPTX::PTXLdStInstCode::Signed; else if (ScalarVT.isFloatingPoint()) // f16 uses .b16 as its storage type. @@ -1691,25 +1705,38 @@ bool NVPTXDAGToDAGISel::tryLDGLDU(SDNode *N) { bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { SDLoc dl(N); - StoreSDNode *ST = cast(N); + MemSDNode *ST = cast(N); + assert(ST->writeMem() && "Expected store"); + StoreSDNode *PlainStore = dyn_cast(N); + AtomicSDNode *AtomicStore = dyn_cast(N); + assert((PlainStore || AtomicStore) && "Expected store"); EVT StoreVT = ST->getMemoryVT(); SDNode *NVPTXST = nullptr; // do not support pre/post inc/dec - if (ST->isIndexed()) + if (PlainStore && PlainStore->isIndexed()) return false; if (!StoreVT.isSimple()) return false; + AtomicOrdering Ordering = ST->getOrdering(); + // In order to lower atomic loads with stronger guarantees we would need to + // use store.release or insert fences. However these features were only added + // with PTX ISA 6.0 / sm_70. + // TODO: Check if we can actually use the new instructions and implement them. + if (isStrongerThanMonotonic(Ordering)) + return false; + // Address Space Setting unsigned int CodeAddrSpace = getCodeAddrSpace(ST); unsigned int PointerSize = CurDAG->getDataLayout().getPointerSizeInBits(ST->getAddressSpace()); // Volatile Setting - // - .volatile is only availalble for .global and .shared - bool isVolatile = ST->isVolatile(); + // - .volatile is only available for .global and .shared + // - .volatile has the same memory synchronization semantics as .relaxed.sys + bool isVolatile = ST->isVolatile() || Ordering == AtomicOrdering::Monotonic; if (CodeAddrSpace != NVPTX::PTXLdStInstCode::GLOBAL && CodeAddrSpace != NVPTX::PTXLdStInstCode::SHARED && CodeAddrSpace != NVPTX::PTXLdStInstCode::GENERIC) @@ -1739,41 +1766,53 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { toType = NVPTX::PTXLdStInstCode::Unsigned; // Create the machine instruction DAG - SDValue Chain = N->getOperand(0); - SDValue N1 = N->getOperand(1); - SDValue N2 = N->getOperand(2); + SDValue Chain = ST->getChain(); + SDValue Value = PlainStore ? PlainStore->getValue() : AtomicStore->getVal(); + SDValue BasePtr = ST->getBasePtr(); SDValue Addr; SDValue Offset, Base; Optional Opcode; - MVT::SimpleValueType SourceVT = N1.getNode()->getSimpleValueType(0).SimpleTy; + MVT::SimpleValueType SourceVT = + Value.getNode()->getSimpleValueType(0).SimpleTy; - if (SelectDirectAddr(N2, Addr)) { + if (SelectDirectAddr(BasePtr, Addr)) { Opcode = pickOpcodeForVT(SourceVT, NVPTX::ST_i8_avar, NVPTX::ST_i16_avar, NVPTX::ST_i32_avar, NVPTX::ST_i64_avar, NVPTX::ST_f16_avar, NVPTX::ST_f16x2_avar, NVPTX::ST_f32_avar, NVPTX::ST_f64_avar); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Addr, - Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Addr, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); - } else if (PointerSize == 64 ? SelectADDRsi64(N2.getNode(), N2, Base, Offset) - : SelectADDRsi(N2.getNode(), N2, Base, Offset)) { + } else if (PointerSize == 64 + ? SelectADDRsi64(BasePtr.getNode(), BasePtr, Base, Offset) + : SelectADDRsi(BasePtr.getNode(), BasePtr, Base, Offset)) { Opcode = pickOpcodeForVT(SourceVT, NVPTX::ST_i8_asi, NVPTX::ST_i16_asi, NVPTX::ST_i32_asi, NVPTX::ST_i64_asi, NVPTX::ST_f16_asi, NVPTX::ST_f16x2_asi, NVPTX::ST_f32_asi, NVPTX::ST_f64_asi); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Base, - Offset, Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Base, + Offset, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); - } else if (PointerSize == 64 ? SelectADDRri64(N2.getNode(), N2, Base, Offset) - : SelectADDRri(N2.getNode(), N2, Base, Offset)) { + } else if (PointerSize == 64 + ? SelectADDRri64(BasePtr.getNode(), BasePtr, Base, Offset) + : SelectADDRri(BasePtr.getNode(), BasePtr, Base, Offset)) { if (PointerSize == 64) Opcode = pickOpcodeForVT( SourceVT, NVPTX::ST_i8_ari_64, NVPTX::ST_i16_ari_64, @@ -1787,10 +1826,15 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), Base, - Offset, Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + Base, + Offset, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); } else { if (PointerSize == 64) @@ -1806,10 +1850,14 @@ bool NVPTXDAGToDAGISel::tryStore(SDNode *N) { NVPTX::ST_f32_areg, NVPTX::ST_f64_areg); if (!Opcode) return false; - SDValue Ops[] = { N1, getI32Imm(isVolatile, dl), - getI32Imm(CodeAddrSpace, dl), getI32Imm(vecType, dl), - getI32Imm(toType, dl), getI32Imm(toTypeWidth, dl), N2, - Chain }; + SDValue Ops[] = {Value, + getI32Imm(isVolatile, dl), + getI32Imm(CodeAddrSpace, dl), + getI32Imm(vecType, dl), + getI32Imm(toType, dl), + getI32Imm(toTypeWidth, dl), + BasePtr, + Chain}; NVPTXST = CurDAG->getMachineNode(Opcode.getValue(), dl, MVT::Other, Ops); } Modified: vendor/llvm/dist-release_70/lib/Transforms/Instrumentation/BoundsChecking.cpp ============================================================================== --- vendor/llvm/dist-release_70/lib/Transforms/Instrumentation/BoundsChecking.cpp Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/lib/Transforms/Instrumentation/BoundsChecking.cpp Sat Aug 11 16:29:25 2018 (r337631) @@ -47,21 +47,17 @@ STATISTIC(ChecksUnable, "Bounds checks unable to add") using BuilderTy = IRBuilder; -/// Adds run-time bounds checks to memory accessing instructions. +/// Gets the conditions under which memory accessing instructions will overflow. /// /// \p Ptr is the pointer that will be read/written, and \p InstVal is either /// the result from the load or the value being stored. It is used to determine /// the size of memory block that is touched. /// -/// \p GetTrapBB is a callable that returns the trap BB to use on failure. -/// -/// Returns true if any change was made to the IR, false otherwise. -template -static bool instrumentMemAccess(Value *Ptr, Value *InstVal, - const DataLayout &DL, TargetLibraryInfo &TLI, - ObjectSizeOffsetEvaluator &ObjSizeEval, - BuilderTy &IRB, GetTrapBBT GetTrapBB, - ScalarEvolution &SE) { +/// Returns the condition under which the access will overflow. +static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal, + const DataLayout &DL, TargetLibraryInfo &TLI, + ObjectSizeOffsetEvaluator &ObjSizeEval, + BuilderTy &IRB, ScalarEvolution &SE) { uint64_t NeededSize = DL.getTypeStoreSize(InstVal->getType()); LLVM_DEBUG(dbgs() << "Instrument " << *Ptr << " for " << Twine(NeededSize) << " bytes\n"); @@ -70,7 +66,7 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins if (!ObjSizeEval.bothKnown(SizeOffset)) { ++ChecksUnable; - return false; + return nullptr; } Value *Size = SizeOffset.first; @@ -107,13 +103,23 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins Or = IRB.CreateOr(Cmp1, Or); } + return Or; +} + +/// Adds run-time bounds checks to memory accessing instructions. +/// +/// \p Or is the condition that should guard the trap. +/// +/// \p GetTrapBB is a callable that returns the trap BB to use on failure. +template +static void insertBoundsCheck(Value *Or, BuilderTy IRB, GetTrapBBT GetTrapBB) { // check if the comparison is always false ConstantInt *C = dyn_cast_or_null(Or); if (C) { ++ChecksSkipped; // If non-zero, nothing to do. if (!C->getZExtValue()) - return true; + return; } ++ChecksAdded; @@ -127,12 +133,11 @@ static bool instrumentMemAccess(Value *Ptr, Value *Ins // FIXME: We should really handle this differently to bypass the splitting // the block. BranchInst::Create(GetTrapBB(IRB), OldBB); - return true; + return; } // Create the conditional branch. BranchInst::Create(GetTrapBB(IRB), Cont, Or, OldBB); - return true; } static bool addBoundsChecking(Function &F, TargetLibraryInfo &TLI, @@ -143,11 +148,25 @@ static bool addBoundsChecking(Function &F, TargetLibra // check HANDLE_MEMORY_INST in include/llvm/Instruction.def for memory // touching instructions - std::vector WorkList; + SmallVector, 4> TrapInfo; for (Instruction &I : instructions(F)) { - if (isa(I) || isa(I) || isa(I) || - isa(I)) - WorkList.push_back(&I); + Value *Or = nullptr; + BuilderTy IRB(I.getParent(), BasicBlock::iterator(&I), TargetFolder(DL)); + if (LoadInst *LI = dyn_cast(&I)) { + Or = getBoundsCheckCond(LI->getPointerOperand(), LI, DL, TLI, + ObjSizeEval, IRB, SE); + } else if (StoreInst *SI = dyn_cast(&I)) { + Or = getBoundsCheckCond(SI->getPointerOperand(), SI->getValueOperand(), + DL, TLI, ObjSizeEval, IRB, SE); + } else if (AtomicCmpXchgInst *AI = dyn_cast(&I)) { + Or = getBoundsCheckCond(AI->getPointerOperand(), AI->getCompareOperand(), + DL, TLI, ObjSizeEval, IRB, SE); + } else if (AtomicRMWInst *AI = dyn_cast(&I)) { + Or = getBoundsCheckCond(AI->getPointerOperand(), AI->getValOperand(), DL, + TLI, ObjSizeEval, IRB, SE); + } + if (Or) + TrapInfo.push_back(std::make_pair(&I, Or)); } // Create a trapping basic block on demand using a callback. Depending on @@ -176,29 +195,14 @@ static bool addBoundsChecking(Function &F, TargetLibra return TrapBB; }; - bool MadeChange = false; - for (Instruction *Inst : WorkList) { + // Add the checks. + for (const auto &Entry : TrapInfo) { + Instruction *Inst = Entry.first; BuilderTy IRB(Inst->getParent(), BasicBlock::iterator(Inst), TargetFolder(DL)); - if (LoadInst *LI = dyn_cast(Inst)) { - MadeChange |= instrumentMemAccess(LI->getPointerOperand(), LI, DL, TLI, - ObjSizeEval, IRB, GetTrapBB, SE); - } else if (StoreInst *SI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(SI->getPointerOperand(), SI->getValueOperand(), - DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else if (AtomicCmpXchgInst *AI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(AI->getPointerOperand(), AI->getCompareOperand(), - DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else if (AtomicRMWInst *AI = dyn_cast(Inst)) { - MadeChange |= - instrumentMemAccess(AI->getPointerOperand(), AI->getValOperand(), DL, - TLI, ObjSizeEval, IRB, GetTrapBB, SE); - } else { - llvm_unreachable("unknown Instruction type"); - } + insertBoundsCheck(Entry.second, IRB, GetTrapBB); } - return MadeChange; + + return !TrapInfo.empty(); } PreservedAnalyses BoundsCheckingPass::run(Function &F, FunctionAnalysisManager &AM) { Modified: vendor/llvm/dist-release_70/test/CodeGen/AArch64/fcopysign.ll ============================================================================== --- vendor/llvm/dist-release_70/test/CodeGen/AArch64/fcopysign.ll Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/test/CodeGen/AArch64/fcopysign.ll Sat Aug 11 16:29:25 2018 (r337631) @@ -5,10 +5,12 @@ target triple = "aarch64--" declare fp128 @llvm.copysign.f128(fp128, fp128) -@val = global double zeroinitializer, align 8 +@val_float = global float zeroinitializer, align 4 +@val_double = global double zeroinitializer, align 8 +@val_fp128 = global fp128 zeroinitializer, align 16 ; CHECK-LABEL: copysign0 -; CHECK: ldr [[REG:x[0-9]+]], [x8, :lo12:val] +; CHECK: ldr [[REG:x[0-9]+]], [x8, :lo12:val_double] ; CHECK: and [[ANDREG:x[0-9]+]], [[REG]], #0x8000000000000000 ; CHECK: lsr x[[LSRREGNUM:[0-9]+]], [[ANDREG]], #56 ; CHECK: bfxil w[[LSRREGNUM]], w{{[0-9]+}}, #0, #7 @@ -16,8 +18,25 @@ declare fp128 @llvm.copysign.f128(fp128, fp128) ; CHECK: ldr q{{[0-9]+}}, define fp128 @copysign0() { entry: - %v = load double, double* @val, align 8 + %v = load double, double* @val_double, align 8 %conv = fpext double %v to fp128 %call = tail call fp128 @llvm.copysign.f128(fp128 0xL00000000000000007FFF000000000000, fp128 %conv) #2 + ret fp128 %call +} + +; CHECK-LABEL: copysign1 +; CHECK-DAG: ldr [[REG:q[0-9]+]], [x8, :lo12:val_fp128] +; CHECK-DAG: ldr [[REG:w[0-9]+]], [x8, :lo12:val_float] +; CHECK: and [[ANDREG:w[0-9]+]], [[REG]], #0x80000000 +; CHECK: lsr w[[LSRREGNUM:[0-9]+]], [[ANDREG]], #24 +; CHECK: bfxil w[[LSRREGNUM]], w{{[0-9]+}}, #0, #7 +; CHECK: strb w[[LSRREGNUM]], +; CHECK: ldr q{{[0-9]+}}, +define fp128@copysign1() { +entry: + %v0 = load fp128, fp128* @val_fp128, align 16 + %v1 = load float, float* @val_float, align 4 + %conv = fpext float %v1 to fp128 + %call = tail call fp128 @llvm.copysign.f128(fp128 %v0, fp128 %conv) ret fp128 %call } Modified: vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/kernel-args.ll ============================================================================== --- vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/kernel-args.ll Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/kernel-args.ll Sat Aug 11 16:29:25 2018 (r337631) @@ -16,13 +16,8 @@ ; HSA-VI: s_and_b32 s{{[0-9]+}}, [[VAL]], 0xff -; EG: LSHR T0.X, KC0[2].Y, literal.x, -; EG-NEXT: MOV * T1.X, KC0[2].Z, -; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00) - -; CM: LSHR * T0.X, KC0[2].Y, literal.x, -; CM-NEXT: 2(2.802597e-45), 0(0.000000e+00) -; CM-NEXT: MOV * T1.X, KC0[2].Z, +; EGCM: VTX_READ_8{{.*}} #3 +; EGCM: KC0[2].Y define amdgpu_kernel void @i8_arg(i32 addrspace(1)* nocapture %out, i8 %in) nounwind { %ext = zext i8 %in to i32 store i32 %ext, i32 addrspace(1)* %out, align 4 @@ -92,14 +87,8 @@ define amdgpu_kernel void @i8_sext_arg(i32 addrspace(1 ; HSA-VI: s_and_b32 s{{[0-9]+}}, [[VAL]], 0xffff{{$}} ; HSA-VI: flat_store_dword - -; EG: LSHR T0.X, KC0[2].Y, literal.x, -; EG-NEXT: MOV * T1.X, KC0[2].Z, -; EG-NEXT: 2(2.802597e-45), 0(0.000000e+00) - -; CM: LSHR * T0.X, KC0[2].Y, literal.x, -; CM-NEXT: 2(2.802597e-45), 0(0.000000e+00) -; CM-NEXT: MOV * T1.X, KC0[2].Z, +; EGCM: VTX_READ_16 +; EGCM: KC0[2].Y define amdgpu_kernel void @i16_arg(i32 addrspace(1)* nocapture %out, i16 %in) nounwind { %ext = zext i16 %in to i32 store i32 %ext, i32 addrspace(1)* %out, align 4 Modified: vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/mad_uint24.ll ============================================================================== --- vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/mad_uint24.ll Sat Aug 11 16:12:23 2018 (r337630) +++ vendor/llvm/dist-release_70/test/CodeGen/AMDGPU/mad_uint24.ll Sat Aug 11 16:29:25 2018 (r337631) @@ -1,8 +1,8 @@ ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=EG --check-prefix=FUNC ; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s --check-prefix=EG --check-prefix=FUNC -; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck %s --check-prefix=SI --check-prefix=FUNC -; RUN: llc < %s -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s --check-prefix=VI --check-prefix=FUNC -; RUN: llc < %s -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s --check-prefix=VI --check-prefix=FUNC +; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck %s --check-prefix=SI --check-prefix=FUNC --check-prefix=GCN +; RUN: llc < %s -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s --check-prefix=VI --check-prefix=FUNC --check-prefix=GCN +; RUN: llc < %s -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s --check-prefix=VI --check-prefix=FUNC --check-prefix=GCN declare i32 @llvm.r600.read.tidig.x() nounwind readnone @@ -136,5 +136,92 @@ bb4: ; pr bb18: ; preds = %bb4 store i32 %tmp16, i32 addrspace(1)* %arg + ret void +} + +; FUNC-LABEL: {{^}}i8_mad_sat_16: +; EG: MULADD_UINT24 {{[* ]*}}T{{[0-9]}}.[[MAD_CHAN:[XYZW]]] +; The result must be sign-extended +; EG: BFE_INT {{[* ]*}}T{{[0-9]\.[XYZW]}}, PV.[[MAD_CHAN]], 0.0, literal.x +; EG: 8 +; SI: v_mad_u32_u24 [[MAD:v[0-9]]], {{[sv][0-9], [sv][0-9]}} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Aug 11 16:29:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37D111072637; Sat, 11 Aug 2018 16:29:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCD8185F92; Sat, 11 Aug 2018 16:29:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5E6D19ABD; Sat, 11 Aug 2018 16:29:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGTW6H019985; Sat, 11 Aug 2018 16:29:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGTW20019984; Sat, 11 Aug 2018 16:29:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111629.w7BGTW20019984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337632 - vendor/llvm/llvm-release_70-r339355 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm/llvm-release_70-r339355 X-SVN-Commit-Revision: 337632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:29:33 -0000 Author: dim Date: Sat Aug 11 16:29:32 2018 New Revision: 337632 URL: https://svnweb.freebsd.org/changeset/base/337632 Log: Tag llvm release_70 branch r339355. Added: vendor/llvm/llvm-release_70-r339355/ - copied from r337631, vendor/llvm/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 11 16:29:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D97301072689; Sat, 11 Aug 2018 16:29:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6875386150; Sat, 11 Aug 2018 16:29:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A232219AC0; Sat, 11 Aug 2018 16:29:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGTguH020096; Sat, 11 Aug 2018 16:29:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGTgnM020095; Sat, 11 Aug 2018 16:29:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111629.w7BGTgnM020095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337634 - vendor/clang/clang-release_70-r339355 X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/clang/clang-release_70-r339355 X-SVN-Commit-Revision: 337634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:29:44 -0000 Author: dim Date: Sat Aug 11 16:29:42 2018 New Revision: 337634 URL: https://svnweb.freebsd.org/changeset/base/337634 Log: Tag clang release_70 branch r339355. Added: vendor/clang/clang-release_70-r339355/ - copied from r337633, vendor/clang/dist-release_70/ From owner-svn-src-all@freebsd.org Sat Aug 11 16:29:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D58571072688; Sat, 11 Aug 2018 16:29:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBC9E860AA; Sat, 11 Aug 2018 16:29:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5662019ABF; Sat, 11 Aug 2018 16:29:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGTdJU020047; Sat, 11 Aug 2018 16:29:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGTaAG020033; Sat, 11 Aug 2018 16:29:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201808111629.w7BGTaAG020033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 11 Aug 2018 16:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r337633 - in vendor/clang/dist-release_70: docs lib/CodeGen lib/Headers lib/Sema test test/CodeGen test/SemaCXX www X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/clang/dist-release_70: docs lib/CodeGen lib/Headers lib/Sema test test/CodeGen test/SemaCXX www X-SVN-Commit-Revision: 337633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:29:44 -0000 Author: dim Date: Sat Aug 11 16:29:35 2018 New Revision: 337633 URL: https://svnweb.freebsd.org/changeset/base/337633 Log: Vendor import of clang release_70 branch r339355: https://llvm.org/svn/llvm-project/cfe/branches/release_70@339355 Added: vendor/clang/dist-release_70/test/CodeGen/global-blocks-win32.c (contents, props changed) Modified: vendor/clang/dist-release_70/docs/AddressSanitizer.rst vendor/clang/dist-release_70/docs/MemorySanitizer.rst vendor/clang/dist-release_70/docs/ReleaseNotes.rst vendor/clang/dist-release_70/lib/CodeGen/CGBlocks.cpp vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp vendor/clang/dist-release_70/lib/CodeGen/CodeGenAction.cpp vendor/clang/dist-release_70/lib/Headers/unwind.h vendor/clang/dist-release_70/lib/Sema/SemaExprCXX.cpp vendor/clang/dist-release_70/test/SemaCXX/constructor.cpp vendor/clang/dist-release_70/test/lit.cfg.py vendor/clang/dist-release_70/www/cxx_dr_status.html vendor/clang/dist-release_70/www/cxx_status.html vendor/clang/dist-release_70/www/make_cxx_dr_status Modified: vendor/clang/dist-release_70/docs/AddressSanitizer.rst ============================================================================== --- vendor/clang/dist-release_70/docs/AddressSanitizer.rst Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/docs/AddressSanitizer.rst Sat Aug 11 16:29:35 2018 (r337633) @@ -144,6 +144,12 @@ For more information on leak detector in AddressSaniti and can be enabled using ``ASAN_OPTIONS=detect_leaks=1`` on OS X; however, it is not yet supported on other platforms. +Writable/Executable paging detection +------------------------------------ + +The W^X detection is disabled by default and can be enabled using +``ASAN_OPTIONS=detect_write_exec=1``. + Issue Suppression ================= Modified: vendor/clang/dist-release_70/docs/MemorySanitizer.rst ============================================================================== --- vendor/clang/dist-release_70/docs/MemorySanitizer.rst Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/docs/MemorySanitizer.rst Sat Aug 11 16:29:35 2018 (r337633) @@ -165,6 +165,13 @@ to: #. Set environment variable `MSAN_OPTIONS=poison_in_dtor=1` before running the program. +Writable/Executable paging detection +==================================== + +You can eable writable-executable page detection in MemorySanitizer by +setting the environment variable `MSAN_OPTIONS=detect_write_exec=1` before +running the program. + Handling external code ====================== Modified: vendor/clang/dist-release_70/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist-release_70/docs/ReleaseNotes.rst Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/docs/ReleaseNotes.rst Sat Aug 11 16:29:35 2018 (r337633) @@ -284,7 +284,8 @@ libclang Static Analyzer --------------- -- ... +- The new `MmapWriteExec` checker had been introduced to detect attempts to map pages +both writable and executable. ... Modified: vendor/clang/dist-release_70/lib/CodeGen/CGBlocks.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/CodeGen/CGBlocks.cpp Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/lib/CodeGen/CGBlocks.cpp Sat Aug 11 16:29:35 2018 (r337633) @@ -1213,9 +1213,13 @@ static llvm::Constant *buildGlobalBlock(CodeGenModule auto fields = builder.beginStruct(); bool IsOpenCL = CGM.getLangOpts().OpenCL; + bool IsWindows = CGM.getTarget().getTriple().isOSWindows(); if (!IsOpenCL) { // isa - fields.add(CGM.getNSConcreteGlobalBlock()); + if (IsWindows) + fields.addNullPointer(CGM.Int8PtrPtrTy); + else + fields.add(CGM.getNSConcreteGlobalBlock()); // __flags BlockFlags flags = BLOCK_IS_GLOBAL | BLOCK_HAS_SIGNATURE; @@ -1250,7 +1254,27 @@ static llvm::Constant *buildGlobalBlock(CodeGenModule llvm::Constant *literal = fields.finishAndCreateGlobal( "__block_literal_global", blockInfo.BlockAlign, - /*constant*/ true, llvm::GlobalVariable::InternalLinkage, AddrSpace); + /*constant*/ !IsWindows, llvm::GlobalVariable::InternalLinkage, AddrSpace); + + // Windows does not allow globals to be initialised to point to globals in + // different DLLs. Any such variables must run code to initialise them. + if (IsWindows) { + auto *Init = llvm::Function::Create(llvm::FunctionType::get(CGM.VoidTy, + {}), llvm::GlobalValue::InternalLinkage, ".block_isa_init", + &CGM.getModule()); + llvm::IRBuilder<> b(llvm::BasicBlock::Create(CGM.getLLVMContext(), "entry", + Init)); + b.CreateAlignedStore(CGM.getNSConcreteGlobalBlock(), + b.CreateStructGEP(literal, 0), CGM.getPointerAlign().getQuantity()); + b.CreateRetVoid(); + // We can't use the normal LLVM global initialisation array, because we + // need to specify that this runs early in library initialisation. + auto *InitVar = new llvm::GlobalVariable(CGM.getModule(), Init->getType(), + /*isConstant*/true, llvm::GlobalValue::InternalLinkage, + Init, ".block_isa_init_ptr"); + InitVar->setSection(".CRT$XCLa"); + CGM.addUsedGlobal(InitVar); + } // Return a constant of the appropriately-casted type. llvm::Type *RequiredType = Modified: vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/lib/CodeGen/CGObjCGNU.cpp Sat Aug 11 16:29:35 2018 (r337633) @@ -3812,40 +3812,10 @@ llvm::GlobalVariable *CGObjCGNU::ObjCIvarOffsetVariabl // is. This allows code compiled with non-fragile ivars to work correctly // when linked against code which isn't (most of the time). llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name); - if (!IvarOffsetPointer) { - // This will cause a run-time crash if we accidentally use it. A value of - // 0 would seem more sensible, but will silently overwrite the isa pointer - // causing a great deal of confusion. - uint64_t Offset = -1; - // We can't call ComputeIvarBaseOffset() here if we have the - // implementation, because it will create an invalid ASTRecordLayout object - // that we are then stuck with forever, so we only initialize the ivar - // offset variable with a guess if we only have the interface. The - // initializer will be reset later anyway, when we are generating the class - // description. - if (!CGM.getContext().getObjCImplementation( - const_cast(ID))) - Offset = ComputeIvarBaseOffset(CGM, ID, Ivar); - - llvm::ConstantInt *OffsetGuess = llvm::ConstantInt::get(Int32Ty, Offset, - /*isSigned*/true); - // Don't emit the guess in non-PIC code because the linker will not be able - // to replace it with the real version for a library. In non-PIC code you - // must compile with the fragile ABI if you want to use ivars from a - // GCC-compiled class. - if (CGM.getLangOpts().PICLevel) { - llvm::GlobalVariable *IvarOffsetGV = new llvm::GlobalVariable(TheModule, - Int32Ty, false, - llvm::GlobalValue::PrivateLinkage, OffsetGuess, Name+".guess"); - IvarOffsetPointer = new llvm::GlobalVariable(TheModule, - IvarOffsetGV->getType(), false, llvm::GlobalValue::LinkOnceAnyLinkage, - IvarOffsetGV, Name); - } else { - IvarOffsetPointer = new llvm::GlobalVariable(TheModule, - llvm::Type::getInt32PtrTy(VMContext), false, - llvm::GlobalValue::ExternalLinkage, nullptr, Name); - } - } + if (!IvarOffsetPointer) + IvarOffsetPointer = new llvm::GlobalVariable(TheModule, + llvm::Type::getInt32PtrTy(VMContext), false, + llvm::GlobalValue::ExternalLinkage, nullptr, Name); return IvarOffsetPointer; } Modified: vendor/clang/dist-release_70/lib/CodeGen/CodeGenAction.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/CodeGen/CodeGenAction.cpp Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/lib/CodeGen/CodeGenAction.cpp Sat Aug 11 16:29:35 2018 (r337633) @@ -127,6 +127,7 @@ namespace clang { CodeGenOpts, C, CoverageInfo)), LinkModules(std::move(LinkModules)) { FrontendTimesIsEnabled = TimePasses; + llvm::TimePassesIsEnabled = TimePasses; } llvm::Module *getModule() const { return Gen->GetModule(); } std::unique_ptr takeModule() { Modified: vendor/clang/dist-release_70/lib/Headers/unwind.h ============================================================================== --- vendor/clang/dist-release_70/lib/Headers/unwind.h Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/lib/Headers/unwind.h Sat Aug 11 16:29:35 2018 (r337633) @@ -154,8 +154,12 @@ struct _Unwind_Control_Block { struct _Unwind_Exception { _Unwind_Exception_Class exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; +#if !defined (__USING_SJLJ_EXCEPTIONS__) && defined (__SEH__) + _Unwind_Word private_[6]; +#else _Unwind_Word private_1; _Unwind_Word private_2; +#endif /* The Itanium ABI requires that _Unwind_Exception objects are "double-word * aligned". GCC has interpreted this to mean "use the maximum useful * alignment for the target"; so do we. */ Modified: vendor/clang/dist-release_70/lib/Sema/SemaExprCXX.cpp ============================================================================== --- vendor/clang/dist-release_70/lib/Sema/SemaExprCXX.cpp Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/lib/Sema/SemaExprCXX.cpp Sat Aug 11 16:29:35 2018 (r337633) @@ -113,9 +113,15 @@ ParsedType Sema::getConstructorName(IdentifierInfo &II break; } } - if (!InjectedClassName && CurClass->isInvalidDecl()) + if (!InjectedClassName) { + if (!CurClass->isInvalidDecl()) { + // FIXME: RequireCompleteDeclContext doesn't check dependent contexts + // properly. Work around it here for now. + Diag(SS.getLastQualifierNameLoc(), + diag::err_incomplete_nested_name_spec) << CurClass << SS.getRange(); + } return ParsedType(); - assert(InjectedClassName && "couldn't find injected class name"); + } QualType T = Context.getTypeDeclType(InjectedClassName); DiagnoseUseOfDecl(InjectedClassName, NameLoc); Added: vendor/clang/dist-release_70/test/CodeGen/global-blocks-win32.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist-release_70/test/CodeGen/global-blocks-win32.c Sat Aug 11 16:29:35 2018 (r337633) @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -fblocks -triple i386-pc-windows-msvc %s -emit-llvm -o - -fblocks | FileCheck %s + + +int (^x)(void) = ^() { return 21; }; + + +// Check that the block literal is emitted with a null isa pointer +// CHECK: @__block_literal_global = internal global { i8**, i32, i32, i8*, %struct.__block_descriptor* } { i8** null, + +// Check that _NSConcreteGlobalBlock has the correct dllimport specifier. +// CHECK: @_NSConcreteGlobalBlock = external dllimport global i8* +// Check that we create an initialiser pointer in the correct section (early library initialisation). +// CHECK: @.block_isa_init_ptr = internal constant void ()* @.block_isa_init, section ".CRT$XCLa" + +// Check that we emit an initialiser for it. +// CHECK: define internal void @.block_isa_init() { +// CHECK: store i8** @_NSConcreteGlobalBlock, i8*** getelementptr inbounds ({ i8**, i32, i32, i8*, %struct.__block_descriptor* }, { i8**, i32, i32, i8*, %struct.__block_descriptor* }* @__block_literal_global, i32 0, i32 0), align 4 + Modified: vendor/clang/dist-release_70/test/SemaCXX/constructor.cpp ============================================================================== --- vendor/clang/dist-release_70/test/SemaCXX/constructor.cpp Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/test/SemaCXX/constructor.cpp Sat Aug 11 16:29:35 2018 (r337633) @@ -86,3 +86,14 @@ A::S::operator int() { return 1; } A::S::~S() {} +namespace PR38286 { + // FIXME: It'd be nice to give more consistent diagnostics for these cases + // (but they're all failing for somewhat different reasons...). + template struct A; + template A::A() {} // expected-error {{incomplete type 'A' named in nested name specifier}} + /*FIXME: needed to recover properly from previous error*/; + template struct B; + template void B::f() {} // expected-error {{out-of-line definition of 'f' from class 'B'}} + template struct C; + template C::~C() {} // expected-error {{no type named 'C' in 'C'}} +} Modified: vendor/clang/dist-release_70/test/lit.cfg.py ============================================================================== --- vendor/clang/dist-release_70/test/lit.cfg.py Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/test/lit.cfg.py Sat Aug 11 16:29:35 2018 (r337633) @@ -71,7 +71,7 @@ llvm_config.add_tool_substitutions(tools, tool_dirs) config.substitutions.append( ('%hmaptool', "'%s' %s" % (config.python_executable, - os.path.join(config.llvm_tools_dir, 'hmaptool')))) + os.path.join(config.clang_tools_dir, 'hmaptool')))) # Plugins (loadable modules) # TODO: This should be supplied by Makefile or autoconf. Modified: vendor/clang/dist-release_70/www/cxx_dr_status.html ============================================================================== --- vendor/clang/dist-release_70/www/cxx_dr_status.html Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/www/cxx_dr_status.html Sat Aug 11 16:29:35 2018 (r337633) @@ -28,7 +28,7 @@

          C++ Defect Report Support in Clang

          -

          Last updated: $Date: 2018-07-27 06:41:37 +0200 (Fri, 27 Jul 2018) $

          +

          Last updated: $Date: 2018-08-06 12:32:02 +0200 (Mon, 06 Aug 2018) $

          C++ defect report implementation status

          @@ -2021,7 +2021,7 @@ of class templates 330 CD4 Qualification conversions and pointers to arrays of pointers - SVN + Clang 7 331 @@ -7093,7 +7093,7 @@ and POD class 1213 CD3 Array subscripting and xvalues - SVN + Clang 7 1214 @@ -9847,7 +9847,7 @@ and POD class 1672 CD4 Layout compatibility with multiple empty bases - SVN + Clang 7 1673 @@ -9937,7 +9937,7 @@ and POD class 1687 C++14 Conversions of operands of built-in operators - SVN + Clang 7 1688 @@ -9991,7 +9991,7 @@ and POD class 1696 CD4 Temporary lifetime and non-static data member initializers - SVN + Clang 7 1697 @@ -10693,7 +10693,7 @@ and POD class 1813 CD4 Direct vs indirect bases in standard-layout classes - SVN + Clang 7 1814 @@ -11101,7 +11101,7 @@ and POD class 1881 CD4 Standard-layout classes and unnamed bit-fields - SVN + Clang 7 1882 @@ -12535,7 +12535,7 @@ and POD class 2120 CD4 Array as first non-static data member in standard-layout class - SVN + Clang 7 2121 @@ -13189,7 +13189,7 @@ and POD class 2229 tentatively ready Volatile unnamed bit-fields - SVN + Clang 7 2230 Modified: vendor/clang/dist-release_70/www/cxx_status.html ============================================================================== --- vendor/clang/dist-release_70/www/cxx_status.html Sat Aug 11 16:29:32 2018 (r337632) +++ vendor/clang/dist-release_70/www/cxx_status.html Sat Aug 11 16:29:35 2018 (r337633) @@ -26,7 +26,7 @@

          C++ Support in Clang

          -

          Last updated: $Date: 2018-07-27 06:41:37 +0200 (Fri, 27 Jul 2018) $

          +

          Last updated: $Date: 2018-08-06 12:32:02 +0200 (Mon, 06 Aug 2018) $

          Clang fully implements all published ISO C++ standards (C++98 / C++03, P0620R0 (DR) - SVN + Clang 7 @@ -1026,7 +1026,7 @@ and library features that are not part of standard C++ - SVN (P0096R5) + Clang 7 (P0096R5)